Problem with hue shift using "-modulate" with IM7.0.7-39

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Problem with hue shift using "-modulate" with IM7.0.7-39

Post by GeeMack »

Using IM 7.0.7-39 Q16 x64 HDRI from a Windows 10 command line, this command generates the image below.

Code: Select all

magick -size 4x200 xc:red -duplicate 199 -modulate 100,100,%[fx:t] +append modhue.png
Image

Those 200 images appended should show a continuous shifting of the hue from cyan on the left, through red in the center, and back through green to cyan on the right, but the result isn't as expected. Setting the hue shift to more than "133.3" on the "-modulate" operator seems to cycle the setting back to "100". And it changes again the same way when the setting is more than "166.6".

This issue goes back at least one version before 7.0.7-39.

The same problem is also present in IM 6.9.9-50. Starting with a red image and a "-modulate" hue setting of "133", this command changes the color to "srgb(100%,99%,0%)", almost pure yellow as expected...

Code: Select all

convert xc:red -modulate 100,100,133 -format %[pixel:p{0,0}] info:
But change that "-modulate" hue setting to "134"...

Code: Select all

convert xc:red -modulate 100,100,134 -format %[pixel:p{0,0}] info:
... and the result is "srgb(100%,2%,0%)", almost the same as the input color of pure red. It should be shifting toward green.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with hue shift using "-modulate" with IM7.0.7-39

Post by fmw42 »

I can confirm this. The change to a bad result occurred first at 6.9.9.41 Q16 Mac OSX.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with hue shift using "-modulate" with IM7.0.7-39

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Problem with hue shift using "-modulate" with IM7.0.7-39

Post by GeeMack »

This issue appears to be fixed in the new IM version 7.0.8-0. Thanks!
Post Reply