Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mozesh on Thu 31/03/2005 12:34:33

Title: Size difference
Post by: Mozesh on Thu 31/03/2005 12:34:33
Hey ive got a question.
Someone in the forum here said that png and bmp are almost the same quality but png takes much less space. So my question is: does the difference in file size makes a  big difference for my ags game's filesize. In other words is using png better than using bmp.

-redrum89
Title: Re: Size difference
Post by: scotch on Thu 31/03/2005 12:38:22
It makes no difference for AGS, and they are not almost the same quality, they are exactly the same quality.
Title: Re: Size difference
Post by: strazer on Thu 31/03/2005 12:40:31
For the web, PNG is preferrable, but in AGS, no matter what graphics file format you use for import, the resulting data is the same:
Sprites are NOT compressed for performance reasons and room backgrounds are compressed by an internal lossless algorithm.
Title: Re: Size difference
Post by: Mozesh on Thu 31/03/2005 12:41:21
Okay thanks :) another question out of my head
Title: Re: Size difference
Post by: NiksterG on Thu 31/03/2005 19:02:40
Okay, so is there a specific type of file that is best for sprites, since they are not compressed? (Other than jpegs... they look really bad.Ã, :P)

(Oh, by the way: Happy Birthday, strazer!)
Title: Re: Size difference
Post by: scotch on Thu 31/03/2005 19:15:37
It makes no difference in the case of sprites either, they are stored uncompressed.
Title: Re: Size difference
Post by: strazer on Fri 01/04/2005 17:06:52
Quote(Oh, by the way: Happy Birthday, strazer!)

Oh, didn't see that until now. Thank you! :)
Title: Re: Size difference
Post by: Mozesh on Fri 01/04/2005 18:51:01
Now a different thing about the same thing.
Sprites with transparent around it.
So lets say youve got a sprite with a huge transparent space around it. Will that be bigger than when a small transparent space around it?
Title: Re: Size difference
Post by: Gilbert on Mon 04/04/2005 09:01:52
Yes. Since sprites are not compressed, memory usage is directly related to the size.

Here are some simple calculation examples, for example, if you have 2 sprite, one 50*20 pixels, another 100 * 30 pixels (Both INCLUDE teh transparent pixel areas).

If they're both 8-bit indexed sprites (1 byte per pixel), they consume memory respectively:
1 x 50 x 20 = 1000 bytes
1 x 100 x 30 = 3000 bytes

If they're both 16-bit hicolour sprites (2 bytes per pixel), they consume memory respectively:
2 x 50 x 20 = 2000 bytes
2 x 100 x 30 = 6000 bytes

If they're both 32-bit truecolour sprites (4 byte per pixel, 3 for RGB channels, 1 for Alpha), they consume memory respectively:
4 x 50 x 20 = 4000 bytes
4 x 100 x 30 = 12000 bytes

Of course it's just rough (but quite accurate) estimate as you need also to take into account the indexing, etc. info. in the sprite data.