Sprite Background Optimisation Question

Hello!

I have a question about 2D sprites and optimisation. I know in a previous program I was using, it was better to create sprites with a coloured background and let the development software turn it transparent, rather than uploading PNG’s with transparent backgrounds. Apparently the PNG’s with transparent backgrounds were less optimised, though I can’t remember the exact reasons.

So, is it better to upload sprites with a coloured background and let Unity make the background transparent, or should I just upload PNG’s with transparent backgrounds?

Does it make a difference? And if it does, could anyone explain why one way is better?

Thanks in advance!

The PNG will be converted to another format by Unity, so it really doesn’t matter. Depending on you target platform, Unity will use different formats for the final build. What is appropriate for the desktop, might not be appropriate for a mobile platform.

If you do have sprites which don’t have transparent parts, it is probably better to have these in their own sprite sheets.

Use Packing Tags, then Unity will create optimzed sprite sheets for you.

1 Like

Also Unity wont make the solid color background transparent.

*you could do that with editor script, but this wouldn’t be any different from having alpha there in the first place…
https://github.com/UnityCommunity/UnityLibrary/blob/master/Scripts/Editor/SpriteBackgroundRemover.cs

1 Like