Texture file size in Unity

Hi,

i have kind of problem with file size of textures in Unity. I have texture which 700kb jpeg file. But in Unity when compressed it says its 3 Mb, seriously ? I realy dont understand why its 4 times larger file and what additional information there is in texture to be this big.

Any help a lot appreciated. Thanks.

Luke

JPG is a lossy compression method, achieving very high compression rates depending on image content and quality settings.

On the other hand, DXT (and I believe also the iOS image compression formates) always uses a fixed size of 4 bits/pixel.

By default, textures are scaled to the nearest power of two, because the GPU is optimized for that, and it is a requirement for mipmapping to work correctly.

In addition, MipMapping (which is enabled by default) increases texture size by another 33%.

So if you have a JPG of 1500x1500, with a typical size of 500-1200kB, you’ll end up with a DXT1-compressed, mipmapped texture size of 20482048/21.3333=2.8MB.

The source format for textures is irrelevant–graphics cards don’t use JPG or PNG or anything like that, they only use uncompressed or native hardware compression formats such as DXT. What matters for file size is the settings you use for textures in Unity. As such, it’s not a good idea to ever use JPG for anything, since it’s a lossy format, and if you use DXT/PVRTC compression in Unity, then the end result is lossy-compressed twice. Always use non-lossy formats for your source material, such as PSD if you’re using Photoshop. Again, the source format is never used in a build, so it doesn’t matter if the original file is 100MB or 100KB, the only thing that matters is if you choose 32bit/16bit/DXT1/DXT5/etc. in Unity.

Then BMP is lossy too? I made some 2k x 2k textures and after importing it in Unity they were not sharp enough ( compared to the 3dsmax viewport ). I’ll try it directly with PSD.