colorspace (s)RGB and chromaticity primaries

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
miha
Posts: 6
Joined: 2016-10-22T03:56:05-07:00
Authentication code: 1151

colorspace (s)RGB and chromaticity primaries

Post by miha »

I'm creating a png from raw RGB bytes that should be interpreted with Adobe RGB primaries (not sRGB) with something like

convert -size 2048x1536 -depth 8 rgb:inputfile -depth 10 outputfile.png

identify -verbose then says

Colorspace: sRGB
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)

So I add the Adobe RGB profile

convert -size 2048x1536 -depth 8 rgb:inputfile -depth 10 -set profile "/usr/share/color/icc/Adobe ICC Profiles/RGB Profiles/AdobeRGB1998.icc" outputfile.png

identify -verbose then still reports Colorspace: sRGB
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
and Profiles:
Profile-icc: 560 bytes

No matter what I do (-colorspace RGB -set colorspace RGB for input and/or output) the output file always has colorspace sRGB and no Adobe RGB green primary according to identify. Apparently -set colorspace only triggers changes from linear to gamma corrected data and back. The profile alone will make sure the printer driver knows the data is relative to Adobe RGB primaries and not sRGB primaries? When ever will colorspace say RGB and a green Adobe RGB primary is listed by identify?
miket
Posts: 60
Joined: 2016-08-12T13:19:13-07:00
Authentication code: 1151

Re: colorspace (s)RGB and chromaticity primaries

Post by miket »

I have a very similar question to the above.

My understanding is that the RGB/sRGB colorspace tag is simply an indicator of linear gamma=1 data or non-linear gamma!=1 data and therefore does not provide any more information about the specific color profile used.

However, like the previous post, I notice that when applying a profile (as in the previous example) that the white point and RGB chromaticity values given by identify remain as the standard sRGB color profile rather than the applied icc profile.

The question is, is this simply an inconvenience (in that identify does not indicate the "correct" white point and chromaticties that are actually used in forward processing) or, is it necessary to take care in any forward processing (if any of the forward processing commands utilize the WP or chromaticties as indicated by identify, rather than those in the embedded icc profile)?

Mike
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: colorspace (s)RGB and chromaticity primaries

Post by snibgo »

As far as I can see, IM iteself doesn't use the values of chromaticty.white_point etc. It sets these values, but never uses them.

The values may be written to TIFF and PNG files etc, so other software may use the values. I would expect that, where a profile is embedded, the values would be taken from the profile.

(To me, it would makes sense that, if IM embeds a profile, it sets the values of chromaticty.white_point etc. But then it should also "unset" the values on "-strip".)
snibgo's IM pages: im.snibgo.com
miket
Posts: 60
Joined: 2016-08-12T13:19:13-07:00
Authentication code: 1151

Re: colorspace (s)RGB and chromaticity primaries

Post by miket »

Thanks snibgo,

That confirms my hunch. Always good to have that from somebody with more IM hours under their belt :)

I'd also agree that it would be useful if IM could alter the appropriate tags after icc profiling an image as you suggested.

Mike
Post Reply