I need to change an icon color in a png file, where the icon has a transparent background.
I used the following ImageMagick command:
convert my_icon.png -fill #de2a2a" -colorize 100 output1.png
In Windows, the command colors the icon without the transparent background.
In Linux, it colors "all the icon" including the transparent background.
Why does this happen? How can I solve this problem in Linux?
The ImageMagick version:
The Icon:
Thanks
On Ubuntu 18.04 (ImageMagick 6.9.7-4) the issue is no longer reproducible. Also tested on MacOS 10.14 (ImageMagick 7.0.8-47).
Command:
convert ~/Desktop/phone.png -fill "#de2a2a" -colorize 100 ~/Desktop/phone-red.png
Note, you have a typo in your command...
-fill #de2a2a"
Should be: (double-quote before the #
)
-fill "#de2a2a"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With