From: Alan W. I. <ir...@be...> - 2004-11-18 00:16:52
|
On 2004-11-17 14:34-0700 Curtis Cooper wrote: > There's still a problem related to this, however, which arises when trying > to rasterize the PS file output from PLplot. This is useful when making > presentations, posters, etc. For the conference I just returned from, I > used CorelDRAW to make the poster because it handily imports EPS files. > When I rasterized the whole poster, however, the streaks across the page > appeared, just as you see when you look at it in gv with antialiasing > turned on. Similarly, when you use ImageMagick's convert program to go > from PS to PNG or JPEG, the artifacts are visible. I suggest you turn off anti-aliasing for convert (use the +antialias option to turn off the default anti-aliasing in the convert programme.) > > I have made similar image plots in IDL that don't manifest this problem > when they are saved as PS files, so I'm pretty sure it has something to do > with how the PS driver in PLplot is implemented. Any further suggestions > would be much appreciated. I suspect the post-script anti-aliasing is being implemented using variable transparency. Anyhow, it is clear if you look at high-res, what is happening is part of the background or some other hidden part of the plot is leaking through when anti-aliasing is turned on, and there are no such problems when it is turned off. Bill Paxton (one of our users who is something of a postscript expert) has suggested this really is the fault of the antialiasing code associated with postscript converters or viewers. To work around that problem he suggested the following brute-force change. --- ps.c Sat Sep 11 13:46:51 2004 +++ ps_mod.c Sat Sep 11 13:46:28 2004 @@ -296,7 +296,8 @@ fprintf(OF, "/A {0.5 0 360 arc} def\n"); fprintf(OF, "/S {stroke} def\n"); fprintf(OF, "/Z {stroke newpath} def\n"); - fprintf(OF, "/F {fill} def\n"); + fprintf(OF, "/F {gsave 3 setlinewidth stroke grestore fill} bind def\n"); + /*fprintf(OF, "/F {fill} def\n");*/ fprintf(OF, "/C {setrgbcolor} def\n"); fprintf(OF, "/G {setgray} def\n"); fprintf(OF, "/W {setlinewidth} def\n"); I don't understand postscript, but just from the name of the setlinewidth command he is inserting it looks like he is increasing the line width for fills. Anyhow, this did seem to work to get rid of artifacts in example 16 when antialiasing is turned on, and, Curtis, you may want to give this patch a try for your particular problem. OTOH, this patch severely magnifies the surface contour problem (see example 8, pages 4 and 8 for examples). The surface contours are done on top of their associated filled triangles which is a neat trick to hide those surface contours whenever the associated triangle is hidden. However, the contour associated with a given triangle may have its ends slightly misaligned from the triangle edges, and the result is a semi-broken looking surface contour. (I made one unsuccessful attempt to fix this problem, and it is still on my agenda to have another go at fixing this.) Anyhow, Bill's patch above makes this already bad situation much worse (presumably because the extra line width for fills is overlapping (and therefore hiding) parts of adjacent triangles and their associated surface contours). Personally, I think instead of using the above patch and accepting the bad surface contours as a result, it is just easier to avoid antialiasing corrections for viewers or postscript converters (once you are aware of the issue). Of course without antialiasing the labels on the plot won't look as good on screen, but this is not an issue if you are printing the postscript file for a poster rather than just viewing it on screen. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |