I'm writing my thesis and I need to insert a lot of screenshots and diagrams (which I'm building outside of LaTeX and saving as PNG to insert into the document). However sometimes my PNG images, both in pdflatex or using the Adobe Reader, are kind of distorted even when using 100% zoom, they are only crystal clear for zooms bigger than that.

My question here is, when printing the pdf document, will they appear with clear lines? As in, the bigger the resolution I use the images the better, even if it implies not looking good on the screen PDF viewer? I'm not used to these matters so I'm sorry if it's an easy answer question. Thank you in advance.

  • Welcome to TeX.SE by the way! :) – Alenanno May 16 '15 at 1:36

If you decide to use .png files in your document, it's fine, you could print some test pages to see the result, but remember that along with .jpg, these are raster images.

This means that they have a fixed number of pixels and may (will) lose quality when changing resolution, such as zooming in. So you might want to use bigger resolutions, enough for fitting within the page width.

Alternatively, you might want to include vector images. This is not an easy question, since it all depends on the type of images you're including. But my suggestion is this: some might be recreated in Latex itself using Tikz and/or pgfplots, such as the diagrams. This would be the best solution because you will be able to include the outputs directly in your pdf, which will be lossless (pdf is vectorial as well).

To expand my point about Tikz vs included graphics, I added an example below to show the difference. I created with an S in it using Tikz.

Then I took a screenshot of it, and included it, and later I also exported the original output (pdf) as png and included it. Then magnified both of them thanks to the spy library.

As you can see, while the first one doesn't lose quality, they both look bad when magnified but the exported one looks worse even when not magnified.

Taking a screenshot of it

enter image description here

Exporting pdf as png

enter image description here

  • Thank you for your help. But my question here was also for screenshots that I can't recreate using Tikz (which I can clearly see the benefits of using fo diagrams). If using that high resolution, when opening the pdf with only 100% zoom the image is almost unreadable, unless it is zoomed. Printing the page will not have this problem right, its related to the monitor/pdfviewer itsefl? – Random1 May 16 '15 at 13:14
  • @Random1 Would you be able to show an example of something that you cannot recreate with Latex (Tikz and any other package)? Maybe we can help on that. It might be a reader issue but it depends on the case really. In any case, you're much better off doing as much as you can internally. – Alenanno May 16 '15 at 13:41
  • Literally screenshots of some User Interface applications (for instance one application displays tables inside), I was not talking about diagrams only. The letters in the table, although readable, are not very clean (unless the pdf is zoomed until the original resolution i reckon) because the png had to be downscaled to fit the latex page. The print version of the page will still have this issue? – Random1 May 16 '15 at 16:18
  • @Random1 I'm not sure, but if I was you, I'd print some test pages to see how it comes out. – Alenanno May 16 '15 at 17:53

You should start by printing a test page with a few screenshots on it as they will appear in your final document. This will tell you if the images look good enough printed for your purposes.

In general, as long as you don't scale your screenshots, they should look just about as good as they can on paper. If you do need to scale a screenshot (e.g. shrink it so that it fits on the page), do this by changing the DPI of the image. A higher DPI will result in higher pixel density and a smaller image without sacrificing clarity.

For diagrams, if Tikz is too intimidating, you can export your diagrams to pdf or eps rather than png, avoiding the scaling problem. If you want tighter LaTeX integration (perhaps using the same fonts or even calling commands from within diagrams), then this question contains a wealth of figure-making GUIs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.