New issue 29 by daniel.watling: Allow compression level to be passed into
PNGWriter
http://code.google.com/p/pulpcore/issues/detail?id=29
It would be nice to allow the setting of the compression level when using
PNGWriter instead of defaulting to no compression.
I've attached a patch that will add a second (optional) parameter to the
PNGWriter.write method. The value for this second parameter can be any of
the compression levels found in "Deflater". The default is no compression.
Attachments:
pngwriter.compression.patch 1.6 KB
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
This is incorrect because the PNG format specifies "At present, only
compression method 0 (deflate/inflate
compression with a sliding window of at most 32768 bytes) is defined.". So,
1) the default should use
Deflater.DEFAULT_COMPRESSION and 2) the compression method byte should
always be 0. Also, the new write()
method should throw an exception if the compression level is not 1-9 or -1.
Unfortunately, even with compression level 9, the compression won't be as
good as the PNG encoder provided in
tools/assettools/png which does analysis and optimization.