- Home /
What is a good file size for spritesheets (mobile)?
I'm just starting with unity and creating my first mobile game. It will be a 2D game for Android an Windows phone 8.1 / universal 8.1.
I have imported some spritesheets with my main characters but I'm not sure at what size I should import them. At First I made them pretty large: 4096x4096, individual sprites are about 250x450 px. Then I set the MaxSize on the sprite in unity to 1024x1024. But then I started to worry about the size of my .apk (for android), so I resized the actual spritesheet down to 1024x1024. This effectively reduced the .apk size as I thought it would, but now my sprites don't really scale to bigger screens. Is there a way to keep my .apk small and don't lose the quality of the sprites?
Also, when I replaced the spritesheets in unity, I lost all my animation clips, so I had to recreate them. Is there a way to reuse the existing animation clips with the resized spritesheet?
You can also try setting your sprite type from tight to full rest, and that will help a bit if you have lots of sprites on the screen and you don't need super accurate sprite collisions!
Answer by Bieere · Oct 08, 2015 at 05:26 PM
Ok so a couple things, look into device support for texture sizes, as some older devices wont support 4096 texture sizes, while they are certainly the nicest quality. I would look into the asset bundles for your sprites, and that way you can set images for HD and SD. 2048 is a good max size if you wanted a default, though depending on the platform this could be pretty heavy, so look into the compression types (ETC, PVRTC for Android and IOS respectively). Make sure you keep with the Power of Two sizes, as they will compress properly on Mobile.
Try and avoid using the Limit size though, as its not very good, Create the images yourself at the sizes you want, within an external program so you can ensure that the quality presented is what you're actually looking for/okay with.
Now if you're ever planning on actually replacing sprite sheets, Make sure you have your Meta files not hidden within the project, and replace it within the directory directly and not within the project window, as generally it will overwrite your current meta file.
Let me know if you have other questions, or concerns though. Hope that helps!
Thanks for the detailed answer! However this raised some other questions..
I didn't have the ETC compression enabled for android, could that be the reason why my game runs a lot smoother on Windows phone compared to android? I followed your instructions by applying the compression for android, as you can see in the screenshot. I haven't had the time to test it on an android device, so I'm not sure if this fixes the smoothness issue on android.
For IOS devices I don't know how to enable PVRTC compression, as there is no checkbox to use that copression in the IOS tab. $$anonymous$$aybe I'm just looking in the wrong location?
About the replacement of spritesheets, your suggested method works great if I keep the original size of the spritesheet, but when the actual dimentions of the spritesheet change, the slices are all wrong as they are done based on actual pixels and not on the % of width and height of the spritesheet. Is there a solution to this?
Thanks for your help!
So the image types need to be set to advanced, and once you've done that when selecting format a big list will appear for options, that's where you'll find the PVRTC check out this page for more info.
Now as for your slicing issue, there is a way to fix that depending on how you're changing it. If you're familiar with photoshop or other photo editing programs, there's something called canvas size, so you'll have to use that when creating your images, and when you do that, so that unity will now move them all around you need to change the height accordingly but from bottom up, and the width so that it increases left to right. If you do that you'll get more image space but your slices should remain correct, as long as they haven't actually been moved that is.
If that doesn't make sense let me know and I'll add some images as more detail.
Allright thanks now it works! I don't really see any performance increase but that might not have been the problem so..
Yeah that works if the individual sprites remain the same size. But in my case they are resized aswell, that's why the sprites are cut off at like 2/3 of the character. I guess I'll just have to recreate the animation clips if I resize my spritesheet & sprites itself.
Thanks for you help!
Your answer
![](https://koobas.hobune.stream/wayback/20220612040529im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can a iOS game camera have the Bloom optimized effect with clear flags = depth only? 0 Answers
Having just one scene in the game: is it inefficient? 2 Answers
Gravely need some optimization tips 3 Answers
Is it possible to avoid DNS lookup when using UnityWebRequest and a shared hosting service? 0 Answers