Extract images from PDF files
Solved Email & Outlook
BA
Barry Allen
November 24, 2020
2 replies
8,180 views
Reviewed by moderators

I need the images out of some PDFs, the actual embedded photos and graphics at full quality, not screenshots of the pages.

What extracts the real embedded images from a PDF?

Accepted Answer
Verified by Eddie Thwan, Forum Moderator ยท Reviewed November 2020

The full quality, not screenshots distinction is the key requirement, because it separates real extraction, pulling the embedded image data out intact, from rasterizing pages, which degrades. The routes that do it right:

Adobe Acrobat, the direct route: Export To, Image or the Extract feature and specifically Acrobat can export all images, pulling the embedded image files at their original resolution rather than rendering pages. This is real extraction, the images come out as they went in.

The scripted route, most control and free: a short Python script with pymupdf, also called fitz, iterates the PDF's pages, finds embedded image objects and writes each out in its original format and resolution, a dozen lines that extract genuine embedded images rather than page renders. pymupdf specifically pulls the image XObjects, the actual stored images, which is exactly the full quality extraction you want and it handles a folder of PDFs in a loop for bulk.

The free tool route: tools like the pdfimages utility from the Poppler suite extract embedded images from a command line, pdfimages -all file.pdf prefix writing every embedded image in its native format, purpose built for exactly this and preserving the original image data.

The distinction that catches people: page rendering versus image extraction. Taking a screenshot or exporting pages to images gives you the whole page rasterized, including text, at whatever resolution you rendered, degrading the embedded photos. Real image extraction, pdfimages and pymupdf's image object approach, pulls the stored images out untouched at their embedded resolution, which for a high resolution photo in the PDF is far better than any page render. When quality matters, insist on the extraction route over the render route, which is precisely your full quality not screenshots requirement.

pdfimages -all pulled the embedded photos at their full original resolution, exactly the real extraction versus page render distinction you drew. My earlier attempts had been rendering pages and wondering why the photos looked soft. Native embedded images are gorgeous. Command line tool was perfect for the batch.