Colorize not working properly in ubuntu but works fine in Mac

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
vinothg
Posts: 1
Joined: 2015-07-02T23:46:54-07:00
Authentication code: 1151

Colorize not working properly in ubuntu but works fine in Mac

Post by vinothg »

I am trying to colorize the below image to blue using the command

Code: Select all

"convert input.png -fill blue3 -colorize 100% output.png" 
Image

In Mac, it is working perfectly fine but in ubuntu it is colorizing the whole image to blue.

Mac output ->

Image

Ubuntu output ->

Image

Is there a different command for ubuntu ?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Colorize not working properly in ubuntu but works fine in Mac

Post by dlemstra »

You are probably using different versions of ImageMagick. You can get version information with 'convert -version'.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorize not working properly in ubuntu but works fine in Mac

Post by fmw42 »

The behavior of -colorize has changed over time when there is an alpha channel. Your png images have been converted to jpg by your hosting service, so we cannot tell anything about the alpha channel.

Please identify your IM versions on your two systems. On current IM versions I get your correct behavior only coloring the lines.

Try this on your Ubuntu system:

Code: Select all

convert input.png -alpha off -fill blue -colorize 100% -alpha on output.png
or this if your system is really old

Code: Select all

convert test.png \
\( -clone 0 +matte -fill blue -colorize 100% \) \
\( -clone 0 -channel a -separate +channel \) \
-delete 0 +matte -compose copy_opacity -composite show:
Post Reply