Gamma problem (?) with CIFilter output
Gamma problem (?) with CIFilter output
- Subject: Gamma problem (?) with CIFilter output
- From: Shamyl Zakariya <email@hidden>
- Date: Wed, 25 Feb 2009 11:47:45 -0500
Hi,
If this should be posted to another list let me know, but I didn't see
a Core Image list, so I figured Cocoa might be a good catch-all.
Anyway, I'm writing my first Core Image filter, a simple bump-map to
tangent-space-normalmap filter. I've done this in GLSL before, and
I've even done it in straight C. I figured it would make a good hello-
world for Core Image. The kernel just computes changes in luminance
along x & y and converts that to a "normal".
Here's an example source ( bumpmap ) image:
http://shamyl.zakariya.net/etc/Bump.png
And here's what my vanilla C implementation outputs:
http://shamyl.zakariya.net/etc/Bump_NM.png
And here's what my CI Filter outputs:
http://shamyl.zakariya.net/etc/Bump_Ugly.png
The good news is that I'm outputting what superficially appears to be
correct output. The colors are tinting in the right direction.
The bad news is that some sort of color-space conversion seems to be
happening -- I figure it's a gamma correction for my LCD. But I don't
want any correction: I want the output to be the numbers I compute.
To make certain I wasn't crazy, I did some simple tests, where I
output a solid color, and then used photoshop to sample screenshots
( crude, I know ).
- return vec4( 0,0,0,1 ) resulted in pure black: GOOD
- return vec4( 1,1,1,1 ) results in pure white: GOOD
- vec4( 1,0.5,0.5,1 ) gives me something like ( 1,0.66,0.66,1.0) ->
BAD!
Also, I googled, and found the following thread:
http://lists.apple.com/archives/quartz-dev/2008/Jan/threads.html#00061
It seems like the issue is one of color profiles, but what I don't
know is how to get CI to use a linear or generic profile.
Of course, I might also be barking up the wrong tree.
Thanks,
shamyl zakariya
- pillow-shaped and vaguely striated
to echo piratical treasure chests
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden