# My pixel perfect picture gets blurry when compiled in LaTex

Here's my problem.

I have this picture: http://dl.dropbox.com/u/3394117/Temp/fig1.png (I have the original in Pixen and could export it to several different formats. I went with png though since it's lossless.)

Anyhow. When I open my picture in Preview (OS X) and zoom in, it looks fine. The characters have extremely sharp boarders between them and the background. However, when I put it into my latex document, compile it to a pdf (using TexShop) and then zoom in, it suddenly have gotten blurry (see screenshot: http://dl.dropbox.com/u/3394117/Temp/Screen%20shot%202011-02-13%20at%2012.46.30.png).

Minimal working example:

\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[scale=1]{fig1.png}
\end{document}


In the end, I would like to be able to scale the picture freely without there being any blurring at all.

Does anybody have any solution to my problem?

-
–  Stefan Kottwitz Feb 13 '11 at 13:18
Dan: The screenshot works now. Thank you for pointing that out. –  Speldosa Feb 13 '11 at 15:43
Stefan: Thank you for those links. I will check them out. –  Speldosa Feb 13 '11 at 15:44

## migrated from stackoverflow.comFeb 13 '11 at 13:12

This question came from our site for professional and enthusiast programmers.

Ok. I got it to work now. It was ugly but it works.

What I did was the following. I zoomed in on the picture in Pixen so that it covered my entire screen. I then took a screenshot, imported it into Pixelmator and exported it as a png-file.

Now it looks great! It's not until you zoom in really, really far that you notice the blurring.

It would be neat to be able to zoom without getting any blurring at all. Maybe I should do vector pixel art next time (I'll see if InkScape can fulfill my needs).

-
Isn’t Jake’s answer more apt? I.e. disable the smoothing setting in your PDF viewer? –  Konrad Rudolph Feb 13 '11 at 14:23
@Konrad: Well, if you send the pdf file to someone else, they might be rather annoyed if they're told to change viewer settings for best onscreen viewing. –  Hendrik Vogt Feb 13 '11 at 14:34
@Hendrik True, but this is a limitation (and, in my opinion, plainly a bug) in the viewing software and this workaround may not work as expected in some other viewers. In fact, the fact that this workaround works at all is probably also a bug that may get fixed some time in the future. –  Konrad Rudolph Feb 13 '11 at 14:50
That will definitely help if you have to keep using a raster format -- you can always scale them down to fit the available size without losing visible quality. –  Mike Renfro Feb 13 '11 at 15:26
I still don't see why my solution wouldn't always work. What I've done is to effectively heightened the resolution of my picture so that it, when it is presented as a smaller image, will be able to show the picture without blurring. If I however send my PDF to someone else and this person don't know how to goof around with the PDF reader, then I'm pretty much screwed. –  Speldosa Aug 3 '11 at 15:13

This is just an effect of the display settings of your PDF viewer. In Acrobat Reader 9, for example, there is an option "Edit | Preferences | Page Display | Smooth images". If you uncheck this box, the picture will not be anti-aliased. When printing, your image should look fine regardless of the smoothing effect you see on screen.

Here's your file in Acrobat Reader 9, zoomed to 800%, left half with the default "Smooth images", right half with the option unchecked. Note the tick mark and the red X:

-
OMG! :) Well that exaplains a lot. Still I'm using PDF to actually be able to control how everybody else sees my content. Nice to know that the print wouldn't be affected anyway. –  Speldosa Feb 13 '11 at 15:41
I was now asking on comp.text.tex about a pdftex or PDF setting which can be used in the document to tell the PDF viewer not to use anti-aliasing. –  Martin Scharrer May 17 '11 at 21:59