Skip to content
Server-sideDeleted in 30 minutes

Extract the Images from a PDF

A PDF carries its photographs as separate objects inside the file. This pulls them out exactly as they were stored — the original pixels, not a re-render of the page they sit on — and shows you what is in there before you download anything.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free

What it does

  • The stored image, not a screenshot of the page
  • Soft masks filtered out, so nothing is listed twice
  • Every image previewed before you download it
  • Page number, dimensions and color space for each

How to use Extract Images from PDF

  1. 1

    Add the PDF

    Drop the file in. The document is scanned for embedded images and each one is previewed as it is found.

  2. 2

    Look at what is actually there

    Each card shows the page it came from, its real pixel dimensions and its color space — enough to tell a usable photograph from a 40px logo.

  3. 3

    Take the ones you want

    Download images one at a time, or all of them. Each is written as a PNG.

How it works

pdfimages walks the document's object graph, finds every raster it holds and writes each one out as a PNG. Nothing is rendered and nothing is re-compressed: the pixels handed back are the pixels that were stored.

What is actually inside a PDF

A PDF is not a picture of a document; it is a set of instructions for drawing one. Text is glyph references and coordinates. Lines and shapes are vector operators. And photographs are stored as separate objects — a JPEG, or a compressed raster — that the page instructions place at a position and size.

That last part is why this tool exists. The photograph in a PDF is usually larger than the page shows it. A 3000-pixel-wide image placed into a 4-inch column is still 3000 pixels wide in the file; the page just draws it small. Screenshotting the page gets you the small version. Extracting gets you the image.

Soft masks, and why other tools double-count

This is the detail that separates a working extractor from a confusing one.

When a PDF contains an image with transparency, the transparency is not stored inside the image. It is a second image — grayscale, same dimensions — that says how opaque each pixel is. The PDF specification calls it a soft mask, and poppler's inventory lists it as its own entry with the type smask.

An extractor that hands you every entry hands you every transparent photograph twice: the picture, and then a gray silhouette of it. On a test document with three pictures, the raw listing had six rows.

Only entries of type image are counted here. The download for each one still uses the original numbering underneath, because the masks occupy numbers even though they are never shown — counting positions in the filtered list instead would quietly return the wrong picture on any document that uses transparency.

When there is nothing to find

A well-made PDF from a word processor or a design tool often contains no images at all. The headings, body text, tables, rules and charts are all vector instructions. There is no photograph in the file because nobody put one there.

If that is your document, the tool says so rather than producing an empty folder, and points you at /pdf-to-jpg, which renders the pages themselves.

The opposite case is a scan, which is nothing but images — one full-page raster per page, usually grayscale, often large. Extraction there gives you the raw page scans without the PDF wrapper, which is exactly what you want if you are feeding them to something else.

Examples

A product catalog

catalog.pdf
24 PNG files

Photographs placed in a layout come back at the resolution they were placed at, which is usually far higher than the page shows.

A report with charts

report.pdf
nothing found

Charts drawn as vectors are not images, so an honest tool finds none. This one says so and points you at page rendering instead of returning a folder of blanks.

Frequently asked questions

How is this different from PDF to Images?

They answer different questions. /pdf-to-jpg renders each PAGE — text, lines, background and all — into a picture of that page. This returns the photographs that were embedded in the document, with nothing drawn over them and no loss from a second rendering pass. If you want the page as it looks, use that one. If you want the photograph that is on it, use this.

Why does another extractor show twice as many images as this?

Because it is counting soft masks. A PDF with transparency stores the alpha channel as a separate grayscale image next to the picture, and poppler's listing shows it as its own row. A tool that lists rows shows every transparent photograph twice, the second copy a meaningless gray silhouette. Only real images are counted here — measured on a test file, six rows for three pictures.

Will the images be as good as the originals?

They are the originals, byte for byte, as far as the pixels go. What was lost was lost when the document was made: if someone placed a JPEG that had already been compressed, that compression is baked in and no extractor can undo it. What you avoid here is a SECOND loss from re-rendering.

It found no images. Is it broken?

Probably not. Text, tables, charts and diagrams in a well-made PDF are vector drawing instructions, not pictures — there is genuinely nothing to extract. A scanned document is the opposite case and is almost entirely images, one per page.

Why PNG and not the original format?

PNG is lossless, so converting a stored JPEG to PNG loses nothing that was still there, and it handles the grayscale, indexed and CMYK-derived images that also live in PDFs without special cases. One predictable format that opens everywhere is worth more than guessing at six.