I am writing a report that includes a results section with a lot of generated images. These images are .png files. Judging by the file size of the resulting pdf, these images are included in their entirety, even when they are resized and clipped (trimmed).
An image of 4MB will increase the size of the resulting pdf by about 4MB, regardless of the fact that I only show half of the image and the image is greatly downscaled.
I'm using:
\includegraphics[keepaspectratio,%
width=0.5\linewidth,height=6cm,%
clip,trim=700 0 700 300]
{../results/img01.png}
In my case, this leads to a pdf that is over 100MB. How can I tell LaTeX to compress the images or discard the parts that are not shown?
I know I can print it afterwards with a pdf-printer and it will reduce the file size to about 20MB (which is a lot smaller than 100MB) but I would rather not have this intermediate step. Why can't pdfLaTeX reduce this file size too?
Since the report does not need full detail images, I guess even a lossy format like .jpg might suffice.
But I would like to hear if there are solutions, because next time I need something similar, I might not have this luxury.
– neXus Jun 16 '14 at 19:40pdflatexcannot directly modify the included image data. You must either pre-process the included png files or post-process the resulting pdf (one option: http://tex.stackexchange.com/a/19047/21344). – Paul Gessler Jun 16 '14 at 20:01