- Home /
Image - Actual Size / Unity Size
I've never understood how Unity manages my imported image sizes.
For example, I have made a texture png that has a file size of 3KB, but as soon as I import it into Unity and make it True Colour, that file size is now 1.3MB.
Whats odd is that a lot of these images that do differ in size in file, seem to have the same size within Unity, only larger.
Example, I have 5 PNGs of a grass texture, the actual file sizes range from 100KB to 300KB, yet in Unity, they're all 0.7MB.
Also, I remember having a large texture (actual file size was about 5MB), but in Unity, that size was around 52MB if I remember correctly, yet it made hardly any difference to my overall build size within Xcode (building for iOS here).
Can someone please shed some light here for me?
Thanks
Did you ever figure this out? I am seeing the same thing.
Answer by Statement · Oct 15, 2014 at 05:45 PM
The original file format doesn't matter as Unity will convert png/jpg/psd etc into a native format that Unity understands. Uncompressed textures will consume more memory than compressed textures.
For truecolor non-transparent textures it's (3 x Width x Height) bytes
For truecolor transparent textures it's (4 x Width x Height) bytes
An example:
A 1024x1024 truecolor RGB texture is then 3 x 1024 x 1024 = 3145728 bytes or 3 MB
Answer by Digger8048 · Oct 15, 2014 at 05:48 PM
When you import a texture into unity and set it to true color that removes all compression (which is why they go from various sizes to a consistent size). For example, imagine you have 2 256x256 PNG images; one is a photo, and the other is solid black. The photo has a lot of complexity to it and will only compress a little. The black image will compress extremely well since it is just one color. So, compressed they are different file sizes, uncompressed they are the same.
Your answer
Follow this Question
Related Questions
Texture Import - PNG 8bits ? 1 Answer
How to create a circle around a selected game object? 1 Answer
Create .png file from script, then import as asset 1 Answer
Texture loading problem: size, aspect ratio, and alpha 0 Answers
Importing texture, problem with size - width and height get changed 3 Answers