Page 1 of 1

[Implemented] SaveImage() PNG compression level flag

Posted: Thu Feb 24, 2005 1:39 pm
by Rescator
Heya Fred,
how hard would it be to add that?
PNG has 0-9 as compression level.

What does the current implementation use?
I found no info on wether the current one uses level 9
or something lower. (I know many programs default to level 6 or similar)
If PureBasic's implementation allready uses PNG level 9 compression
then I'm allready happy as max compression is what I want.

But if level 9 is not the default then I'd like to be able to specify it
in SaveImage()

Posted: Thu Feb 24, 2005 3:13 pm
by Fred
Yes, it uses the Z_BEST_COMPRESSION level, which is the maximum one AFAIK.

Posted: Thu Feb 24, 2005 4:38 pm
by Rescator
Thanks, I've been curious on that for a long time :)

Posted: Thu Feb 24, 2005 7:41 pm
by Blade
And what about filtering?
http://www.libpng.org/pub/png/book/chap ... ch09.div.1


@Fred:
Would be easy to add a 1bit/8bit transparency to the saved PNG image, giving an additional bitmap (one for colors and one for transparency) when saving?

Posted: Thu Feb 24, 2005 8:13 pm
by Rescator
Asuming Fred uses the official spesification, then the filtering is done automatically by te compressor.
Fred can probably clarify this, but I think that the higher PNG levels uses the filtering while the mid levels don't etc. or to a lesser degree.