• 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 Piesk · Oct 07, 2013 at 09:58 AM · importing problems

.png file too large for unity?

Twice now i have tried to import graphics into unity and it has come up with:

"Could not create texture from 'file path' file could not be read.

Several other graphics have worked fine, these 2 particular files are quite large, is it because they are too large for unity? If so what is that cap that will work? And is it a resolution issue or a memory issue (200cm with high pixel count, or 38mb)?

Thanks for your help.

Comment
Add comment · Show 5
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 DyrdaOrg · Oct 07, 2013 at 10:50 AM 0
Share

Hello Piesk,

Could you upload them to speedyshare.com (if that's okay, of course for you - you can easily remove them later) for me to check?

Also could you be more specific when that error occurs (while pasting files in asset folder, while assigning to material, etc.)?

I don't have such large png files to test although I did test with black white and 16 bit colour bmp (98$$anonymous$$B each) and my platformer walks with bow made from that material with no problems ;)

Could be also problem with particular file and/or computer parameters.

avatar image Piesk · Oct 07, 2013 at 11:28 AM 0
Share

ok trying to upload it now, slow going with this internet though, the error occurs when trying to paste the file into the asset folder, just comes up with a blank white file and gives the pre-mentioned error message.

thanks for your help.

avatar image Piesk · Oct 07, 2013 at 12:13 PM 0
Share

the file has been uploaded:

http://speedy.sh/tbCVD/Star-Layer.png

avatar image tanoshimi · Oct 07, 2013 at 12:25 PM 0
Share

How are you importing the files - by just dragging them into the Project?

avatar image DyrdaOrg · Oct 07, 2013 at 12:43 PM 0
Share

Hello - tried to open in browser "cannot open - file contains errors" (translated from polish so it's probably not exact text. Tried to right click and download -> 35 kb file on my desktop that I can't open... hmm could you send it once again and after hour I'll be back home where I have different internet (here we have some filters that may affects this)

3 Replies

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

Answer by tanoshimi · Oct 07, 2013 at 12:59 PM

Right..... so, the dimensions of that image are 23,622 x 23,622 pixels. Uncompressed, it occupies 5.8Gb of memory. You are not going to be able to use that file in any sort of game on any system. I normally aim for an absolute maximum texture size of 4096x4096, but even that's pushing it on older hardware - 1024x1024 is plenty for most purposes.

If you explain what you're trying to use the texture for, we might be able to suggest better alternatives.

Comment
Add comment · Show 9 · 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 DyrdaOrg · Oct 07, 2013 at 01:04 PM 0
Share

$$anonymous$$y file I imported and is working is 4961x7016 - I'm not saying that is good thing not using textures that are power of two but it's possible - weird thing is that this texture is not that big, and I can't download/open it...

avatar image Piesk · Oct 07, 2013 at 01:20 PM 0
Share

the file is only 38mb on my machine. Basically i am setting a space scene, there is a hexagonal grid, and a starry space skybox. This texture is supposed to go behind the hexagonal grid to add depth to the game. So that it appears that some stars are closer than others.

I admit my solution is probably not the best but i can't think of a better one. The effect needs to be visible on any part of the game, and the game map size will vary dependent on what level it is.

ps. how do i delete the image from speedyshare ?

avatar image tanoshimi · Oct 07, 2013 at 01:22 PM 0
Share

"Not that big" is relative ;) For a scientific imaging application, a 558-megapixel image might be perfectly fine. For a game? Not.

avatar image tanoshimi · Oct 07, 2013 at 01:28 PM 0
Share

38mb is the filesize - the amount of space occupied by the compressed PNG file on disk. If you load that image in Photoshop or GI$$anonymous$$P you'll see that, when uncompressed and loaded into memory, it occupies nearly 6Gb of memory.

avatar image Piesk · Oct 07, 2013 at 01:31 PM 0
Share

ah yeah doi, i posted what i am trying to achieve with it, do you know of any other way i could do this ?

Show more comments
avatar image
0

Answer by DyrdaOrg · Oct 07, 2013 at 02:45 PM

You can always put more then one camera - one for deep space and one for "the action"

http://docs.unity3d.com/Documentation//Components/class-Camera.html

Here is platformer tutorial:

http://walkerboystudio.com/html/unity_training___free__.html#unity3game3

Part 19 - 22

And there you have more then one camera for background, GUI, etc. It should be in some weird way similar. ;)

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 Piesk · Oct 07, 2013 at 03:17 PM 0
Share

already doing something similar, i don't think i can capture the effect i'm after using this. Thanks though.

avatar image
0

Answer by Bitpocketer · Sep 06, 2015 at 10:23 AM

I am facing issue, the file size is 34 mb on disk , loading it in photoshop makes it occupy more then 1 gb space in memory, does that mean unity uncompressess the file before importing it, i need to use exact same texture, how do i go about it?

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 Captain-Awesome · Sep 06, 2015 at 02:02 PM 0
Share

I would shrink the image first, ask yourself what is the screen resolution of your target platform? Then make the image that size or smaller, and a power of two (to enable Unity to compress the image nicely) of 2048x2048, 1024x1024, or 512x512.

If you want this PNG to be used across an entire level, you'll have to break it up into smaller pieces and add each one individually. Either in Photoshop, or Unity lets you tile sprites like that too, through the Sprite Editor.

avatar image Pharan · Sep 06, 2015 at 02:27 PM 0
Share

(1) Compression is something that saves space on disk. The same compression cannot be applied to images in memory and still be usable. Unity doesn't save uncompressed versions of your image. But the engine uploads an uncompressed version to the GPU, because the GPU can't handle PNGs in memory. It's just not that type of format. Certain types of compression work for GPUs but they're very specific to hardware and APIs and they're also lossy and look terrible in most cases, so NOBODY really uses those compression to save to disk.

Anyway, point is. File size is not the same as data size in memory. In memory, the formula is number of pixels * bit depth. A regular 1024x1024 RGBA texture is 1024 x 1024 x 4 bytes big in memory; (around 5$$anonymous$$B).

(2) Graphics hardware and graphics library APIs are the things that enforce a texture size limit. 1024x1024 pixel images maximize compatibility with older hardware. $$anonymous$$ost modern devices support 2048x2048. You'll actually find 4096x4096 support in high-ppi tablets, not sure if it's exclusive to them nowadays. Beyond that is just a no go if you want it to be supported widely (both by hardware and by graphics libraries). As such, Unity prevents you from choosing beyond a certain limit.

(3) If it's a huge texture, the solution is to break it up into smaller textures. If it's just a really high-resolution texture ins$$anonymous$$d of a really large regular-resolution one, just resize it down.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

19 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

Related Questions

importing game object problems 2 Answers

Animations Import Settings Problem: Start and End Time 0 Answers

Unity Linux Editor crashes "error opening file" after calculating hashes, deleting meta files fixed it 1 Answer

Where do I find an interrupted import to delete it? 1 Answer

Sprites do not refresh/reimport with ScriptedImporter using the SpriteEditor 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