- Home /
Textures much bigger in Unity than original file size?!?!?!
Hi guys and gals,
I have an odd issue (maybe not odd... just noobish).
I have a few 2048x2048 png files that I am mapping to planes for my game to give a "Mode7" look. It's all working really well, but the final build size is massive, as each image is taking up 8mb of space within Unity, even though the original file size of the pngs is only a few hundred kb. What would cause this?
I need to have the files uncompressed, as compression, no matter what setting I use just looks horrible, as I am going for a retro 16 bit look... I really can not afford to have compression artifacts all over the place.
Is there a reason these png files need to be so large in Unity?
Any help greatly appreciated.
Answer by whydoidoit · Jun 14, 2012 at 12:44 PM
Well the simple answer is "that's how big they are!"
PNG is a file format, but when loaded into memory it takes that much space. The compression available on textures is all about keeping the size of a pixel down by losing information (I expect you know this). So it wouldn't matter if it was a Jpg (apart from the lack of alpha channel) it would still take a large amount of space.
So you don't have a PNG in Unity, you have a PNG imported into a texture.
Ah, so it's the textures that take up that space? Not just the png file? Bummer... I was hoping I could get the size down... shame Unity doesn't support 8 bit textures. LOL.
I think for the iOS version of the game I can afford to drop down to 1024x1024 textures... I'll have to make do with the large file size for $$anonymous$$ac and PC.
Thanks for your prompt response!
If you are going for a 16bit look could you construct from tiles? That would give you your own way of doing compression...
Also you could try actually loading them at runtime from the file... It would take that much memory - but your game would be smaller. And it would take time to load.
I thought about using tiles, but it's not really feasible for this project... while the style is 16-bit, it's really only a style, I'm doing stuff that the 16 bit consoles would never have been able to pull off... tiles would work for some of the textures, like the grass segments, but it's a bit too intricate to do completely with tiles.
Also, even if I used tiles, wouldn't the end product still be the same? I'd still need to fill a 2048x2048 texture with tile images... so I'd still have an 8mb texture. I could compress the tiles, which may give better results than compressing an entire 2048 png, but I don't think it would be worth the hassle.
I'll just stick with the large file size on PC/$$anonymous$$ac (the whole game shrinks $$anonymous$$ASSIVELY when zipped, anyway) and change to lower res textures for mobile devices. Cheers :)
Answer by flamy · Jun 14, 2012 at 01:31 PM
@whydoidiot's answer is quite true. along with tht the texture settings choosen for the texture matters, true color image will be of more size and the compressed ones would be of less size.
a 1024x1024 true color will be 4 mb~ where with compression it may go down upto 1.2mb (or even lesser with the compression options i havent used yet). The reason for the increase in size i suppose is, unity doesnt handle it as png or jpg, it handles it as byte array. Im not sure with that though.
better advise to reduce size is to sacrifice quality for the models that wouldnt be noticed much.
Hehe, the problem is, the models I am using are custom planes (2 triangles)... can't get much less detailed than that! LOL.
no i meant the quality of the textures. not all needs to be true colored rite??
Oh, okay. I'm not using true colour, I'm using 16-bit. Because the gfx are so basic, any compression at all makes it look horrible.
Your answer
