[RESOLVED]possible bug -equalize 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 -equalize IM 6.7.9.1 Q16

Post by fmw42 »

IM 6.7.9.1 Q16 Mac OSX Snow Leopard.

Is -equalize channel sensitive? That is can I force it to sync all channels.

It seems that by default is equalizes each channel as if -channel rgb was specified. When I try to add -channel sync, it does not change the input image.


Input:
Image


No sync:
convert zelda2.jpg -equalize zelda2_equal.jpg
Image

With sync: result same as input
convert zelda2.jpg -channel sync -equalize zelda2_equal_sync.jpg
Image

Using my redist script with uniform distribution, which should be like syncing the channels with -equalize:
redist -s uniform zelda2.jpg zelda2_uni.jpg
Image
Last edited by fmw42 on 2012-09-03T21:27:43-07:00, edited 3 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible but -equalize IM 6.7.9.1 Q16

Post by magick »

The -equalize option is not sensitive to the -channel sync option.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible but -equalize IM 6.7.9.1 Q16

Post by fmw42 »

OK. Thanks for clearing that up.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: [Resolved]possible but -equalize IM 6.7.9.1 Q16

Post by magick »

Forgot to mention, we'll get a patch into ImageMagick 6.7.9-3 Beta to support -channel sync for the -equalize option. Use this command:
  • convert zelda2.jpg -colorspace rgb -channel sync -equalize -colorspace sRGB zelda2_equal_sync.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [Resolved]possible but -equalize IM 6.7.9.1 Q16

Post by fmw42 »

magick wrote:Forgot to mention, we'll get a patch into ImageMagick 6.7.9-3 Beta to support -channel sync for the -equalize option. Use this command:
  • convert zelda2.jpg -colorspace rgb -channel sync -equalize -colorspace sRGB zelda2_equal_sync.jpg

OK. Thanks.

Will IM 7 make all the channel sync operators work the same. In most cases it is synced by default and one has to use -channel rgb to make them work on each channel separately. -equalize is just the opposite. That is OK for IM 6 as I don't want to upset the nominal way it works for others. But perhaps we should consider making them all work consistently in IM 7. Thoughts for consideration.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: [Resolved]possible but -equalize IM 6.7.9.1 Q16

Post by magick »

IMv7 is designed to address the deficiencies in IMv6, however, -channel sync is one aspect of IMv7 that has not been addressed properly yet. Primarily because its implementation is slightly different for each algorithm, there is no consistent method to support it. When you start testing IMv7, we will address -channel sync on a case-by-case algorithm basis.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [Resolved]possible but -equalize IM 6.7.9.1 Q16

Post by fmw42 »

magick wrote:IMv7 is designed to address the deficiencies in IMv6, however, -channel sync is one aspect of IMv7 that has not been addressed properly yet. Primarily because its implementation is slightly different for each algorithm, there is no consistent method to support it. When you start testing IMv7, we will address -channel sync on a case-by-case algorithm basis.

OK. Good idea.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [Resolved]possible but -equalize IM 6.7.9.1 Q16

Post by fmw42 »

magick wrote:Forgot to mention, we'll get a patch into ImageMagick 6.7.9-3 Beta to support -channel sync for the -equalize option. Use this command:
  • convert zelda2.jpg -colorspace rgb -channel sync -equalize -colorspace sRGB zelda2_equal_sync.jpg
IM 6.7.9.3 Q16 Mac OSX Snow Leopard

OK. It seems to work now.

This reproduces produces my redist uniform results for all the channels in sync.
convert zelda2.jpg -set colorspace RGB -equalize zelda2_eq_nl_sync.jpg

Without the -set channel RGB, it is much lighter -- just color management
convert zelda2.jpg -equalize zelda2_eq_nl_sync.jpg


This reproduces the old -equalize result:
convert zelda2.jpg -channel rgb -equalize zelda2_eq_rgb_new.jpg

Odd that adding -set colorspace RGB, does not have any affect (no different from the previous result)?
convert zelda2.jpg -set colorspace RGB -channel rgb -equalize zelda2_nl_eq_rgb_new.jpg
Post Reply