- Home /
Best Image Format for Unity Game Textures?
What are the pro's and cons for PNG,TGA,JPG,GIF,TIF, etc in unity games?
what takes less space, what is good for alpha channel, what is fast to read from?
Answer by Fornoreason1000 · Oct 12, 2014 at 09:47 AM
Just go with .PNG or PSD. no matter what you use Unity will Convert them to DDS DXT5(not always DXT5) when you build or when you run the game. I say PNG because it readily supports Alpha and generally small anyway. but its all personal preference.
Also don't try import DDS files(using the Photoshop plugin), it doesn't quite work... might be unity trying convert a DDS to a DDS....
Answer by zharik86 · Oct 12, 2014 at 09:44 AM
Irrespective of a format which you import, Unity transfers everything to .psd with layers. For pictures without channel alpha you can use .jpeg (less space). For an alpha of the channel it is better to use .png.
Just a clarification, but Unity does not transfer it to PSD. It converts it to whatever native GPU format is required for the texture and compression type set on the asset, and stores it in your metadata folder. PSD or LZW/ZIP Compressed TIFF tend to be the best sized formats that are lossless.
Just in case anyone else stumbles upon this: This answer is wrong in every way. Unity doesn't convert to .PSD. JPG is a terrible format for games, it's lossy. Most art software won't show proper alpha channels for PNG, so it's a bad choice.
You should actually use TGAs or TIFs for all 3D model textures. PNGs are okay for sprites and UI elements.
It's not really necessary to use TGA or TIFF, PNG works fine in almost all cases. Though you are right about the first part. I've moved the accepted answer to Fornoreason1000's answer to avoid confusion for future readers.
PNG can be fine, but has some weird edge cases where it's not. If a PNG has 0 in the alpha channel (fully transparent) then it will always have 0 (black) in the RGB channel. So if you're trying to use the channels to store different texture maps this can screw you over. For example in Unity's standard shader, it stores the Glossiness map in the alpha channel of the Metalness map. If you use a PNG and it has 0 Glossiness then it will also have 0 Metalness even if that's not what you put in the red channel.
Answer by jmasinteATI · Aug 22, 2016 at 11:49 PM
I ran into memory problems with transparent png sequences. The data file size was huge and the game itself wouldn't build properly. The animation was very glitchy. I tried using tgas instead of pngs and now the data file is much smaller and the game builds properly. The pngs were sprite textures I tagged for use in an atlas. I'll probably use tgas from now on.
Answer by saleh-alabbas · Dec 20, 2018 at 08:52 PM
For anyone who might be interested.. As Fornoreason said but with more details, check the answers for why small size textures on disk become huge in build