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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
jianing
Posts: 1
Joined: 2011-06-04T13:55:22-07:00
Authentication code: 8675308

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

Post by jianing » 2011-06-04T14:26:14-07:00

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.

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post by anthony » 2011-06-11T06:16:00-07:00

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply