Icon-Compositor 0.0
How to change an icon's color

One method of changing an icon's color may be found in a combination of the monochrome function and the multiply operator, but that can look a little flat. It loses the shadows and highlights.

To calculate an overlay which contains the highlights and shadows, we want the difference between the image and its average.

icomp 'difference( dragon.png , pixel_average(dragon.png) , 10)' -o change_icon_color_overlay.png
     
This doesn't look like much yet, until we put it over the top of a solid color...
icomp '( change_color_icon_overlay.png over red ) | masked_by( dragon.png * 0 )' -o change_icon_color_red.png
       
This can all be done in a single script file, with no temporary overlay file, like this:
d = dragon.png;
ov = difference(d, pixel_average(d), 10);
mk = d * 0;
(ov over red) | masked_by(mk)
You can use this technique to generate icons of about 16 million other colors...

See Also

difference, masked_by, monochrome, multiply, over, pixel_average,