Import colors, wrong?

So I’m importing a PNG with solid 127,127,127 RGB color into iPhone unity.

iPhone Unity thinks its 108,108,108. (based on the eyedropper, and a shader which should treat neutral grey as transparent, but is in fact darkening the screen).

All compression is off, mips are off. I’m totally stumped.

There are no funny color profiles, and Unity 2.5 correctly identifies the texture as 127,127,127.

Is this a bug, or a feature? And is there a workaround short of brightening my texture.

I’m a little disturbed to find this is across the board, all the textures are about 20 RGB units darker on import to iPhone unity

this is a problem with your image not Unity. PNG as PSD hold color profile information and I would bet you stored it with a color profile thats different than the “nothing” profile so the texture, after loaded in unity, will differ due to it

Photoshop usually gives you no options to store or not store a gamma curve / colour profile in a PNG.

Anyway, Apple + Colour = Gamma NIGHTMARES.

That’s a general rule of thumb.

Photoshop has about 0.0% understanding of correct PNG export anyway.

Either you use PSD or you install SuperPNG to get real png exports. SuperPNG allows you to define the compression as well as dropping the meta data

I agree, except I don’t think png’s even have a slot for color profile.

Besides, I’m using SRGB, and I’ve tried importing a variety of different formats, including PSD, all to the same effect.

Besides that, it imports properly into Unity 2.5.

All of these taken together point toward an issue in Unity iPhone, or at least a difference in behavior.

Turning off color management entirely in Photoshop seemed to solve it for the iPhone. Thanks for the tip on the profiles.

I’ll have to investigate further to understand exactly what photoshop is doing to the pngs on export.

Also, it’s troublesome that the PSDs experienced the same issue.

I’m calling this a bug, and reported.

It works in Unity 2.5, displays properly in firefox, safari, preview, etc.

Yet both PSDs and PNGs are too dark in the iPhone IDE.

The only workaround I’ve found is either saving images out as BMPs (or something with profiles stripped, or turning color management completely off, and removing it from existing files. (Using Edit > Assign Profile > Don’t color manage)

For those interested, I’ve attached a test image, as well as the Edit > Color Settings window in CS4 where you can turn off color management.

192573--6828--$screen_shot_2009_08_31_at_103342_pm_819.png
192573--6829--$test_217.png

Well, straight away, Firefox, IE and Chrome are not color-space aware browsers. Safari is the only commonly used browser that is interested in color profiles.

I would also suspect that Apple have the same sort of annoying crap on the device as well :slight_smile:

I know this is a necro, but it appears as one of the top answers on Google so I thought I would just state in full what I did to get things working.

In Photoshop

Edit > Color Settings > Settings > Select: Monitor Color (This will ensure there’s nothing being done with the colors on your screen)
Edit > Color Settings > Color Management Policies > Set all to Off

This should make things marry up correctly for new files.

For any old files make sure you do the following:

Edit > Assign Profile > Don’t Color Manage This Document (Alternatively you can discard the profile when the file is reloaded into Photoshop, provided you have that configuration selected in Edit > Color Settings)

You’ll then notice that the file in Photoshop now looks like it does when you’ve been importing it into Unity. You’ll have to amend it to the desired colors.

Lastly when saving… Export as > png (ctrl + shift + alt + W)…

Color Space > Convert to sRGB > Selected
Color Space > Embed Color Profile > Unselected