[cairo] [Maposmatic-dev] Re: Cairo & libpng/zlib parameters
chris at chris-wilson.co.uk
Tue Feb 2 13:33:18 PST 2010
On Tue, 2 Feb 2010 21:45:54 +0100, Thomas Petazzoni <thomas.petazzoni at enix.org> wrote:
> The thing that is limiting today is the size of the area that Cairo can
> render in PNG mode. Some large French cities (such as Arles) cannot be
> rendered because of this, the rendering fails with an out-of-memory.
> Rendering the PDF and/or the SVG for the same area works fine, though.
We can lift it, and there is no inherent reason why pixman is only using
16bit integers. However that will only increase the maximum size to 2^23
(i.e. limited to cairo's own 24.8 coordinate system). Also, if you wish to
enable h/w acceleration for rendering then Cairo itself does not provide
convenience functions for tiling (though constructing an array of surfaces
with varying devices offsets and repeating the rendering to each is
trivial), and h/w limits tend to be much smaller than the 32kx32k
limitation of pixman.
> Moreover, since the PNG output of Cairo is said to be "for debugging
> only", I think we should investigate the idea of generating only SVG
> and PDF with Cairo, and then convert one of SVG or PDF to a PNG image
> using another tool. Maybe this other tool will be more capable than
> Cairo of generating very large PNG pictures.
What's the information content of these very large images? I'd guess the
SVG or PDF (in particular) representation will be much more compact than
the rasterised PNG. Anyway as mentioned earlier, the parameters Cairo uses
for its PNG generation are less than ideal for your use case, and it would
be interesting to replace Cairo's naive PNG writer with your own.
Please, whenever you find any issue like this, let us know and we'll see
how we can help -- we want you to have fun with Cairo! :)
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo