• Godot HelpGUI
  • Is there a texture-like resource that allows for image processing?

I run into this issue constantly: if I need an icon for my button, or slider, or whatever node requires a image to work, most of the times the actual image file (.png .svg etc.) is either to big or to small to work for that icon, or maybe I want it to be a different color. What I do each time is either use an image rect as a child of the button/slider to control the image (wich feels like a lot of unnecessary work) or I modify the image file itself to fit my requirements.

Now, wouldn't it be great if there was some kind of resource for editing an image? A resource that stores the original texture, allows the user to edit it (change scale, size, hue, crop etc...) and that can itself be used as a texture. Kinda like atlas texture works for cropping an image, but with more features.

It doesn't even have to be all in one resource, you can have a nested resource system where each resource does some processing an outputs its result to the next one and so on.

Does this already exist? If not, how can we implement it?

Megalomaniak Doesn't look like I can do any editing in the editor, wich is what I was asking. Or maybe I don't know how to do it?

That's done with GIMP or Photoshop or the like, if I don't misunderstand. These tools are there for image editing.

https://docs.godotengine.org/en/stable/classes/class_imagetexture.html#class-imagetexture-method-create-from-image

https://docs.godotengine.org/en/stable/classes/class_texture.html#class-texture-method-get-data

https://docs.godotengine.org/en/stable/classes/class_image.html#class-image-method-create-from-data

starting with an image and converting between image and textureimage should hopefully get you what you want, though I'm not sure just how performant this will be, since I'd expect the conversions to have some overhead.

As for doing this stuff in the editor, it might be doable as plugin, but if not then what you want to do might just need to be a core/source module. Really depends what exactly are you looking to do.