[cairo] really wide images?

Chris Wilson chris at chris-wilson.co.uk
Mon Mar 18 03:47:22 PDT 2013

On Mon, Mar 18, 2013 at 01:41:21PM +0900, Toby Dylan Hocking wrote:
> Hi, I would like to use cairo to create a PNG scatterplot of some time
> series data that is 768315 pixels wide by 100 pixels tall. In
> particular it is a sparse binary image: 99% of the pixels are white,
> and only a few pixels are black. Using cairo under both R and Python,
> I get an error: 'invalid value (typically too big) for the size of the
> input (surface, pattern, etc.)'
> I noticed there is a limit in cairo-image-surface.c and I thought
> about changing it and recompiling.
> #define MAX_IMAGE_SIZE 32767
> However I suspect that won't work unless I also change pixman
> somehow. Do you have any advice about how to do that? Or can you
> recommend another package that would be able to make my wide PNG?

The limitation is due to the use of 16.16 fixed point for trapezoid
rendering in pixman. For your purposes of composing a a1 image for
writing to png, it is probably irrelevant and you may find simply
removing that limit to work fine.

Otherwise, I guess something like imlib will meet your needs.

Chris Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list