[WITHDRAW]possible bug -channel rgb switch -contrast-stretch

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

[WITHDRAW]possible bug -channel rgb switch -contrast-stretch

Post by fmw42 »

The switch (-channel rgb) for -contrast-stretch to process each channel separately is does not seem to be working in IM 6.7.6.9 beta and also at least as far back as IM 6.7.4.10

These two examples show no differences.

convert rose: -contrast-stretch 2x2% show:

convert rose: -channel rgb -contrast-stretch 2x2% show:

Same with other images I have tested.
Last edited by fmw42 on 2012-05-03T14:41:36-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 -channel rgb switch -contrast-stretch

Post by magick »

These two commands are equivalent:
  • convert rose: -contrast-stretch 2x2% show:
    convert rose: -channel rgb -contrast-stretch 2x2% show:
The default channels, when not explicitly specified, is RGB. If the image had an alpha channel and you specified -channel rgba you would expect some differences due to the alpha channel being stretched.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -channel rgb switch -contrast-stretch

Post by fmw42 »

magick wrote:These two commands are equivalent:
  • convert rose: -contrast-stretch 2x2% show:
    convert rose: -channel rgb -contrast-stretch 2x2% show:
The default channels, when not explicitly specified, is RGB. If the image had an alpha channel and you specified -channel rgba you would expect some differences due to the alpha channel being stretched.
Please check with Anthony. It used to work to process each channel separately. See the port image examples for contrast-stretch with and without -channel rgb under http://www.imagemagick.org/Usage/color_ ... ar-stretch

From that page:
"However, if "-channel RGB" is specified, then each channel will be stretched separately and the result will depend upon the end bins in each channel. If they are different, then a color shift will be produced between the individual channels in the resulting image."
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -channel rgb switch -contrast-stretch

Post by fmw42 »

correction. the rose image is not a good test. It seems to working fine using the port image. So my script failure is due to some other factor.

Image

The last two should be the same and different from the first.

convert port2.png -contrast-stretch 2x2% show:
convert port2.png -channel rgb -contrast-stretch 2x2% show:
convert port2.png -channel rgb -separate -contrast-stretch 2x2% -combine show:
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: [WITHDRAW]possible bug -channel rgb switch -contrast-str

Post by anthony »

See normalize examples.
http://www.imagemagick.org/Usage/color_mods/#normalize

If you get yellow in the test image, each channel was normalized seperatally. This happened when channels was set to anything except the 'default' either -channels RGB or -channel ALL


I have a list of such operators that need to be checked over in IMv7 when I get the main API finished.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply