Page 1 of 1

Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-07T11:53:09-07:00
by fmw42
Hello,

When I do the following on an RGB image:

convert image.png -colorspace HSL image_hsl.png (or with suffix .jpg, etc)

and then do

convert image_hsl.png -verbose info:

The colorspace is reported as RGB and not HSL.

I was wondering if it would be feasible to have IM store the correct colorspace in the image metadata that you use for IM generated images so that one could get access to the correct colorspace for the image. This would be very useful at least for me when doing some of my IM scripting.

Thanks for your condideration

Fred Weinhaus
fmw@alink.net

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-07T14:29:26-07:00
by magick
The PNG standard does not permit colorspaces other than RGB/sRGB. If you can prove otherwise let us know.

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-07T15:32:17-07:00
by fmw42
The issue is not whether png or jpg or any other format can support other colorspaces. The issue is that IM can or should be able to record this information internally when it creates an image in some other colorspace and that information should be available for other IM processes to access. Whether or not it can be stored for export to other systems is a totally other matter.

Thanks.

Fred Weinhaus

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-08T14:23:32-07:00
by magick
The PNG folks (Glenn) has responded that they can arrange for a new chunk to specify a colorspace. Once the format of the chunk is defined and it is part of the libPNG distribution we will enhance the ImageMagick PNG coder to save/fetch the colorspace chunk.

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-09T18:24:32-07:00
by fmw42
What about JPEG as well?

And is it a requirement that this be image format dependent and not just an internal IM notation in its meta data?

Thanks in any case no matter what you decide.

Fred Weinhaus

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-09T18:42:36-07:00
by magick
JPEG supports RGB, Grayscale, and CMYK. If we store the colorspace metadata, where would we store it? Would any other software recognize the colorspace attribute or just ImageMagick?

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-13T17:53:49-07:00
by fmw42
My point is that IM should be able to handle it internally for its own scripting and proper reporting of the colorspace in -verbose info: If any other external image formats can support it, that is even better (a plus), but not a requirement.

Re: Possible enhancement to how colorspace is handled within IM

Posted: 2007-09-13T19:10:14-07:00
by magick
We recommend you use MIFF as an intermediate format. It supports *all* ImageMagick colorspaces, profiles and properties.