[Thread Prev][Thread Next][Index]

Re: [ferret_users] Odd lines on postscript with fill command

Hi Ferreters,

For a quick recipe, please skip to the end of this message,
because a rather detailed discussion follows.

| I checked back and here is the proposed solution. Note that this
| helps with rendering of ps (and eps, I think) files but I am not
| sure if it will help with the pdf. If you open .ps file in ggv, go
| to  Edit->Poscscript Viewer Preferences and unckeck the 
| antialiasing box. The lines *should* disappear.

Yes.  It's due to anti-aliasing.  Various PS and PDF viewers
have options to switch it on and off.   For Adobe Reader,

  Edit > Preferences > Page Display > Smooth line art

"Smooth line art" is what anti-aliasing is (for vector graphics).

But, switching off the anti-aliasing option does NOT change the
graphics file your are viewing.  You might think that switching it
off and saving it as a different file will make the change permanent
but that's not the case.  So, if you give your PDF file to somebody
else, that person will have the same problem, because anti-aliasing
is often on by default.

The issue is that

1) how the file is rendered on the screen or on print-outs, and
2) what data the file contains

are two different things.  The anti-aliasing options of viewers
control aspect (1) only.

So, how to avoid the problem altogether?  How to change the file
so that anti-aliasing won't affect the result of rendering?

As Billy explained, a painted region is a collection of polygons.
In the DATA of the file, two neighboring polygons of the same
color exactly share an edge, so that you shouldn't see a gap
(the thin white line) there.  But, anti-aliasing smoothes sharp
edges of individual polygons, to blend the edges smoothly into
the background color.  As a result, the outer edges of each
polygon gain a slight whitish tint.

So, to void the problem, I can think of two options:

A) Fuse neighboring polygons of the same color;
B) Convert the original PS or PDF file to a non-vector
  format without anti-aliasing.

I've never tested option (A) but if you have a good PS editor
like Adobe Illustrator, you'll be able to do it, although
that can be arduous, depending on the complexity of the graphics.

So, I use option (B).  You can convert your PS or PDF file into
PNG, for example.  (I don't recommend JPEG.)  When you do so,
you need to switch off the anti-aliasing option; otherwise, the
white lines would become a permanent part of the result!

For example, the "convert" command in the Imagemagick
package can be used:

  $ convert -density 300 +antialias yourfig.pdf  yourfig.png

(confusingly, "-antialias" means "use antialias" because
a minus symbol indicates the beginning of an option.
"density" specifies DPI, I think.)

Hope this helps.


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement