Page 1 of 1

Using PNGs for storing imported bitmaps internally

Posted: Wed Sep 12, 2012 4:48 am
by darkhog
Because texture which have in PNG 6.9KB after import was increased to around 393216 bytes (over 390KB!), which is same texture as bitmap (BMP). I know that textures would need to get uncompressed before run, but please store them in project file and in exe as PNGs so file size will be even smaller (especially significant if you are using lots of loaded textures)

Posted: Wed Sep 12, 2012 10:45 am
by VilleK
The ZGE engine has a built-in JPEG decoder. So you can use jpg format to get compressed bitmaps in executable.

Posted: Wed Sep 12, 2012 12:06 pm
by darkhog
Yeah, but JPEG has no alpha and is of lesser quality. And PNG is a lossless format with small footprint (at least on disk) plus has alpha. So why not use PNG instead of BMP and convert all BMPs to PNGs instead other way around?

Posted: Wed Sep 12, 2012 12:27 pm
by VilleK
ZGE has been designed to be as cross-platform as possible. Less dependences on external codec support makes it more portable. I agree Png support would be useful (also mp3) but that makes the platform specific code harder to write for the engine developer (me :) ) and also becomes an additional hurdle when a new platform comes around. As it is now, I was able to make the Android port in very short time.

Posted: Wed Sep 12, 2012 12:31 pm
by darkhog
^ cross-platform PNG lib.

//edit: Also OGG Vorbis is superior to MP3. Not only you don't have to pay license fees, but also OGG produces better quality sounds with smaller files.