Page 1 of 1

[RESOLVED] possible bug -colorspace

Posted: 2014-03-12T15:28:22-07:00
by fmw42
Tested with IM 6855 to 6888 Mac OSX.

I may be misunderstanding about how -colorspace works. But this is not what I would expect. Please clarify if I misunderstand or if there is a bug.

When I do

Code: Select all

convert rose: -colorspace HSL rose_hsl.png

compare -metric rmse rose: rose_hsl.png null
0 (0)
there is no change of the image pixel data. Although PNG or any other format does not know about the HSL colorspace, it seems to me that it should have changed the pixel data and just labeled it sRGB.

But if I do

Code: Select all

convert rose: -colorspace HSL -separate -combine rose_hsl2.png
then the pixel data is properly changed.

What am I misunderstanding?

Re: possible bug -colorspace

Posted: 2014-03-12T15:57:11-07:00
by snibgo
You have a typo ":" for "_", but it makes no difference to your point.

My understanding is that as part of the saving process to PNG (or TIFF etc), IM will convert the image to sRGB unless it is already sRGB or RGB. If saving to txt: or MIFF, it leaves the pixels as HSL.

So in your case, pixels are converted to HSL (because you asked for it), then converted back to sRGB.

If you want to save HSL data to png, persuade IM that it is already sRGB:

Code: Select all

convert rose: -colorspace HSL -set colorspace sRGB h.png

Re: possible bug -colorspace

Posted: 2014-03-12T16:01:08-07:00
by fmw42
OK. I fixed my typo and using -set colorspace sRGB after -colorspace does work. Thanks for the clarification.