A PNG appears differently from its PSD

Before you ask, I don’t think this is the alpha edge problem as it is not occuring on just the edge pixels.

3458-buttonpngandpsd.png

This is an image of two versions of the same file. The left is from the PNG exported by Photoshop and the right is from the actual PSD imported to unity.
The design is supposed to be a small black dropshadow and is looking correct on the left PNG version. It is imported as an uncompressed, true colour, bilinear GUI image and applied to a plane on an orthographic camera.

So why is there a difference between these? It isn’t the colour of the dropshadow pixels as this must be set to black in Photoshop to define it as a black dropshadow. My only conclusion is that the PSD import in Unity has a bug. If it happened over one pixel I would suspect it as the alpha bleeding problem but its too wide to be that.

Unity is all about easy of use. The ability to drop in a texture or other asset is a key feature and I’m a little surprised that it falls down so easily.

"Save your multi-layer Photoshop files normally and let Unity automatically compress your images with high quality compression. It’s all automatic without a single required click. " - Unity promotional material :slight_smile:

Do you have a white background when you turn off the alpha channel in photoshop?

PNG makes pixel bleeding automatically so that’s why it looks ok when PNG.

I mean, if you want to have a feathered green circle in unity, and if you want to use PSD, the best way would be to have your whole image painted green and only alpha channel to be a feathered circle.

I’ve made a couple of printscreens in order to explain what’s happening:

first, see this image of a red circle just drawn in photoshop
It doesn’t add any alpha channel in photoshop and when read in unity you get an automatic alpha but the white background is added (I think it’s in PSD not in unity) so the red colour fades to white and you get the red-to-white antialias:

But if you save the same file in PNG, the png automatically makes colour bleeding where antialias from red to transparent is present as seen here:

3487-unity_png.jpg

[I will continue my previous answer here since this system doesn’t allow more than two images attached, so read my previous answer first]

What you need to do is make color bleeding yourself and add an alpha channel like this:

[3488-psd+with+alpha.jpg|3488]

Then you can save it as psd, tga or tiff.

I don’t know why is this happening but I think that “adding white background automatically” thing is related to photoshop, not Unity. Just as “adding bleeding” is the thing related to PNG.

I remember that I’ve encountered similar problems when importing transparent images from max to photoshop. It just started happening since one particular version of photoshop (I think it was year 2003). Since then, I’m using pngs.

Maybe there’s an easier method but this is the only one I know of.

Hope I helped, I agree its frustrating but so are many other things :slight_smile: