Imagemagick version differences or OS difference

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
webarto
Posts: 2
Joined: 2012-03-11T14:55:18-07:00
Authentication code: 8675308

Imagemagick version differences or OS difference

Post by webarto »

Hi, this is my first thread, great forum by the way :)

I have a noob question. Same command is "not working" on different IM versions and OS. Is this because of different versions or I am doing something wrong? Thanks.

Debian - IM 6.2.8

Code: Select all

convert input.jpg -modulate 120,10,100 -fill "#222b6d" -colorize 20 -gamma 0.5 -contrast -contrast output.jpg
BAD

Code: Select all

convert input.jpg -modulate 120,10,100 -colorize 20 -gamma 0.5 -contrast -contrast output.jpg
OK without -fill

WinXP - IM 6.7.5

Code: Select all

convert input.jpg -modulate 120,10,100 -fill "#222b6d" -colorize 20 -gamma 0.5 -contrast -contrast output.jpg
OK
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Imagemagick version differences or OS difference

Post by fmw42 »

The old modulate (prior to IM v6.4.0-10) used HSB color space. Newer versions of IM use HSL colorspace, but (as of IM v6.5.3-7 and later) you can use a -define to set it to use HSB.

see
http://www.imagemagick.org/Usage/color_ ... colorspace
webarto
Posts: 2
Joined: 2012-03-11T14:55:18-07:00
Authentication code: 8675308

Re: Imagemagick version differences or OS difference

Post by webarto »

I upgraded IM to 6.7.1-7, and results were still odd, the problem was quoted colors with escaped shell command. I have removed quotes and it is working fine on CentOS. I've linked Your's and Anthony's website on http://net.tutsplus.com/tutorials/php/c ... -with-php/, without your extensive scripts it would be impossible to figure things out. Cheers.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Imagemagick version differences or OS difference

Post by fmw42 »

If you are using PHP exec (?), then you have to be very careful about quoting and switching between double quote, single quotes and escaped quotes.

In the IM command line from a terminal, double quotes should work just fine. They are especially important when you have rgb colors in the cases where you have spaces there, such as "rgb(255, 100, 50)". It probably would work fine without the quotes if the spaces are removed. On some unix systems, you may have to quote hex values to avoid confusion with the #. However, I am not an expert on that. I always put my color values (not color names) in double quotes and have not had any problems doing so on my Mac OSX system (using the command line or my scripts from the terminal).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Imagemagick version differences or OS difference

Post by fmw42 »

Very nice web site and your creation of Instagram-like effects. They seem to be very popular these days.
Post Reply