I can see the issue that Ewart is referring to as regards "jaggedness"
of lines (especially patterned ones). 
It is actually more apparent when the PDF is created on a smaller
canvas. 

I suspect a contributing factor is that the x & y coordinates of a point
on the canvas are represented as an integer (rather than floating
point). At small canvas sizes the rounding to integer will create more
of an "error" and therefore more noticeable "jaggedness". A patterned
line is drawn as many short lines, each with starting and ending xy
coordinates for rendering. This results in more rounding errors than for
a solid line.

Compare the results of the following two PDFs.

load 'plot' 
dat=. (;(sin+cos),sin,cos,([EMAIL PROTECTED]:),:cos&+:) steps 0 4 50
pd'new'
pd 'penstyle 0 1 2 3 4'
pd 'pensize 2'
pd 'color green,red,blue,magenta,brown'
pd 'title Line Patterns'
pd dat


pd 'pdf 300 200 plotjag1.pdf'  
pd 'pdf 3000 2000 plotjag2.pdf'


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Fraser Jackson
> Sent: Friday, 26 October 2007 08:53
> To: Programming forum
> Subject: Re: [Jprogramming] High quality graphics files (& glfile)
> 
> I am not sure I understand exactly the problem you are having.
> 
> I have used EMF files for transferring graphical output from 
> the plot package and they seem to scale well and not have 
> unexpected jaggedness even for large print sizes.  They seem 
> to work fine in both J601 and J602a  using pd 'save emf filename.emf'
> 
> For other line graphics the turtle geometry lab uses the 
> gdemf function and that also seems to work though I have had 
> some problems with line size.  See the help''  in that lab.
> 
> Fraser
> 
> ----- Original Message -----
> From: "Shaw, Ewart" <[EMAIL PROTECTED]>
> To: "Programming forum" <[email protected]>
> Sent: Friday, October 26, 2007 12:31 AM
> Subject: RE: [Jprogramming] High quality graphics files (& glfile)
> 
> 
> Thanks Oleg.
> I prefer vector graphics on principle.  The lines are 
> typically not fine,
> but must be accurately placed - by "jaggedness" I mean that if (e.g.)
> you store the 2D-LinePatterns plot as EPS or PDF and magnify 
> the result,
> you'll find the individual line segments don't lie on smooth curves.
> Similarly for EMFs - see my reply to Devon McCormick.
> 
> I can continue using bitmaps with roll-my-own algorithms.  In 
> particular,
> my dashed and dotted lines use cumulative arc length to 
> assign individual
> segments, and look much better than most readily available 
> alternatives.
> The final PNG files aren't excessively big, and I haven't yet needed
> very fine pens + anti-aliasing.  I'll report back eventually.
> 
> I still hope to investigate EMFs, if I can get glfile (or its 
> equivalent)
> to work.
> 
> J.E.H.Shaw      http://www.warwick.ac.uk/statsdept
> Ewart Shaw      http://www.ewartshaw.co.uk
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] on behalf of Oleg Kobchenko
> Sent: Wed 24/10/2007 23:54
> To: Programming forum
> Subject: Re: [Jprogramming] High quality graphics files (& glfile)
> 
> Could it be clarified what is needed
>  - high resolution bitmap graphics (BMP, not EPS) OR
>  - vector graphics (EPS or PDF) with fine lines
> ? And what exactly is jaggedness?
> 
> For the fine vector graphics for example, in the Demo page
> Studio|Demos|plot|2D-LinePatterns set
>   pd 'pensize 0.001'
> then save to EPS (Options|Save EPS) and it will produce
> very thin lines.
> 
> For bitmap graphics, you can roll your own antialiasing:
>  - pd 'pensize 2' use thick lines
>  - and 'save bmp [file] [w h]' i.e. huge w h
>  - resize 0.25 or so times with nice resampling like Lanczos.
> which will produce thin and smooth lines.
> 
> Would you be looking for bitmap renderer that produces
> antialiased output by itself like GDI+/Cairo/Quartz/Java2D?
> ....
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm 
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to