sRGB colorspace and ProPhoto RGB ICC Profile - Which is it?

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
marcel24
Posts: 2
Joined: 2019-03-15T07:23:05-07:00
Authentication code: 1152

sRGB colorspace and ProPhoto RGB ICC Profile - Which is it?

Post by marcel24 »

Image

Example 11 and 12. How is it possible that the color space is sRGB and the profile is ProPhoto RGB?

Which one is actually used?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: sRGB colorspace and ProPhoto RGB ICC Profile - Which is it?

Post by snibgo »

The %[colorspace] format comes from image metadata that IM creates. This can take values such as sRGB, RGB, Lab, CMYK, HSL and so on. Logically, when there is a profile, this metadata should record that the channels are red/blue/green or whatever, but the actual colorspace (the primaries etc) are defined by the profile.

And that is really what %[colorspace]=sRGB when there is a profile really means.

Most operations in IM (blur, composite etc) are independent of the colorspace -- they are mathematical operations on pixel values, and IM doesn't need to know what colours are represented by those values.
snibgo's IM pages: im.snibgo.com
marcel24
Posts: 2
Joined: 2019-03-15T07:23:05-07:00
Authentication code: 1152

Re: sRGB colorspace and ProPhoto RGB ICC Profile - Which is it?

Post by marcel24 »

So your saying if there's a profile present the colorspace will be ignored?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: sRGB colorspace and ProPhoto RGB ICC Profile - Which is it?

Post by snibgo »

Ignored by what?

As I say, most IM operations ignore any profile, and don't care what the %[colorspace] is. A small number of operations will change the %[colorspace] to sRGB if it isn't already.

IM will copy a profile from input to output. So if you composite a ProPhoto image over an sRGB image, the result will have the profile from the first input, but the result will be wrong -- you should first convert (with "-profile) one image to the same colorspace as the other.
snibgo's IM pages: im.snibgo.com
Post Reply