- Home /
reduce APK file size
Hi , i have 100 image that i want to show these images on Image UI in my android project, i try to import these textures with Sprite(2D and UI) texture type. i set max size to 1024 and format to compressed. now size of each texture is 1mb ! after that i try to build project and exported APK file size is very huge. output file size is 124 mb ! is there any way to reduce APK file size ?
Well, if you have 100 images that are 1$$anonymous$$b each, then output file size of 124$$anonymous$$b is pretty much to be expected, no...? What are your texture import settings? Have you disabled mipmaps? Try reducing the max size to 256, say.
@tanoshimi average size of each image is 100k , i import this textures as sprite(UI) and i disabled midmaps. 256 max size show image very low quality.
After reading all the comments, Try loading some of them from web ins$$anonymous$$d of including them in AP$$anonymous$$ or you have to compromise with little visual quality. As @PlanetVaster said, you can try 16 bit on the images which do not have gradients of color.
Answer by PlanetVaster · Dec 21, 2015 at 12:07 AM
You could reduce max size to smaller than 1024, use jpgs instead of pngs, could also try 16 bits instead of compressed. That's about all you can do as you have 100mb of images so your actual app is only about 24 mb.
The source image format is irrelevant and, since JPG is a lossy format, you should definitely NOT use JPGs ins$$anonymous$$d of PNGs. The relevant factor is the texture format with which the images are imported into Unity.
Answer by beppim · Dec 22, 2015 at 07:57 AM
It does not matter which size or compression level is your image when you put it in the project, it only matters how that image is imported. So the first rule is: never use lossy compression (jpg) for your source images, as soon as you only will add artifacts to the image, without any advantage. 1MB for one 1024x1024 png image is not that much. I think that anyway 1024 is rather a big format for a cell phone, you can reduce the import size to 512. The second thing you can do is to import it as Crunched instead of Compressed, that should generate a lossy version and hence reduce the size. If that doesn't fit, the only other possible solution is to load the images from an online server.