ImageMagick Color Management

Announcements pertaining to ImageMagick, or ImageMagick related software. This list is moderated. No discussions here, instead post to the users group instead.

ImageMagick Color Management

Postby magick » 2012-06-23T05:35:51+00:00

ImageMagick always supported color profiles, however, for images without a profile or a declaration of colorspace, ImageMagick assumed linear RGB. With support of the sRGB colorspace in practically every camera made now-a-days, ImageMagick was modified as of version 6.7.7-8 to assume sRGB unless otherwise specified by a color profile or colorspace (e.g. CMYK). In addition, for many of the image formats we assume grayscale is linear. Most image processing algorithms assume a linear colorspace, therefore we recommend you remove the gamma function before certain image processing algorithms are applied. For example,

    convert myimage.jpg -colorspace rgb -resize 200% -colorspace sRGB mybigimage.jpg
To declare an image is linear RGB rather than sRGB, you can use the set option:

    convert myimage.jpg -set colorspace RGB myRGBimage.jpg
Post any questions or concerns about these changes to the user or developers forum.

Thanks to Anthony and Fred for their invaluable help in ensuring sRGB support within ImageMagick worked properly. And thanks to http://www.brucelindbloom.com/ for the correct formulations for converting linear RGB to sRGB and back.
User avatar
magick
Site Admin
 
Posts: 9696
Joined: 2003-05-31T11:32:55+00:00

Re: ImageMagick Color Management

Postby anthony » 2012-09-20T17:43:07+00:00

For examples of doing resizes using linear-RGB colorspace see
IM Examples, Resizing with Colorspace Correction
http://www.imagemagick.org/Usage/resize ... colorspace

The page also goes on to the many filters, options and techniques you can use to improve resizing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
http://www.imagemagick.org/Usage/
User avatar
anthony
 
Posts: 8732
Joined: 2004-05-31T19:27:03+00:00
Location: Brisbane, Australia

Re: ImageMagick Color Management

Postby fmw42 » 2013-08-20T15:15:36+00:00

After IM 6.8.5.4, the -set colorspace RGB, is no longer needed when converting to other colorspaces channels (nor for -colorspace gray).

-colorspace gray is also now equivalent to rec709luma rather than rec601luma to be more consistent with sRGB standards
User avatar
fmw42
 
Posts: 15005
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: ImageMagick Color Management

Postby fmw42 » 2013-10-25T18:26:01+00:00

Starting with IM 6.8.6.0 all grayscale colors and grayscale gradients are now non-linear (by default) with gamma=0.4545 rather than the ones with gray(...) being linear with gamma=1 (which was the case from about IM 6.7.8.3).

So the following formats that used to be linear (gamma=1) are now non-linear (gamma=0.4545)

gray(xx)
gray(xx%)
gradient:"gray(xx)-gray(yy)"
gradient:"gray(xx%)-gray(yy%)"

Named grayscale or gradient with named grayscale colors are still non-linear with gamma=0.4545

The only exceptions seems to be in IM 6.8.7.1 where gamma=1 (linear) for both gray(...) and gray(...) gradients
and in IM 6.8.7.2 where only the gray(...) gradients still show gamma=1 (linear), but simple gray(...) colors have gamma=0.4545 (non-linear)

To create linear gray scale colors one can do either:

1) use icc-color(rgb,xx,xx,xx) to get a linear gray

NOTE: that is different from icc-color(srgb,xx,xx,xx) with produces a non-linear gray

see http://www.imagemagick.org/script/color.php

e.g.

convert -size 100x100 xc:"icc-color(rgb,128,128,128)" -format "%[gamma]\n" info:
1



2) use xc:gray -intensity rec709luminance -colorspace gray

e.g.

convert -size 100x100 xc:gray -intensity rec709luminance -colorspace gray -format "%[gamma]\n" info:
1
User avatar
fmw42
 
Posts: 15005
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA


Return to Announce

Who is online

Users browsing this forum: No registered users and 1 guest