- Home /
Texture Compression
Hello! My team is working to reduce our texture size to decrease build size as well as size of textures in memory. We are using PNG files for our textures.
I noticed that in the editor, build log, and apk result, it doesn't seem to matter if I bring in my PNG files at full quality, or compressed, the texture size in the build log, editor, and apk size remains the same.
I found some links that discuss this issue, and it appears that Unity never uses the actual PNG so compression doesn't matter. I just wanted to have this realization confirmed if it is true. Thanks!
https://forum.unity.com/threads/unity-ios-image-sizes.162962/ https://forum.unity.com/threads/does-unity-truly-support-png.208307/
Answer by NoDumbQuestion · Jun 19, 2018 at 02:00 AM
I use this for almost of my project on Mobile to reduce size without lost of Image quality . 50-70% size reduce most of the time.(and it is free too)
Tested: 200 600p Images in game from 120Mb build --> 60Mb
Thanks for the answer, but this isn't really addressing my question. Does your build actually shrink and were there specific settings for that? Compressing for me shows that the project size decreases, but doesn't appear to ever effect the build
I think unity do compress by default. In Images/textures you can find option for that.
And if you put image/texture in Resources folder. I notice that build size reduce even more.(roughly 20%, not sure why).
If you want to trade build size with loading scene time, You can put entire scene to assetbundle(the game have to uncompress scene evertime open up). That's why you can see some game have 30s boot up.
And about textures exist in memory/RA$$anonymous$$. You have to destroy any references to the images textures. Or set sprite/UI rexture - -> null.
Call application.unloadUnusedAsset
.
For best result, that i have done, put all image png to Resources folder. Cal resources.UnloadUnusedAsset
when reference of texture set to null
The texture will be release from memory
Tested: 720p image/textures always take 1.0->1.5 $$anonymous$$b of RA$$anonymous$$ no matter of how you compress them