Page 1 of 1

Colorspace separate and combine - odd results

Posted: 2011-04-15T05:39:43-07:00
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.

Re: Colorspace separate and combine - odd results

Posted: 2011-04-15T10:10:38-07:00
by fmw42

Re: Colorspace separate and combine - odd results

Posted: 2011-04-16T02:36:22-07:00
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.

Re: Colorspace separate and combine - odd results

Posted: 2011-04-17T19:08:22-07:00
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.