[cairo] GIF, PNG and MNG supports

John Ellson john.ellson at comcast.net
Tue Oct 23 05:17:09 PDT 2007


Nguyen Vu Hung wrote:
> 2007/10/23, Stuart Parmenter <stuartp at gmail.com>:
>   
>> Image decoders don't belong in cairo.  the PNG stuff was done to make
>> testing easier and should have probably been done in an external
>> library.  It would be great to see someone put together an little
>> external helper library to load images in to cairo surfaces though.
>>
>> stuart
>>     
>
> As stated in the README file:
>
> ----
> What is cairo
> =============
> Cairo is a 2D graphics library with support for multiple output
> devices. Currently supported output targets include the X Window
> System, win32, and image buffers, as well as PDF, PostScript, and SVG
> file output. Experimental backends include OpenGL (through glitz),
> Quartz, XCB, BeOS, OS/2, and DirectFB.
> ----
>
> I think make cairo support GIF output is a good thing to do.
> Now GIF patent is expired so more and more applications are coming
> back to support GIF. There is no more politic bullshit regarding GIF
> anymore. IMO, PNG has better than GIF in compression ratio but PNG
> does not support animation. MNG is the future of both GIF and PNG. So
> why we limit ourself in just PNG?
>
>
>   

Its an ungainly hack, but I have a gif backend for cairo using gd in 
graphviz (www.graphviz.org). 

The cairo surface is copied in memory to a gd image, then gd's output 
code is used.   Not very memory
efficient, but unfortunately, the in-memory formats are different.

The code of interest is in:   plugin/gd/gvdevice_gd.c

Perhaps you can start from this for a more general purpose cairo extension?

John


More information about the cairo mailing list