[Tex/LaTex] Selecting best file extension for graphics figures pictures

graphics

So, lets say I have the chance to choose which file extension I want for my figure/graphic/picture that I want to include in my work.

I went over How do I insert an image in LaTeX so it looks good on print?, but I wanted to know if this still applies for nowadays, and specially if given the chance to select the extension at the source… and if this also applies for electronic pdf documents (i.e., not printed)

Which one should I choose that brings the best results?

PS: This question has very nice complementary information:

Which graphics formats can be included in documents processed by latex or pdflatex?

Best Answer

This is what I recommend:

  • Choose PDF format for drawings and material that is already vectorised (typical diagrams and simple drawings)
  • Choose PNG for anything which is not vectorised but has fine details that should be exactly reproduced such as screenshots (it's looseless and therefore no artifacts will appear)
  • for pictures/photos choose JPEG

I work with pdflatex.

Examples

Here's a photo. As JPEG it is about 140 KB and as PNG it is about 1200 KB. You cant't tell the difference:

JPEG enter image description here

PNG enter image description here

The next picture is a screenshot. As PNG it is clear - every pixel is exactly correct. The PNG size is 41 KB. The JPEG (I used a high compression obviously) is only 10 KB but you get artifacts. A PNG file will not loose information unless you change the resolution.

PNG enter image description here

JPEG (high compression) enter image description here