Those pesky white lines outside of PNG textures...

You probably know the ones I’m talking about. These small little white-ish lines randomly showing up on my photoshop-made PNG files.

I’ve tried 2 methods both listed on this website to get rid of them, both methods seem to basically make your image opaque while at the same time creating an alpha channel;

However, once I bring those PNG’s into Unity, my alpha channel is ignored and I’m left with an Opaque texture.

I’m working with the free copy of Unity, does it not support alpha channels? Any tips or help you can send my way would be much appreciated!

Thanks!

PNGs always were troublesome for me as they don’t seem to contain a proper alpha channel, instead they store transparency. At least that’s how Photoshop opens them.

I’ve had much better luck bringing PSDs into Unity.

Can you show a screenie of what you’re getting?

I know of two different types of artefact which could match your description, and the above solutions aren’t referring the the one I suspect you’re having.

If you’re getting lines near the edge of the image, it’s most likely that you’re actually picking up some pixel data from the opposite side of the image due to wrapped downsampling. Make sure that there’s either a transparent border larger than a pixel at your lowest desired mipmap level, or that your texture is set to clamp rather than wrap, or both.

Can try this.
PNG to TGA: remove artifacts from the transparent textures.

Thanks for the responses guys!

I found that the technique I listed works perfectly for PSD files, however I thought I read somewhere that iOS games only like PNG format. Which is why I’m pushing to get these in the engine as .png’s? If that’s not the case, then I’ll just move forward with PSD extensions.

They’re fixing this in 4.2

Thanks for the replies. I guess I will hold off on this issue with PNG’s until 4.2

This happens when you use straight alpha and not pre-multiplied alpha. Has nothing to with the file format.

With straight alpha, when you have one visible pixel next to a transparent pixel (which is usually white) you get a 50% visible whiteish border because of the interpolation between values.

This issue doesn’t exist with pre-multiplied because it multiplies all the pixels in the image by the alpha value (so transparent white just becomes black), and then they are drawn by using additive blending. There are no artifacts this way, and you can have nice smooth falloffs.

I’m not sure how Unity handles pre-multimied alpha because I don’t have it in front of me right now. But if it handles PSDs right, perhaps it will handle a PNG that has been processed to be pre-multiplied properly.

Simple solution: Don’t export to png, follow the steps from your first link and save your psd to the assets directly. I don’t get why people sometimes don’t use this killer feature of the import pipeline.

Im seeing them even on psds personally.

if anyone is encountering this issue when importing a png from figma then the solution is to uncheck “Alpha as Transparency” in the Texture 2d import settings for the image.

1 Like

theres an option called “remove psd matte” or something, thats what I use now it removes it fine.
Also if you want pixel perfect images mark it as point filtered: none in the importer.

edit: damn dude this thread is older than most of my mates kids :slight_smile:

Thank you very much! This is actually the best answer to the topic.

1 Like