[Implemented] SaveImage() PNG compression level flag

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

[Implemented] SaveImage() PNG compression level flag

Post 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()
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, it uses the Z_BEST_COMPRESSION level, which is the maximum one AFAIK.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Thanks, I've been curious on that for a long time :)
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post 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?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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.
Post Reply