1. So, I've been starting to build a simple soft-proofing application for Mac OS X. the concept being something simple that could take a TIFF or JPEG as input, then show what the rendering would be, and where any out-of-gamut colors were for any given output profile. E.g., a printer or whatever. 

    I decided to this via Core Image, for reasons of performance. Core image allows you to write CIFilter's that run on the graphics hardware of your PC, and so can be very, very quick. And, after about a week of frustration, I nearly had a CG processing pipeline up and working to my satisfaction.

    There's just one thing that I absolutely couldn't work out, which is CGContextDrawImage's handing of out-of-gamut colors. Here's what the basic processing pipeline is:
    1. I'm creating a CGImage in a wide gamut space, in floating point format.
    2. I then create a floating point bitmap CGContext, and in turn create a CIContext from that.
    3. I then render a new CGImage, using CGContext DrawImage and then CGBitmapContextCreateImage.
    So, all very simple. Not.

    What I found was the following:
    • If the CGContext that I rendered the new image to was in floating point format, colors were correctly converted to e.g, the sRGB space, but components are left out of gamut - e.g., <0.913567>. "Correctly" here meaning that the values are exactly the same as what you would get using the ColorSync Utility's calculator.
    • If the CGContext that I rendered the new image to is in int format, the components are clipped (obviously), but otherwise the values are identical to the floating point case. This occurred regardless of what the rendering intent was set to - there is not even one decimal points change in the values with rendering intent changes.
    What I expected was that for both the floating point and int formats, the rendering process would use the rendering intent to adjust colors into gamut, and these adjustments would vary with intent, but as far as I could see, the rendering intent is just ignored, and the only gamut adjustment that occurs is hard clipping.

    So, the first thing that I did was to post a query on the Apple development lists. And got only one response, which was unfortunately useless, as the individual in question hadn't actually read my post.

    So I ended up spending the next week testing an enormous number of different options of how CIFilters and rendering actually works inside of a CIImage context. The results are surprising. At least they were to me. 

    More later......

    0

    Add a comment

Popular Posts
Blog Archive
About Me
About Me
My Photo
Author of AccuRaw, PhotoRaw, CornerFix, pcdMagic, pcdtojpeg, dcpTool, WinDat Opener and occasional photographer....
Loading