sprite filesize

Started by HandsFree, Fri 20/02/2015 12:50:36

Previous topic - Next topic

HandsFree

Sorry if this is the wrong place, cause it's not really about scripting, but it is technical... ;)

For the KQ4 project we have a lot of animation stills that are uncropped. We also have a few cropped files (png) and I noticed that the size in kb is almost the same. I expected the uncropped versions that are actually the size of the full screen, 640*400, to be much bigger but apparently they aren't.

I've heard that when importing images, AGS converts then to an internal format. So my question is: will the uncropped images when imported in AGS also take up the same number of kb's as the cropped ones, or does the internal format will make the 640*400 images take up more memory than the cropped ones?

It will save me a lot of work if I can just use the uncropped ones, but the game is becoming very big as it is already.

thanks

Crimson Wizard

#1
AGS imports all graphics as BMP (raw bitmaps), but when saving to file it compresses them using RLE compression.

What is special about RLE is that it replaces the long sequence of one colour with just few bytes (literally telling that X color repeats N times).
This means that images having large regions of one color will be very well compressed.
Roughly speaking, a 10x10 blank image will take same space as 1000x1000 blank image.


PS. PNGs have their own compression, that may produce similar results (although, frankly, I never looked into their format specifics).

HandsFree

The part that is deleted by cropping is just transparency. So I understand the uncropped ones will not take up more space than the cropped ones.
thanks

SMF spam blocked by CleanTalk