Page 1 of 1

Colour space aware resize in 6.7.1

Posted: 2012-03-16T05:14:02-07:00
by Rahulp
I am attempting to setup a gamma aware resize script as per http://www.imagemagick.org/Usage/resize ... colorspace but the commandline

Code: Select all

convert earth_lights_4800.tif -colorspace sRGB -resize 500 -colorspace RGB  earth_lights_srgb.png
...is producing the same dull output as ...

Code: Select all

convert earth_lights_4800.tif -resize 500 earth_lights_direct.png
I am using ImageMagick 6.7.1-0 2011-11-23 Q16 on OS-X

Re: Colour space aware resize in 6.7.1

Posted: 2012-03-28T12:44:45-07:00
by Rahulp
No one has any insight r.e. what might be wrong?

Re: Colour space aware resize in 6.7.1

Posted: 2012-03-28T13:35:19-07:00
by fmw42
Search the archives. This has been discussed at length. See for example viewtopic.php?f=2&t=15955&p=71461&hilit ... ize#p71461

Also see http://www.imagemagick.org/Usage/resize ... colorspace

Re: Colour space aware resize in 6.7.1

Posted: 2012-03-28T23:50:28-07:00
by anthony
The last link above
http://www.imagemagick.org/Usage/resize ... colorspace
has already been updated with what has changed, BUT so far the main IM Web site is not yet showing that change.

Essentually as of IM v6.7.5-1
  • images by default have a colorspace setting of sRGB, instead of RGB
  • sRGB actually means sRGB colorspace! as such using -colorspace RGB converts it to linear-RGB
The basic result is that after this version you would use

Code: Select all

  convert earth_lights_4800.tif -colorspace RGB -resize 500 -colorspace sRGB  earth_lights_colorspace.png
Another way to determine if you IM is new enough if to do

Code: Select all

  identify -verbose rose: | grep Colorspace
if the result is
Colorspace: sRGB
then it has been updated

When saving either RGB or sRGB the image data will be saved as is. That is automatic colorspace conversion on write is turned off for either RGB and sRGB colorspaces. I am not however sure if the PNG image format marks the image as being linear or non-linear as few PNG program seem to take notice of it, unless a profile is also added.