views:

209

answers:

1

I have a PNG file in a UIImageView, and next to that I have an EAGLView which displays the continuation of that same image (long story) as a texture, carved from the same original PNG. The point is, that these images, which should match up flawlessly, actually have somewhat differing color saturation.

Normally I'd blame my handling of the PNG texture load in GL, but when I hold Preview (with the PNG) up to the iPhone simulator, it's GL that's spot on, and the UIImageView that's wrong! It's taken the image and made it ever-so-slightly more saturated. The image view is opaque with 100% alpha.

I verified this on a clean UIImageView with another PNG file when put next to Preview.

Anyone know what's up?

+1  A: 

If you are using Photoshop to save the png using the "Save for Web & Devices" tool, ensure the "Convert to sRGB" option is off and "Embed Color Profile" is also off. If you are using another editor, look for similar settings.

Read this, it will help explain better than I can.

coneybeare
Thanks for the reply. I didn't generate this PNG, but I will ask the person who did. FWIW, what's that mean? sRGB vs ...? And what effect would this have on UIImage vs OGL/CG texture creation? (I'm using the whatever the image's native color space is to create the texture)
quixoto
UIImage would probably adjust for a color space in a way using the raw RGB values in a texture would not. If you leave the image un-tagged then UIImage will not know the color space it is in and not adjust it. You could just load the image into Photoshop and save it out without a color profile yourself to test.
Kendall Helmstetter Gelner