3

Many scanners can scan a page into a PDF file.

When this is done, is the PDF file really just a container that contains a single image? Is that image typically a JPG image, a PDF image, or a proprietary format?

  • I really hope your scanner does not produce JPEG, because that's about the worst format you can use for scans, because of the artefacts it creates. But that's part of the scanner software. … If I remember correctly, it is a PDF image, using the specified compression. When you try to interpret the PDF, you will get the necessary information, as well as metadata. – Max Wyss Mar 13 '16 at 8:28
  • @MaxWyss - While JPG does create artifacts JPG is actually often a worthwhile tradeoff and can often create quite useable documents of a smaller size then a GIF/PNG while still conveying the content. That said, I would not use it for a spreadsheet with very small font characters as this can cause issues - dkriesel.com/en/blog/2013/… – davidgo Mar 13 '16 at 19:54
3

According to this link, no - PDF rips apart the image and recreates it - sometimes using the JPEG or JPEG2000 encoding.

A PDF file usually stores an image as a separate object (an XObject) which contains the raw binary data for the image.

It is important to appreciate that this is not usually an image in the sense of a Tif or a Jpg or a Png image – it is the binary data for the pixels, the colorspace used for the image, information about the Image. The image is ripped apart when the PDF is created and different PDF creation tools may store the same image in very different ways.

Sometimes the raw image data is adjusted to the required size needed for the page and sometimes it is not – in that case it is scaled up or down when it is drawn – different PDF creation tools create PDF files in very different ways.

The actual pixel data can be compressed and one of the compression formats (DCTDecode) is the same used as in a JPEG (JPX is the same as Jpeg2000). If you save this data, it can be opened as a JPEG file, but it may need altering to include the colorspace data.

This image is then drawn in the PDF contents stream... Some things which appear as an image to the eye may also be made up of multiple images or not even images at all!

All this means that if you want to extract images from a PDF, you need to assemble the image from all the raw data – it is not stored as a complete image file you can just rip out.

  • Scanners will most likely not have JPEG2000 or anything the like built-in. So it’s relatively safe to assume it’s plain JPEG. That’s also what my Ricoh MFP does. – Daniel B Mar 14 '16 at 20:53
  • Which tool creates pdf files with jpeg2000 image compression? – erik Mar 14 '16 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.