An image that looks fine on a PDF page may be too low-resolution to reuse in print or on a website. Extracting the embedded images and checking their pixel dimensions against the size they are printed at shows which ones are fit to reuse.
What you need
- poppler-utils installed, which provides pdfimages
- A PDF with embedded images
- A terminal
- An image viewer that reports pixel dimensions
Step 1: List the images with their rendered resolution
Run pdfimages -list file.pdf and read the width, height, and x-ppi and y-ppi columns for each image, which give its pixel size and its resolution as rendered on the page.
Step 2: Extract the images you want to reuse
Run pdfimages -all file.pdf img to save the images in their native formats, keeping the image numbers from the listing so you know which file came from which page.
Step 3: Check each extracted image against its reuse target
Open each extracted image and compare its pixel dimensions with the size you need. An image printed at 300 ppi but only 72 ppi in the file will look blurred when reused at the same size.
Worked example: synthetic image extraction check on a 10-page report
The table below is a synthetic example. It shows the expected result of the resolution check; no extraction was run.
| Image | Pixels | Rendered ppi |
|---|---|---|
| img-000.jpg | 2400 x 1800 | 300, fit to reuse |
| img-001.jpg | 600 x 400 | 72, too low |
| img-002.png | 1800 x 1200 | 300, fit to reuse |
| Total | 3 images | 1 too low to reuse |
Expected result (UNTESTED). two images are high enough resolution to reuse, but the second image renders at 72 ppi and would look blurred if reused at the same size. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- pdfimages extracts the image as stored, which may differ from how it appears after scaling on the page.
- An image and its mask are listed separately, so a transparent image produces two files.
- Extracting an image does not transfer its copyright; check the licence before reuse.
