Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by GenericToast · Sep 13, 2017 at 09:21 AM · androidapkcompressionfilesizefile size

Sprites increase android apk size

So i don't really know much about compression and other stuff when it comes to an apk, but when i built my apk, i saw that the size was 38mb which is rather large considering the project i was working on did not have much stuff. I then decided to test by adding a couple more sprites to the project, totaling around 1mb. When i built the apk this time, the file size increased by 3mb, even though i only added 1mb of sprites.

Can someone explain to me how this works and how i can reduce the apk size?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by kaplica · Sep 13, 2017 at 11:33 AM

@chiragjksol mentioned about compressing size of images before loading them into unity. That is totally pointless. The file can be 30kb as jpg but once it becomes a texture and then sprite in Unity3d, it goes back to it's original size. Unity decompresses the image from it's format and puts it into memory as 500x500x4bytes for example, so higher resolution images will be bigger in size.

You should work on the graphics in a sophisticated editor like Photoshop or Gimp. You can resize the texture once it's in Unity.

You should be optimising your in-game textures using the inspector. Click on a texture, then in the inspector choose and override platforms that you want to compress the image on.

If you want the texture to be smaller size make sure "Generate mip maps " is unticked.

You can select the size of the texture: Keep lowering it down until it starts to look bad in the editor on the desired resolution. If your texture is transparent select RGBA (RGB if not) and then compression PVRTC 2 bits, if it looks bad change to 4 bits.

You can also try enabling the "Strip Engine Code" In player build settings. This should reduce the build size further.

alt text


compression.png (34.3 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GenericToast · Sep 13, 2017 at 02:11 PM 0
Share

Thanks for the info.

What i wanted to find out though was why adding 1mb of sprites would increase the apk size by more than 1mb

avatar image kaplica GenericToast · Sep 13, 2017 at 02:24 PM 0
Share

Because the size of the sprite outside unity will be different when imported and built. I explained this in my answer. $$anonymous$$ake them 256 or 512 in size or smaller in the inspector and they will decrease in size... Obviously the quality will be lower too depending on the resolution you are using.

avatar image
0

Answer by chiragjksol · Sep 13, 2017 at 10:05 AM

You can compress all of your image here.

and after goto File -> Build Settings -> click on Player Settings - > you can see there other settings, find there Device Filter and select ARMv7 and check your apk size.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GenericToast · Sep 13, 2017 at 11:20 AM 0
Share

Changing it to AR$$anonymous$$v7 reduced the apk size by 10mb which is great.

What i still don't understand is why does adding 1mb worth of resources increase the apk size by more than 1mb?(it increased the size by 3mb in my case)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

147 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android game too heavy after installation! 0 Answers

Android Apk file size very large, unnecessary assets comressed in APK? 1 Answer

File size is far too big!! 8 Answers

What are the cons of using ETC2 on iOS, or across all platforms? 0 Answers

How do I build apk that works on galaxy s8 aspect ratio (18.5/9)? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges