Why is a PDF containing just one image much bigger than the image itself?

I would like to embed a scanned document into a PDF document.

The source picture is about 300 kB.
If I use the convert command, the PDF has a size of 30 MB, and with GIMP, 3 MB.

Here the resulting file sizes of various commands. The only way I found to get a reasonable PDF file size is to first convert to JPEG, then to PDF.

scanimage -p --mode Color --format tiff -x 205 -y 297 > image.tiff      | 25.5
convert -quality 30  -compress Zip image.tiff image-zip.pdf             | 32.2
convert -quality 30   image.tiff image.pdf                              | 12.1
convert -compress Zip image.tiff image-wq-zip.pdf                       | 11.1

convert image.tiff image.jpg                                            | 2.3
convert -quality 30 image.tiff image.jpg                                | 0.34
convert -quality 30 -define jpeg:extent=200kb image.tiff image-200.jpg  | 0.19

convert image-200.jpg image-jpg.pdf                                     | 0.19

Solution 1:

If you have an image in JPEG format, you can go the following short way. Use the jpeg2ps wrapper to convert to PostScript. Then use ps2pdf to convert into PDF.