pdf-extract-embedded-images
Skill21 starsChanged 7 days agoMITView on GitHub
Extract embedded JPEG and PNG images from a PDF at their native resolution, without rasterizing. Use when a PDF is primarily a wrapper around photos or images and you want to recover them at full quality without the page rendering overhead.
- Installs packages
In this repository28 other files it gives its agents.
- ai-graphicsSkill
- auto-deskewSkill
- auto-toneSkill
- auto-white-balanceSkill
- batch-set-copyrightSkill
- check-model-pricingSkill
- convert-to-avifSkill
- fast-resizeSkill
- fast-thumbnailSkill
- from-jxlSkill
- images-to-pdfSkill
- install-depsSkill
- new-projectSkill
- new-workflowSkill
- open-workspaceSkill
- optimize-jpegSkill
- optimize-pngSkill
- pdf-to-imagesSkill
- read-metadataSkill
- scrub-metadataSkill
- set-metadataSkill
- svg-to-rasterSkill
- to-jxlSkill
- transcode-jpeg-to-jxl-losslessSkill
- upscale-imageSkill
- vectorizeSkill
- web-readySkill
- workspace-setupSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
Naming collision: If multiple images have the same name, pdfimages appends sequential suffixes (e.g., prefix-000.jpg, prefix-001.jpg).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract Embedded Images from PDF
Pull out JPEG and PNG objects embedded in a PDF using pdfimages. Extracts at native resolution without rasterizing the page. Different from pdf-to-images — this recovers the original embedded image files, not a rasterized page render.
When to use
- A PDF is a container for photos (e.g., a photo book or brochure) — you want the original images, not a rasterized version.
- Bulk-extracting image assets from a multi-page document without re-encoding.
- Recovering embedded images at their full embedded resolution and quality.
Inputs to gather
- Input PDF file — path to the PDF. Required.
- Output directory — optional. Default: current directory.
Procedure
1. Check tooling
command -v pdfimages || echo "pdfimages not installed — install with: sudo apt install poppler-utils"Abort if missing.
2. Validate PDF and inspect contents
file "<input.pdf>"
pdfimages -list "<input.pdf>"The -list flag shows a summary of embedded images: page number, index, width, height, bits per component, color space, encoding. This helps set expectations (e.g., "3 JPEG images at 2400×3000px").
3. Extract
pdfimages -all "<input.pdf>" "<output-prefix>"The -all flag extracts both the raw image stream (if JPEG, as .jpg; if PNG, as .png, etc.) plus any alternate-format versions.
Alternatives:
-j— extract JPEG objects only (faster if there are many PNG/PNG variants).-png— convert all images to PNG (may re-encode non-JPEG content; slower but lossy compression converted to lossless).
Recommend -all unless the user specifies otherwise.
4. Report
After extraction:
- Count of images extracted, by type (JPEG, PNG, etc.).
- Output filenames and their dimensions.
- File sizes and whether any extraction failed.
- Remind the user that embedded images may have compression applied by the PDF creator — they are not necessarily at absolute maximum quality, but they are at their native resolution.
Output / side effects
- Image files created with names like
prefix-000.jpg,prefix-001.png, etc. (depends on PDF content). - Original PDF unchanged.
Notes
- Native resolution, not PDF rendering resolution:
pdfimagesextracts the raw embedded objects at the resolution they were embedded, not the page rendering resolution. For a photo book PDF with 2400×3000px JPEGs embedded, you get those 2400×3000px files directly — much faster and lossless compared to rasterizing the 8.5"×11" page at 300 DPI. - Lossy source warning: Even though
pdfimagesdoes not re-encode, the original embedded images may already be JPEG-compressed by the PDF creator. You cannot recover quality that was lost before embedding. Check output sizes and quality to verify. - PNG and other formats:
pdfimagespreserves PNG, TIFF, and other formats within the PDF. The-allflag ensures you get them all. The-pngflag is useful if you want everything as PNG but will re-encode and potentially change file size. - Naming collision: If multiple images have the same name,
pdfimagesappends sequential suffixes (e.g.,prefix-000.jpg,prefix-001.jpg). No files are overwritten. - Depends:
apt install poppler-utils.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

