Fanning Software Consulting

Blurred PostScript Output

QUESTION: I have a fairly low-resolution image and I want it to be displayed as individual square pixels. I have no problem doing this with the IDL image display routines IMDISP or TVImage. The image looks great. But when I create PostScript output of the same image and view it with on my Macintosh computer, the image is blurred or smoothed, as if the image had been interpolated between the individual pixel values. The image below gives you some idea of what I mean. What am I doing wrong?

Interpolated image output.
What I expect on the left, and what I see when I view PostScript output on the right.

ANSWER: You are doing nothing wrong. The problem is the you are using to view the PostScript file. This application first converts the PostScript file output to a PDF file that is actually viewed. is doing this conversion incorrectly and is, in fact, interpolating this image in the conversion process. You can see this is true by opening the PostScript file in some other application, say Illustrator, Gimp, Photoshop Elements, or GhostView. Or, you can do the conversion to a PDF file with some other application, such as ImageMagick or Acrobat Distiller.

Other Mac users have suggested using the free epstopdf program, which comes with the Latex/Texlive distributions. Note that this is different from the similarly named eps2pdf program, which doesn't work quite as well on all Unix distributions.

Version of IDL used to prepare this article: IDL 7.0.3.

Web Coyote's Guide to IDL Programming