Which is the better image format for LaTeX?

latex has no control over this at all, it depends on the engine or driver you are using. For example tex+dvips can not include png, jpg or svg but can include bmp and eps; tex+dvipdfmx can include png and jpg (as well as pdf).; pdftex similarly can include png, jpg and pdf; as can luatex; xetex uses xdvipdfmx so can use the same graphics formats as tex+dvipdfmx.

Of the ones you mention png is good for general bitmaps, jpg for photographs and svg (which will usually be converted to pdf before inclusion) is good for scalable vector drawings, however those are features of the graphics formats so not really on topic here. Usually for scalable graphics people use eps (for latex+dvips) or pdf (for everything else)


It depends on the kind of images that you want to insert. Is it line art or photos?

Raster images (photos or scans)

While jpg uses lossy compression (you can usually decide which level) png uses lossless compression. You will have a higher quality using png the drawback is that in LaTeX usually png require more time to process see this question. So the general rule, not only restricted to LaTeX, is to use jpg for photos and png for images with text and lines that you could not vectorize (as shown below). The conversion of photos in .pdf is not always the best approach I would rather use a .jpg directly.

Vector images

Returning to LaTeX if you are using vectorized graphics there are some good alternatives to svg that can give you better results and freedom to edit the figure even after you have inserted in your document. The first alternative is to export the file in pdf, if you are using pdflatex it's usually the easiest choice, however, be aware that sometimes if you did not export the pdf well you might have some images or pieces of images that you can display in the viewer but are not printed in the final printed copy, so check always the results of the printed copy. It happened to me many times and can be very dangerous.

You can create vector images directly in .tikz or export them in .pgf, the drawback of this approach is that in a thesis, for example, the compilation time of multiple .tikz or .pgf figure could become very high. The good thing is that you can edit directly the test and sometimes the data that you are plotting. Be aware that also in this case you might experience errors in the printing so always double-check.

A good compromise might be to create a .pdf image with .tex file for the text, you can do it in Inkscape as in this answer. In this way, you have the possibility to have control over the text in your figure without penalizing to much the compilation time.

Tags:

Graphics