开发者

Why does UIImageView "darken"/saturate PNG images, and can I stop it?

开发者 https://www.devze.com 2022-12-25 01:45 出处:网络
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

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消