[SOLVED] Does IM use sRGB.icc when converting colorspace?
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
[SOLVED] Does IM use sRGB.icc when converting colorspace?
When converting with -colorspace between linear RGB and sRGB, does IM use the profile sRGB.icc, or internal formulas, or a combination of both?
P.S. The following questions reveal that I am slightly paranoid. I suspect that sRGB is "safe". http://download.microsoft.com/download/ ... eStudy.doc
The sRGB.icc included with IM is really a really big file compared, for example, to those found in the system-wide profile dir, or with photivo. Is it because it's a "full" version?
Does anybody know if there is a significant difference between the various sRGB.icm and sRGB.icc floating around? http://www.color.org/srgbprofiles.xalter suggests that there may be a small collection of them, with slightly different behaviors. Anybody knows if some systems sneakily substitute a v4 and call it sRGB.icm/icc? Also see: http://photography-on-the.net/forum/sho ... p?t=978120 and http://www.color.org/faqs.xalter#p9.
P.S. The following questions reveal that I am slightly paranoid. I suspect that sRGB is "safe". http://download.microsoft.com/download/ ... eStudy.doc
The sRGB.icc included with IM is really a really big file compared, for example, to those found in the system-wide profile dir, or with photivo. Is it because it's a "full" version?
Does anybody know if there is a significant difference between the various sRGB.icm and sRGB.icc floating around? http://www.color.org/srgbprofiles.xalter suggests that there may be a small collection of them, with slightly different behaviors. Anybody knows if some systems sneakily substitute a v4 and call it sRGB.icm/icc? Also see: http://photography-on-the.net/forum/sho ... p?t=978120 and http://www.color.org/faqs.xalter#p9.
Last edited by NicolasRobidoux on 2012-04-21T18:43:05-07:00, edited 1 time in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Does IM use the sRGB.icc profile when converting colorsp
Got a hint here: http://www.multipole.org/discourse-serv ... 955#p71451, which led me to http://trac.imagemagick.org/browser/Ima ... lorspace.c.
So, the answer is: IM converts between RGB and sRGB internally when -profile is not used.
So, the answer is: IM converts between RGB and sRGB internally when -profile is not used.
Last edited by NicolasRobidoux on 2012-04-21T18:49:18-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Does IM use the sRGB.icc profile when converting colorsp
I believe that is why IM recommends the use of profiles, where available, for better accuracy (color conversion) rather than just using -colorspace.NicolasRobidoux wrote: So, the answer is: IM converts between RGB and sRGB internally.
Fred
P.S. I got a laugh out of the signature at the bottom of one of the files you referenced above.
"In theory, there is no difference between theory and practice. But in practice, there is." Yogi Berra
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
It would appear to me that sRGB_IEC61966-2-1_black_scaled.icc from http://www.color.org/srgbprofiles.xalter would be a good profile to distribute with IM, replacing the current sRGB.icc (unless the currently included sRGB.icc was chosen for specific reasons).
Perceptual is clearly the most common default rendering intent. Even though John Cupitt argues that Relative is much better to use in color managed toolchains, it is my opinion that indeed Perceptual is better if you don't convert between other colorspaces than linear RGB and sRGB, with the linear RGB "gamut" roughly matching the sRGB one; it you use other colourspaces and care about careful color management, stick to Relative. Interestingly, for a lot of profiles, Perceptual and Relative are apparently one and the same!The 'black scaled' profile has the preferred rendering intent in the header set to 'perceptual'. and the 'no black scaling' profile has the preferred rendering intent in the header set to 'relative colorimetric'.
Last edited by NicolasRobidoux on 2012-04-22T07:18:18-07:00, edited 4 times in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
If one reads the last section of http://www.color.org/srgbprofiles.xalter, one sees that my paranoia is not totally unfounded: There really are substantially different (v2) sRGB ICCs and ICMs out there.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
When exporting into 8-bit or 16-bit (with nip2) from XYZ, the above icc, straight from the ICC, gives different results from the sRGB.icc that's in ImageMagick/config/ for every single rendering intent. With the image I tested with, the max difference is as much as 15%, both in 8 and 16-bit. (Note that the conversion is done from float XYZ, I'm not talking about the bit depth BEFORE exporting. I'm talking about the export bit depth itself.)
Conclusion: “Just because you're paranoid doesn't mean they aren't after you” (John Heller)
Conclusion: “Just because you're paranoid doesn't mean they aren't after you” (John Heller)
Last edited by NicolasRobidoux on 2012-04-22T11:09:23-07:00, edited 1 time in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
For kicks, I also compared the IM sRGB.icc to the sRGB.icm that comes with nip2. Same thing: With every bit depth and rendering intent, there are differences, up to 10-15% (in max norm).
However, if I compare the nip2 sRGB to the one straight from the ICC, for all rendering intents except Absolute (which was the most broken in earlier icc and icms according to the ICC web site), there is no difference.
Again: the one from the ICC that I used in the comparison is sRGB_IEC61966-2-1_black_scaled.icc which can be downloaded from the bottom of http://www.color.org/srgbprofiles.xalter.
However, if I compare the nip2 sRGB to the one straight from the ICC, for all rendering intents except Absolute (which was the most broken in earlier icc and icms according to the ICC web site), there is no difference.
Again: the one from the ICC that I used in the comparison is sRGB_IEC61966-2-1_black_scaled.icc which can be downloaded from the bottom of http://www.color.org/srgbprofiles.xalter.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
out of curiosity where did nip2 get its sRGB.icm?
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
I don't know. John Cupitt "just picked a free one that seemed OK to make sure vips had a fallback". No matter the source, the nip2 sRGB fallback is closer in output to the one currently recommended for Perceptual by the ICC site, compared to the one that comes with ImageMagick. (At least when I use the profiles through nip2. I have not checked through IM.)fmw42 wrote:out of curiosity where did nip2 get its sRGB.icm?
Last edited by NicolasRobidoux on 2012-04-22T11:42:39-07:00, edited 3 times in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: [SOLVED] Does IM use sRGB.icc when converting colorspace
Maybe I should compare the IM one to the one with default Relative rendering intent. (Later.)