Can I get the original pictures out of a PDF without losing quality?

By the Osmanth team at Osmanth Docs · Published 2026-10-11 · Updated 2026-10-13

Often yes, for pictures stored in the PDF as images. In our test, a JPEG we embedded came back byte-for-byte identical, and a PNG logo came back with its transparent background intact, after we found and fixed a bug that had made it opaque. A bar chart drawn with vector lines was not an image at all, so it was exported as a rendered picture.

How does a PDF store a picture?

A PDF can hold a picture as an image object whose data is compressed with a filter. The PDF Association's notes on ISO 32000-2 name filters such as DCTDecode, JPXDecode, CCITTFaxDecode, JBIG2Decode and FlateDecode, and say what kind of sample data each delivers. A chart drawn with lines and shapes is different. Ours was made of line and rectangle drawing instructions, not an image, so there was no picture file inside the PDF to pull out.

That gives two kinds of result. A tool can take a stored image as it is, or it can render the page area into a new picture.

What did we test?

We made a one-page sample PDF with invented content. It holds a 640 by 480 JPEG photo, a 200 by 200 PNG logo with transparent corners, and a small bar chart drawn with lines and rectangles. We ran it through Extract Images on osmanthdocs.com, downloaded the three files it returned, and compared them with the originals.

Item in the PDF What came back Result
JPEG photo, 640 by 480 A 640 by 480 JPEG, marked as embedded Same SHA-256 hash as the original file: identical bytes
PNG logo, 200 by 200, transparent corners A 200 by 200 PNG, marked as embedded Same colours and same transparency as the original, after our fix (see below)
Bar chart drawn with vector shapes A 603 by 264 PNG, marked as rendered A picture of the chart; the line of text below it was used as its caption

The JPEG result is the best case. Because the stored data came out unchanged, nothing was re-compressed, so no quality was lost.

Did the PNG keep its transparency?

Not at first. In our first run, on 2026-10-11, the logo came back with every pixel opaque. Of its 40,000 pixels, 14,299 were transparent in the original and had turned opaque black, while every visible pixel was identical. The PNG format was not the cause: the PNG specification describes it as lossless, so a picture can be recovered exactly. The tool was dropping the transparency.

We fixed this on 2026-10-13. When we ran the same file through the live tool afterwards, the extracted PNG had the same 14,299 fully transparent pixels as the original, and no pixel differed in colour or in transparency. The fix keeps the extracted colours exactly as they were and adds only the transparency from the PDF, and only when the rendered picture agrees with those colours where the image is opaque. Otherwise the file is left as it was before. JPEGs are not touched.

Even so, if a logo needs a transparent background, open the extracted file and check its corners.

What about the chart?

A rendered picture is a snapshot of the page area at a fixed size, not the original data. Ours came out at 603 by 264 pixels. For a vector chart that is often what you want, but it is not the chart's real resolution, because a vector drawing has none. If you need to edit the chart, extracting images will not give you an editable file.

What should I check after extracting?

  • Compare the width and height of each picture with what you expect.
  • Look at the corners and backgrounds of logos and cut-outs for lost transparency.
  • Treat anything marked as rendered as a screenshot, not the original.
  • Count the pictures against the PDF: a drawing may be missing as an image because it was never one.

What happens to your file?

Your PDF is uploaded to our servers, where open-source software processes it. It is not sent to any third-party AI or document API. The uploaded PDF is deleted as soon as processing finishes, and the results stay for 60 minutes. Files can be up to 50 MB and 100 pages. The privacy page has the full wording. We did not test scanned PDFs for this guide.

Related: how to extract text from a scanned PDF.

Sources

  1. PDF Association: ISO 32000-2 clause 8 errata, on image objects and filters (page last modified 2026-01-16, checked 2026-10-11)
  2. W3C: Portable Network Graphics (PNG) Specification, Third Edition (Recommendation of 2025-06-24, checked 2026-10-11)

More guides