I have a LaTeX file (compiled with pdflatex
) with some images in pdf added via the \includegraphics
command. The problem is that the images are really big (up to 10MB) and the output file is too large (more than 30MB).
The images have been obtained via the splot
command in gnuplot
but there are a lot of points in the splot.
I have tried to get the images in other formats (.jpg
, .png
basically) since the file size is considerably lower and thus the size of my resulting .pdf
is also lower. But when I include this files in my LaTeX document the images lose a lot of quality (even though they have OK quality when viewed separately).
How could I get a small pdf file from pdflatex
without sacrificing too much quality on the images? I suppose that the problem lies in resizing the image from the pdf-latex but can't solve it. Or in other words, how can I obtain smaller .pdf
images (or other format accepted by pdflatex
) without losing too much quality when added to the pdf file?
The LaTeX command is \includegraphics[width=7cm]{file.pdf}
. Note that I have to resize them to fit 7cm width.
EDIT:
I add 4 files (original images in .pdf
, .png
and .jpeg
and resulting pdf
file compiled with pdflatex
. Here's the latex code too.
\documentclass[a4paper,10pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=7cm]{numeric.pdf}
\caption{Pdf file.}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=7cm]{numeric.png}
\caption{Png file.}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=7cm]{numeric.jpeg}
\caption{Jpeg file.}
\end{figure}
\end{document}
pdflatex
, even when scaling, there is no loss of information.pdflatex
doesn't alter the image in any way. What you're describing is most likely an issue with your PDF viewer. If you print the document, you should find that the quality is the same as in the original image file.pdflatex
can't do anything about it, but including the image usingpdflatex
will not degrade the quality in any way.set terminal pngcairo size 4000,2500 font ",90" lw 10
(note that there is no option to specify the resolution directly, unfortunately, so you'll need to take care of scaling the line widths and font size manually).