[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] Cairo & libpng/zlib parameters

From: Jeroen van Rijn
Subject: [Maposmatic-dev] Cairo & libpng/zlib parameters
Date: Sat, 16 Jan 2010 22:18:27 +0100

Hi all,

In the project, Cairo is employed by way of PyCairo to
render city maps from OpenStreetMap data using Mapnik. I'm currently
investigating the possibility of running optipng after the rendering
is complete to reduce the size of the output file, see [1]. So far
I've identified a number of zlib parameters and png filter range that
appear to be the sweet spot for this type of image as far as file size

In doing this it suddenly occurred to me that it might be possible -
rather than apply optipng as a secondary stage - to direct Cairo to
directly output a png file with the zlib and libpng parameters

My question to you is: Is there an optional parameter to give PyCairo
or Cairo itself to select a certain png optimization strategy? e.g.
surface.write_to_png(output_filename, zlib = 'zm=9,zc=9', libpng =

Thanks in advance for taking the time to answer.

Best regards,
Jeroen van Rijn


"That's like saying that a squirrel is 48% juicier than an orange -
maybe it's true, but anybody who puts the two in a blender to compare
them is kind of sick." -- Linus Torvalds

reply via email to

[Prev in Thread] Current Thread [Next in Thread]