Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by janestap · Dec 05, 2014 at 11:48 AM · spritegraphicsfile sizejpg

Include jpg files without automatically converting to sprites or textures

I've been playing around with Unity and now I want to create a game with lots of pictures. After adding just a few pictures I noticed that the APK starts to be very huge. The jpg files automatically get converted to sprites taking up more than 2MB per picture while the original files are less than 60KB. I only need one picture at a time in the game and speed is not a concern. Is there any way to include the jpg files as they are (just the file as it is instead of converting it to a sprite or texture) and at runtime when I need them convert them to a sprite? I'm using the free version of Unity 4.6 and c#.

Thanks for any help.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Denvery · Dec 05, 2014 at 04:54 PM

Yes, you can simply change .jpg to .bytes. Then you can use http://docs.unity3d.com/ScriptReference/Texture2D.LoadImage.html to create image from textAsset. This will reduce APK's size.

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 janestap · Dec 06, 2014 at 11:37 PM 1
Share

Thank you for helping. I will try your solution later. Now I'm using a special folder 'Strea$$anonymous$$gAssets'. See http://docs.unity3d.com/$$anonymous$$anual/Strea$$anonymous$$gAssets.html

avatar image Denvery · Dec 07, 2014 at 09:51 AM 0
Share

Please post your feedback about using Strea$$anonymous$$gAssets. Especially about AP$$anonymous$$'s size. It is interesting for me.

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

2 People are following this question.

avatar image avatar image

Related Questions

How do I add/draw a sprite? 1 Answer

NullReferenceException when trying to animate sprite 0 Answers

2d game, sprite artifacts when moving 1 Answer

Poor quality sprite 2D game 3 Answers

Getting a weird line over my sprite character in my 2D game, no idea where it is coming from 1 Answer


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