|
From: Ethan A M. <merritt@u.washington.edu> - 2007-11-16 02:45:19
|
On Thursday 15 November 2007 18:09, Allin Cottrell wrote: > Could anyone tell me, under what precise conditions do we get > anti-aliasing of (width 1) lines in PNG plots? (With the > libgd-based driver, that is.) Gnuplot asks for anti-aliased lines if and only if the linewidth is 1. After that it's up to libgd. The somewhat out-of-date libgd documentation says: Antialiased lines can be drawn on both truecolor and palette-based images. However, attempts to draw antialiased lines on highly complex palette-based backgrounds may not give satisfactory results, due to the limited number of colors available in the palette. Antialiased line-drawing on simple backgrounds should work well with palette-based images; otherwise create or fetch a truecolor image instead. I can't think of any reason there would be a difference between MSWin and linux, only between different versions of libgd. Ethan > I ask because (a) on Linux I'm using reasonably current CVS > gnuplot with the latest libgd release, but I've never seen > anti-aliasing of lines in PNG output, while (b) with a similar > setup on Windows PNG output seems to be anti-aliased by default. > > I've just recently twigged to the fact that you can get > anti-aliasing in PNG output on Linux if you add the "truecolor" > flag to the invocation of the png terminal. Somehow, though, this > flag does not seem to be required to get anti-aliasing on Windows. > Is this a libgd quirk, perhaps? > > The motivation for this question is, in part, that I'd like to be > able to choose between AA and non-AA PNG output in a > platform-independent manner. Sometimes AA can be nice: it reduces > the artifacts you get on certain line segments when plotting "with > lines". On the other hand, AA looks kinda funny when applied to > the straight lines that border a plot: they just become "fuzzy". > So if a plot is mostly straight lines (e.g. "with impulses"), > having AA turned off would be preferable. > -- Ethan A Merritt |