mikhail_matrosov Posted August 28, 2012 Share Posted August 28, 2012 <p>I'm using <a href="http://www.argyllcms.com/">Argyll CMS</a> to calibrate my digital still camera. I want to create ICC profile which I can apply to JPEG images from my camera. I have a ColorChecker chart for this purpose, but I want to perform a test to check whether a created ICC profile is correct.<br /> I have a synthetic image of the <a href="http://www.babelcolor.com/download/ColorChecker_sRGB_from_Lab_D50.tif">ColorChecker</a>. All colors are exactly the same as specified in ColorChecker.cie file, after conversion from Lab to sRGB using Bradford adaptation from D50 to D65. I have this synthetic chart in ColorChart.tif. I run the following:<br><strong>scanin.exe -dioap ColorChecker.tif ColorChecker.cht ColorChecker.cie</strong><br>I see that all the patches are located properly on diag.tif. I then run:<br><strong>colprof.exe -v -y -qh -bn -ax -U 1.0952 ColorChecker </strong><br>It says that peak error is less than 0.01 deltaE. I apply the profile using <a href="http://www.littlecms.com/1/newutils.htm#tifficc">tifficc.exe</a> and the result file differs from the source no more than on 1-2 RGB points. That's good. But when I apply the same profile to the image with <a href="http://www.brucelindbloom.com/downloads/RGB16Million.tif.zip">all RGB colors</a>, I see significant difference, about 10-15 RGB points.<br>Why? What arguments should I use with colprof to obtain an identity profile? I don't want my profile to spoil a "perfect camera". How to achieve that? How can I use colprof.exe for real color management if it can't even handle simplest synthetic case?</p> Link to comment Share on other sites More sharing options...
joe_c5 Posted August 30, 2012 Share Posted August 30, 2012 <p>I can get what seem like acceptable results on the RGB16Million.tif image using:<br> colprof.exe -v -y -qh -bn -ag -u ColorChecker</p> <p>One difference is using -ag instead of -ax, to generate a gamma+matrix profile instead of an XYZ lookup table. The 24 patches of the colorchecker is just too few to even get accurate shapers let alone an entire lookup table. With more patches, particularly more dark patches, shaper+matrix might be a reasonable choice. I would not recommend trying to create a lookup table based profile with less than around 1000 patches, though the exact number will vary with the device and the choice of patch colors.</p> <p>The other difference is -u instead of -U 1.0952, to completely prevent scaling of the white point to the lightest patch of the colorchecker. With -U it was scaling the white point and then sort of scaling it back to not exactly the same place it started. With an actual photograph, you might need both -u so that it did not think the whitest patch was pure white and -U to correct the exposure.</p> <p>You may get better results color correcting a raw file in one step than correcting a jpeg which has already been color corrected once. If you use an actual colorchecker target, I get quite good results using X-Rite's Colorchecker Passport software with Lightroom, though I don't like Lightroom 4. Colorchecker Passport uses Adobe's DNG profiles instead of ICC profiles.</p> <p>Finally, keep in mind that with pretty much any camera on the market, either consumer or professional, even after color correction some colors will still tend to be wrong. When colors are particularly important, for example product photography, the colors often need to be corrected by hand.</p> Link to comment Share on other sites More sharing options...
mikhail_matrosov Posted August 31, 2012 Author Share Posted August 31, 2012 <blockquote> <p>I would not recommend trying to create a lookup table based profile with less than around 1000 patches, though the exact number will vary with the device and the choice of patch colors.</p> </blockquote> <p>1000?! What are the color charts with that huge number of patches?..</p> <blockquote> <p>With an actual photograph, you might need both -u so that it did not think the whitest patch was pure white and -U to correct the exposure.</p> </blockquote> <p>I've tried -u key, but noticed no difference between profiles generated with -u and without -u in -ax mode. As I understood, -u key has no impact in non-cLUT modes, like -aG, doesn't it?</p> <blockquote> <p>You may get better results color correcting a raw file in one step than correcting a jpeg which has already been color corrected once.</p> </blockquote> <p>I understand, this is indeed a better option. But I need to integrate a color correction in my custom application and I don't know of a way to apply DNG profiles (in .dcp-files) to RAW files programmatically. That's why I'm dealing with ICC profiles.</p> Link to comment Share on other sites More sharing options...
joe_c5 Posted August 31, 2012 Share Posted August 31, 2012 <blockquote> <p>1000?! What are the color charts with that huge number of patches?..</p> </blockquote> <p>I don't know of any targets intended for cameras with more than around 100, so I guess that mostly rules out lookup table based profiles. For printers, for example, targets can be as many patches as one has time to measure. For a regular Colorchecker, I recommend -ag or maybe even -aG.</p> <blockquote> <p>As I understood, -u key has no impact in non-cLUT modes, like -aG, doesn't it?</p> </blockquote> <p>The -u switch seemed to make a difference in -ag when I tried it. I no longer saw the extra step "Fixup matrix for white point" in the verbose output.</p> <blockquote> <p>But I need to integrate a color correction in my custom application and I don't know of a way to apply DNG profiles (in .dcp-files) to RAW files programmatically. That's why I'm dealing with ICC profiles.</p> </blockquote> <p>Starting with RAW files is the important part, whether the profile is DNG or ICC shouldn't really matter. Starting with jpeg would still work, but would have a lot more nonlinearity to deal with; with jpeg I would recommend using enough patches that -as worked well.<br> </p> Link to comment Share on other sites More sharing options...
mikhail_matrosov Posted August 31, 2012 Author Share Posted August 31, 2012 <blockquote> <p>The -u switch seemed to make a difference in -ag when I tried it. I no longer saw the extra step "Fixup matrix for white point" in the verbose output.</p> </blockquote> <p>You are right. But it seems like -u is ignoring -U - I have the same results for -u enabled with and without -U. And both are darker than original image.</p> <blockquote> <p>Starting with RAW files is the important part, whether the profile is DNG or ICC shouldn't really matter.</p> </blockquote> <p>What do you mean? How can I create ICC profile given a DNG profile? The only option I found was <a href="http://dcp2icc.sourceforge.net/">dcp2icc</a> utility, but its results were unpleasant.</p> Link to comment Share on other sites More sharing options...
digitaldog Posted August 31, 2012 Share Posted August 31, 2012 <blockquote> <p>I want to create ICC profile which I can apply to JPEG images from my camera.</p> </blockquote> <p> <br> Why? The camera encodes the data with either sRGB or Adobe RGB (1998) after it processes the raw data based on the assumption of that color space, renders and encodes the data. You don't need a profile. </p> Author “Color Management for Photographers" & "Photoshop CC Color Management" (pluralsight.com) Link to comment Share on other sites More sharing options...
joe_c5 Posted August 31, 2012 Share Posted August 31, 2012 <blockquote> <p>You are right. But it seems like -u is ignoring -U - I have the same results for -u enabled with and without -U. And both are darker than original image.</p> </blockquote> <p>Ok, it looks like I misinterpreted the effect of -u; it seems to be the same as -U 1. With either setting I got only very slightly darker for either Colorchecker.tif or RGB16Million.tif. If you consider that too dark, then the problem seems to be the difference between the sRGB tone curve and the 2.16 gamma that colprof is picking as the best fit.</p> <blockquote> <p>What do you mean? How can I create ICC profile given a DNG profile? The only option I found was <a href="http://dcp2icc.sourceforge.net/" rel="nofollow" target="_blank">dcp2icc</a> utility, but its results were unpleasant.</p> </blockquote> <p>I mean that the results of using an ICC profile should be fine. I had only used DNG profiles as an example of using any kind of profile directly on a RAW format image.</p> <p>I tried converting everything to AdobeRGB to avoid issues with the sRGB tone curve, and now the resulting profile seems to be extremely close to the identity profile you were looking for, within around 1 sRGB point for ColorChecker.tif. Using Imagemagick's convert:<br /> convert -profile "sRGB Color Space Profile.icm" -profile AdobeRGB1998.icc ColorChecker.tif colorchecker2.2.tif<br /> scanin.exe -dioap ColorChecker2.2.tif ColorChecker.cht ColorChecker.cie<br /> colprof.exe -v -y -qh -bn -ag -U 1 ColorChecker2.2<br /> tifficc -v -i ColorChecker2.2.icm ColorChecker2.2.tif colorchecker2.2corrected.tif</p> <p>So it seems to be incredibly important when creating ICC profiles to avoid nonlinearity unless you have enough patches to correct for it. Since sRGB has a nonlinear tone curve (different from gamma 2.2), I recommend that you avoid it until after the color correction is complete. While a gamma curve is also nonlinear, Argyllcms's colprof seems to be designed to deal well with gamma curves.</p> <p>If you use jpegs from the camera instead of raw files, you are likely to run into the same issue with the camera's nonlinear tone curve, even if you have a jpeg in AdobeRGB. Jpegs could still be at least reasonably color corrected, but it is likely to take a lot more than 24 patches.</p> Link to comment Share on other sites More sharing options...
mikhail_matrosov Posted September 3, 2012 Author Share Posted September 3, 2012 <blockquote> <p>I tried converting everything to AdobeRGB to avoid issues with the sRGB tone curve, and now the resulting profile seems to be extremely close to the identity profile</p> </blockquote> <p>I think you can achieve almost the same with the sRGB color space. The sRGB non-linear correction curve is very closely approximated with 2.2 gamma.</p> Link to comment Share on other sites More sharing options...
joe_c5 Posted September 3, 2012 Share Posted September 3, 2012 <blockquote> <p>I think you can achieve almost the same with the sRGB color space. The sRGB non-linear correction curve is very closely approximated with 2.2 gamma.</p> </blockquote> <p>It is close to 2.2 gamma, but as you pointed out, an input profile created from the sRGB ColorChecker made images slightly darker.<br> <br> If Argyllcms colprof could be forced to assume a shaper with an sRGB tone curve, then one could get more or less an identity profile while still using sRGB. Argyllcms is open source, so it shouldn't be hard to do if it were important. That wouldn't help with the camera's nonlinear tone curve, though, so there would still be other weird effects using a camera jpeg.</p> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now