All,

I am reviving this old thread because the topic came up in a thread with 
a less-apropos name, and I think we can move it forward a bit more now. 
  Steve's message (below) is still a useful summary of the cairo status.

examples/backend_driver.py can now be used for wholesale testing and 
comparison of the cairo backend.  Example:

python backend_driver.py cairo.png agg

will make png files using cairo and using agg.  On my machine (Thinkpad 
T60, ubuntu feisty) it takes 0.96 minutes for Cairo, 0.76 for Agg.

There are two conspicuous bugs in the Cairo output:

1) contour_demo.py: the image part of the figure is wrong in shape and 
content.  It looks like an array dimensions confusion or something like 
that.  Strangely, the very similar image in image_demo.py is fine.

2) polar_demo.py: the part of the spiral outside the bounding circle is 
removed in the Agg version but not in the Cairo version.

There are also subtle differences such as in text positioning.  The 
colorbar in image_masked.py is an example of a case where the agg 
rendering is much better than the Cairo rendering, which has some sort 
of aliasing that causes stripes.  There are probably other such things 
worth pointing out.

For pdf output I have not tried to look at all the images, but the 
timing is Cairo 0.71 minutes, pdf backend 1.56 minutes.

I have also modified matplotlib.use() and the command-line parsing so 
that the "cairo.pdf" style of backend.output specification works in both 
places.  (Only for cairo--it is not needed for any other backend.)

I am not the right person to try to fix the bugs in the Cairo backend, 
but I hope it will indeed be moved forward.  It looks like it is close, 
and it could be a big asset for matplotlib in the longer term.

Eric

Steve Chaplin wrote:
> On Sat, 2007-01-06 at 09:23 -1000, Eric Firing wrote:
>> Steve,
>>
>> Darren Dale raised a question offline that I think will be of general 
>> interest to mpl devels, and that you are the person to answer:
>>
>> How do you see the future of a cairo backend as a prospective 
>> replacement for most or all of the primary mpl backends?
> I think cairo could potentially be used to replace the pdf, ps, svg
> and gdk/gtk backends which would unify most of the backends and simplify
> a lot of the code.
> 
>> What would need to be completed in cairo? Based on the cairo web page, I 
>> get the impression that quite a bit is still missing, including eps 
>> generation and genuine vector ps.  But maybe the web page is just out of 
>> date.
> Which web page is out of date? Where does it mention eps and ps, I
> couldn't find it.
> 
> My general impression of the cairo "surfaces" is:
> ImageSurface/png - support is very good
> gtk/xlib - support is very good
> ps/pdf/svg are usable but less mature and still developing so there may
>             be occasional problems drawing specific items
> ps - it used to embed bitmap images but now most output is vector based
> eps - is not supported yet, but may be in a future version
> 
>> What would need to be done in mpl, and how hard would it be?
> The cairo backend can already be used for png, ps, pdf and gtk output so
> I don't think there would be much to do. Mostly, it needs testing -
> running all the mpl examples and checking the output looks OK.
> 
>> Would mpl get slower if everything went through cairo?
> Not sure, you would need to run cairo and test it. It used to be much slower
> than Agg but more recent versions have had many optimisations applied and
> the difference is much smaller now.
> 
>> Any other considerations?
> Some parts of mpl are Agg-specific and other parts (the whole drawing model)
> are designed around the gdk drawing style - this makes things harder and
> inefficient when using cairo.
> 
> On Sat, 2007-01-06 at 09:36 -1000, Eric Firing wrote:
>> One more question: how does the image quality of cairo compare to
>> Agg? 
>> Is the antialiasing as good? 
> Image quality looks OK to me, but I'm no expert.
> 
> The web browser Firefox 3.0 (due to be released early in 2007) will use
> cairo for all rendering. Firefox requires a high level of graphics
> performance and the upcoming cairo 1.4 release is expected to provide
> that.
> 
> Steve
> 
> Send instant messages to your online friends http://au.messenger.yahoo.com 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to