Is it possible to apply a color overlay on a sprite?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By YP

Is it possible to apply a color overlay (or some kind of filter) on a sprite that is an imported image?
I’ve already tried the self modulate option in the editor but it’s not working. And I want the effect to be applied in the editor

What do you mean by “self modulate” doesn’t work? Because that option is supposed to do what you want.

Zylann | 2018-10-30 18:26

I mean it really isn’t working. I’ve tried several colors in both modulate and self modulate and nothing changes

YP | 2018-10-30 18:28

Can you share an example of that?

Zylann | 2018-10-30 18:38

I just added a screenshot

YP | 2018-10-30 21:24

:bust_in_silhouette: Reply From: Zylann

Your images are black. Godot can only modulate by color multiplication, so modulating a black image will not change anything. You could use a white image instead (and then set modulate to black if you want black, or red if you want it red).

You are right, I had to change their color to white. Here is the thing now, I’m using this scene and it’s sprites as a base to create a tileset, as shown in the tuts. However, every tile in the tileset is still white. Can something be done about it?

YP | 2018-10-31 14:12

Modulate doesn’t work with tiles, so you may either make pre-made textures for each, or use nodes instead of tiles.

Zylann | 2018-11-01 19:18

:bust_in_silhouette: Reply From: j4

As of writing this answer, .modulate accepts RGBA values above 1 and can be used to brighten pitch black images.