[Zlib-devel] FYI: lossy compression

Ed Avis ed at membled.com
Tue Sep 3 10:17:01 EDT 2002


I have a half-finished (or more like one-quarter-finished) project to
generate lossy PNG files, which can be decompressed using standard PNG
libraries.  So far I have created a modified zlib which can be used
for lossy compression of 'raw pixel' images.  You can see the results
here: <http://membled.com/work/apps/lossy_png/>.  Some other chap is
using this to create MNG files (animations) with lossy compression,
which apparently works very well.

I post this here because, well, the list was a bit quiet :-).  I hope
the developers aren't too offended at the code I hacked into deflate.c
to make it find lossy matches.  Unfortunately it's very slow when
doing this matching because the hashing speedup can't be done.

In the long term I would like some way to plug in a lossy matcher to
zlib - an interface which lets the application handle this part of the
compression.  Then zlib need not know anything about PNG format.  This
interface could come with a couple of toy examples for
case-insensitive compression and the like; the actual
image-compressing heuristics should not be part of zlib,
obviously.  If the zlib developers like this idea then I can post a
more formal proposal.  (I'm imagining a patch of about 200 lines plus
a couple of examples and docs.)

-- 
Ed Avis <ed at membled.com>






More information about the Zlib-devel mailing list