|
From: Peter D. <pc...@wi...> - 2007-09-14 06:28:21
|
I finally got around to implementing a quick and dirty cairopng hack
that Timothée intimated in March:*
diff -ru gnuplot-orig/term/cairo.trm gnuplot/term/cairo.trm
--- gnuplot-orig/term/cairo.trm 2007-09-13 23:12:53.000000000 -0700
+++ gnuplot/term/cairo.trm 2007-09-13 23:15:01.000000000 -0700
@@ -374,6 +374,7 @@
/* finish the page - cairo_destroy still has to be called for the whole documentation
* to be written */
+ cairo_surface_write_to_png(cairo_get_target(plot.cr), outstr);
cairo_show_page(plot.cr);
FPRINTF((stderr,"status =
%s\n",cairo_status_to_string(cairo_status(plot.cr))));
Problem is, it still produces a redundant PDF which gets truncated by
the PNG; how to go about suppressing the PDF output?
-----------
* http://sourceforge.net/mailarchive/message.php?msg_name=45F1A71F.6010506%40ens.fr
|
|
From: Peter D. <pc...@wi...> - 2007-09-15 02:18:21
Attachments:
gnuplot-4.2.3-cairopng.patch
|
> I finally got around to implementing a quick and dirty cairopng hack
> that Timothée intimated in March[.]
It turns out that hack was insufficient, among other things, for
multiplots; the attached patch implements multiplots as a successive
sequence of PNGs in the form <filename>-#.png.
The resultant PNGs can be composed with something like:
convert plot-0.png plot-1.png -composite plot-2.png -composite plot.png
Is there any advantage over the simple `convert plot.pdf plot.png'?
The image quality, above all, seems to be superior to the naive
conversion.
|
|
From: Peter D. <pc...@wi...> - 2007-09-16 00:37:04
Attachments:
gnuplot-4.2.3-cairopng.patch
|
> It turns out that hack was insufficient, among other things, for > multiplots[.] The attached patch works for multiplots without requiring post-processing; it still piggybacks, however, on the cairopdf terminal. |
|
From: Peter D. <pc...@wi...> - 2007-09-16 02:40:21
Attachments:
gnuplot-4.3-cairopng.patch
|
> [I]t still piggybacks, however, on the cairopdf terminal.
I broke down and created a bona fide cairopng terminal based on
Timothee's cairopdf with trivial enhancements; it can be used with:
set terminal cairopng
I also submitted it to sourceforge.*
-----------
* http://sourceforge.net/tracker/index.php?func=detail&aid=1795644&group_id=2055&atid=302055
|
|
From: <tim...@en...> - 2007-09-21 22:31:37
|
Peter Danenberg wrote: >> [I]t still piggybacks, however, on the cairopdf terminal. >> > > I broke down and created a bona fide cairopng terminal based on > Timothee's cairopdf with trivial enhancements; it can be used with: > > set terminal cairopng > > I also submitted it to sourceforge.* > > Hi Peter ! I'm happy to see you working on this, and having success in adapting cairopdf to write png. It's a good proof that the cairopdf terminal is to some extent understandable ;) and that cairo itself is well designed since few modifications were required. Here are a few remarks: - first, if it is agreed to included this cairopng terminal, we should make our best to share the code between the various cairo* terminals (pdf and png currently, but it could be svg and ps too). At least the help text, which is also shared with wxt, and maybe more of the code. - second, the most obvious advantage of this terminal is its antialiasing, which gd doesn't have at the same level. Does this mean that cairopng could be made the default 'png' terminal ? - third, maybe it's time to talk with gd people, who have been talking about interfacing gd and cairo, so that we could draw with cairo and export to as many format as gd supports. Best regards, Timothée |
|
From: Peter D. <pc...@wi...> - 2007-09-23 14:56:21
|
> [W]e should make our best to share the code between the various cairo* > terminals . . . That occured to me, too; it should be possible to abstract a set of utilities that accept, say, a cairo_surface_t and a render-function (like cairo_surface_write_to_png). > Does this mean that cairopng could be made the default 'png' > terminal? Ideally, it will act as a drop-in replacement. > [M]aybe it's time to talk with gd people, who have been > talking about interfacing gd and cairo . . . Do you have a link, by any chance? |