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