Colorspace separate and combine - odd results

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
KonfuseKitty
Posts: 18
Joined: 2010-07-16T15:54:28-07:00
Authentication code: 8675308

Colorspace separate and combine - odd results

Post by KonfuseKitty »

When I run this simple command to test that a "no-operation" channel separation and re-combination works as expected:

convert logo: -colorspace rgb -separate -colorspace rgb -combine -colorspace rgb miff:- | display miff:-

- all is well, the output looks the same as the input. But if I change the colorspace to any other color type:

convert logo: -colorspace hsb -separate -colorspace hsb -combine -colorspace rgb miff:- | display miff:-

-the output is not the same as input. Most disappointing are HSB and HSL that return a very dark image. I was hoping to use them to work on the saturation channel, but it's impossible to work with.

I'm still using 6.6.3 and haven't seen anything in the changelog to suggest newer versions behave any different.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colorspace separate and combine - odd results

Post by fmw42 »

KonfuseKitty
Posts: 18
Joined: 2010-07-16T15:54:28-07:00
Authentication code: 8675308

Re: Colorspace separate and combine - odd results

Post by KonfuseKitty »

Ouch! Thanks, Fred. I've been caught out by this before...

A note to the developers: please make "-separate" and "-combine" consistent in how their colorspaces are set.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Colorspace separate and combine - odd results

Post by anthony »

Not posible - YET

-colorspace is a operation NOT a setting! Using it against a Greyscale image makes the image not a expected RGB greyscale image.

-set colorspace is a setting, that changes the colorspace of any without changing its values from what -combine is expecting. It is a temporary stop gap measure.

NOTE for three channels you can use -set colorspace afterward. It is only needed first if four channel CMYK images are involved.

In your own example. NONE of the -colorspace operations are need as the images are all in that colorspace.

As part of ongoing discussions, -combine may need some changes for IM v7 (just about to fork for alpha development), as it will need to be able to handle more just just normal image channels.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply