Colour space aware resize in 6.7.1

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
Rahulp
Posts: 2
Joined: 2012-03-16T03:13:39-07:00
Authentication code: 8675308

Colour space aware resize in 6.7.1

Post 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
Rahulp
Posts: 2
Joined: 2012-03-16T03:13:39-07:00
Authentication code: 8675308

Re: Colour space aware resize in 6.7.1

Post by Rahulp »

No one has any insight r.e. what might be wrong?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colour space aware resize in 6.7.1

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Colour space aware resize in 6.7.1

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply