[Resolved]possible bug -negate IM 6.7.9.1 Q16

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
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[Resolved]possible bug -negate IM 6.7.9.1 Q16

Post by fmw42 »

IM 6.7.9.1 Q16 Mac OSX Snow Leopard

Input:
Image

In this command the first image (channel G = saturation) never gets negated.

convert zelda3_lowsat.jpg -colorspace HSL -channel G -negate +channel \
-channel B -solarize 50% -level 0x50% +channel -channel GB -separate +channel \
zelda3_lowsat_sb_solar1_%d.jpg



In this command the first image (channel G = saturation) properly gets negated.

convert zelda3_lowsat.jpg -colorspace HSL -channel GB -separate +channel \
\( -clone 0 -negate \) \
\( -clone 1 -solarize 50% -level 0x50% \) \
-delete 0,1 zelda3_lowsat_sb_solar2_%d.jpg


Is this a bug or am I misunderstanding or missing some thing?
Last edited by fmw42 on 2012-08-25T22:43:09-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -negate IM 6.7.9.1 Q16

Post by magick »

The negate for the green channel is working:

convert zelda3_lowsat.jpg -colorspace HSL -channel G -negate -verbose info:

Code: Select all

    Red:
      min: 0 (0)
      max: 255 (0.999878)
      mean: 74.911 (0.293768)
      standard deviation: 98.3857 (0.385826)
      kurtosis: -0.569333
      skewness: 1.13011
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 149.094 (0.584682)
      standard deviation: 80.9888 (0.317603)
      kurtosis: -0.968081
      skewness: -0.641811
    Blue:
      min: 0 (0.000457771)
      max: 247 (0.969345)
      mean: 92.5542 (0.362958)
      standard deviation: 55.062 (0.215929)
      kurtosis: -0.451429
      skewness: 0.582601
convert zelda3_lowsat.jpg -colorspace HSL -verbose info:

Code: Select all

    Red:
      min: 0 (0)
      max: 255 (0.999878)
      mean: 74.911 (0.293768)
      standard deviation: 98.3857 (0.385826)
      kurtosis: -0.569333
      skewness: 1.13011
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 105.906 (0.415318)
      standard deviation: 80.9888 (0.317603)
      kurtosis: -0.968081
      skewness: 0.641811
    Blue:
      min: 0 (0.000457771)
      max: 247 (0.969345)
      mean: 92.5542 (0.362958)
      standard deviation: 55.062 (0.215929)
      kurtosis: -0.451429
      skewness: 0.582601
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -negate IM 6.7.9.1 Q16

Post by fmw42 »

But it does not work when followed by the solarize on the blue channel. Run my commands and look at the output images. The first image (green=saturation) has not been inverted in the first command but is inverted in the second command.

Sorry I should have mentioned that it works fine without the solarize on the blue channel (at least for me on my Mac OSX Snow Leopard IM 6.7.9.1 Q16)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -negate IM 6.7.9.1 Q16

Post by magick »

The -solarize option is not sensitive to the -channel option. We'll add support in the next point release.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -negate IM 6.7.9.1 Q16

Post by fmw42 »

With the latest beta from today, it appears to be now properly negating the saturation, but not properly solarizing the brightness.


Input:
Image



Bad:

convert zelda3_lowsat.jpg -colorspace HSL -channel G -negate +channel \
-channel B -solarize 50% -level 0x50% +channel -channel GB -separate +channel \
zelda3_lowsat_sb_solar1_%d.jpg

Negated saturation correct
Image

Solarized brightness incorrect
Image



Correct:

convert zelda3_lowsat.jpg -colorspace HSL -channel GB -separate +channel \
\( -clone 0 -negate \) \
\( -clone 1 -solarize 50% -level 0x50% \) \
-delete 0,1 zelda3_lowsat_sb_solar2_%d.jpg

Negated saturation correct
Image

Solarized brightness correct
Image
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -negate IM 6.7.9.1 Q16

Post by magick »

Will have a patch in about an hours. Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -negate IM 6.7.9.1 Q16

Post by fmw42 »

magick wrote:Will have a patch in about an hours. Thanks.

Thanks. Seems to be working fine now in IM 6.7.9.2 Q16 just released.
Post Reply