Viewing Postscript (or PDF) on OS X: Aliasing issues

4

2

I am generating postscript graphics and am trying to find a balance between non-aliasing and over-aliasing.

If I use the raw ghostscript viewer gs on the Postscript, it looks good. The text appears anti-aliased, but the image remains nice and blocky. Unfortunately, gs has no real user interface and loses all of the nice things that Preview.app has. I could install gv, but the dependency bloat is huge! It requires all of gnome. And even that isn't a great viewer compared to Preview.app or Skim.app. Here is an image viewed with gs:

PS viewed with GS

From a user-interaction and Mac-ish perspective, Preview.app (or Skim.app is a much nicer program to use. They have the option to turn on or off aliasing, but neither option looks very good. Which aliasing on, the image is blurry. When it is off, the graphic matches what is seen from gs, but there are two issues. Note that the screenshots below are of the PDF produced by Preview/Skim

PDF with aliasing PDF without aliasing

  • Minor issue: the font is ugly. Uglier than with gs.
  • Major issue: Every PDF is un-aliased, making it hard to read regular PDFs full of text.

So, in summary:

  • Is there a way to manually generate the PDF from the PS that overcomes these issues?
  • Is there a way to find a middle ground of alias/unalias with Preview.app?
  • Is there another app that displays with quality like gs, but has a decent UI like Skim.app or Preview.app
  • Is there a way to have Preview.app turn off aliasing for only one file (containing graphics) but leave it enabled in general so that text PDFs are still readable?

user31752

Posted 2011-02-16T22:57:16.310

Reputation:

Could you provide the ps file? The blurring looks quite extreme, like every block is 3x1 pixels or something like that, zoomed. Maybe it'll look better with 30x10? – Daniel Beck – 2011-02-17T05:12:21.480

Each block is a pixel, in that I am displaying a 10x10 matrix, but instructing the display code to fill an 8.5x11 inch page. I could re-sample my matrix, but that seems like a hack, requires code change, increases file size, etc. To clarify (edited above), the PS works and looks good, aliased or not, in gv. The blurry is when it is viewed as a PDF. – None – 2011-02-17T07:32:02.323

Answers

2

I don't think it's possible in Preview. It's a single option, PVPDFAntiAliasOption in Preview's defaults.

As a workaround, you can create an Automator service or application that does this:

  • (Service receives selected files and folders in any application)
  • Set Value of Variable, name it "Files"
  • Quit application Preview
  • Run shell script defaults write com.apple.Preview PVPDFAntiAliasOption 0
  • Get Value of variable, "Files"
  • Open Images in Preview (this also works with PDFs)
  • Run shell script defaults write com.apple.Preview PVPDFAntiAliasOption 1

Unfortunately, Preview only reads the preference when launching, not in between, therefore the Quit application.

Daniel Beck

Posted 2011-02-16T22:57:16.310

Reputation: 98 421