Page 1 of 1

How to set color space to HSB for the Modulate call?

Posted: 2011-06-04T14:26:14-07:00
by jianing
We have recently upgraded from ImageMagick 6.3.3 to 6.6.9, and our script that uses PerlMagick's Modulate call broke because in 6.3.3 Modulate uses HSB color space but now it uses HSL color space.

Using convert -define modulate:colorspace=HSB -modulate from the command line I can get results that match those from 6.3.3. But I can't figure out how to tell Modulate to use HSB color space in PerlMagick. I have tried Quantize(colorspace => 'HSB'), which doesn't seem to have any effect at all. I have also tried Set(colorspace => 'HSB'), which does change the output, but the output doesn't match that from running convert -define modulate:colorspace=HSB -modulate, which is what we want.

Any advice on how to make Modulate use HSB color space is greatly appreciated. Thanks in advance.

Re: How to set color space to HSB for the Modulate call?

Posted: 2011-06-11T06:16:00-07:00
by anthony
You need to set an image artifact. that is what -define does.
See IM Examples, Basics, Define Global Artifacts
http://www.imagemagick.org/Usage/basics/#define

But you can also use -set for this! EG: set option:modulate:colorspace HSB

You can see image artefacts that were defined in the -verbose info: output.

I have not looked over the PerlMagick commands, but I am sure 'set' is present.