[RESOLVED] possible bug -colorspace

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 -colorspace

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug -colorspace

Post 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
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -colorspace

Post by fmw42 »

OK. I fixed my typo and using -set colorspace sRGB after -colorspace does work. Thanks for the clarification.
Post Reply