Cut Photos Out of Scanned PDF Pages
Extract Image Scans finds each photo or document lying on a scanned PDF page, straightens it if tilted, and saves it as its own PNG. Several results come back as a ZIP; nothing found returns no file.
Drag and drop files here, or click to choose
Accepts PDF · up to 500.0 MB per file · up to 20 files at once
You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.
Extract Image Scans finds the photos and documents lying on scanned pages and saves each one as its own PNG. It is for pages that came off a flatbed scanner with several photos, receipts or cards on the glass, where you want them as separate pictures instead of one big page.
Every page is rendered at 200 dpi with Ghostscript and the page background is read from its edge, as the median colour of a thin ring of pixels around the page. Anything that differs from that background by more than the tolerance (0 to 255, default 30) counts as part of a scan. Touching areas are grouped into regions, so a photo with a pale sky stays in one piece.
A region is kept when it covers at least the minimum contour area (default 500 pixels, which drops dust and specks) and its bounding rectangle is at least the minimum area (default 8000 square pixels, measured on the 200 dpi render). For each region the smallest enclosing rectangle is found. If it is tilted by more than the angle threshold (default 2 degrees) the photo is rotated upright and resampled; otherwise it is a plain crop. The border size (default 1 pixel) adds a margin around each result.
One result is returned as a PNG named after your file. Several come back as a ZIP of PNGs named by page and position, such as scan_page1_1.png, ordered by page, then top to bottom and left to right. If nothing is found, for example on a blank page, the request returns no content instead of an empty file. At most 50 pages are processed in one request.
The tool works on what a page looks like, not on how the PDF is built. Photos that touch or overlap are cut out together as one region, and a photo whose edge is nearly the colour of the page background can lose that edge; lower the tolerance for those. A page of printed text is cut into blocks of text, so use it on scanned pages, not on ordinary documents. The crops are re-rendered at 200 dpi; to get the original embedded images at their own resolution, use Extract Images.
Password-protected files need to be unlocked first. For every page as one image, use PDF to Images; for the words on a scan, use OCR.
Features
- Finds each photo or document on a scanned page and saves it as its own PNG
- Straightens tilted photos above an angle threshold, with bilinear resampling
- Tolerance, minimum area, minimum contour area, border and angle threshold are adjustable
- One PNG for a single result, a ZIP of PNGs for several; nothing found returns no content
- Anonymous API at /api/v1/misc/extract-image-scans
When to use this tool
- Split a flatbed scan of several photos into separate image files
- Cut each receipt out of a page of scanned receipts
- Straighten photos that were laid slightly crooked on the scanner glass
How do I cut photos out of a scanned PDF page?
- Upload a PDF whose pages are scans, such as several photos laid on a flatbed scanner.
- Leave the settings at their defaults, or lower the tolerance if pale edges are cut off, or raise the minimum area to skip small items.
- Click Process and download the PNG or the ZIP of PNGs.
- Open the results and check the edges of any photo that was straightened.
Limits and edge cases
- Works on the rendered page at 200 dpi, not on the original embedded images
- Touching or overlapping photos are returned as one picture
- A photo edge close to the background colour can be cut off; lower the tolerance
- A text page is cut into blocks of text
- At most 50 pages per request
- Password-protected files must be unlocked first
- Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.
Examples
- A page with two photos, one of them tilted 20 degrees, returns two PNGs with the tilted one upright
- A page with a single photo returns that photo as one PNG named after your file
- A blank scanned page returns no content
Privacy for this tool
Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.
Frequently asked questions
- What do I get back?
- One PNG when exactly one photo is found, otherwise a ZIP of PNGs named by page and position. If nothing is found, there is no file to download.
- Why was a photo not found?
- Its colour may be too close to the page background for the tolerance, or it may be smaller than the minimum area. Lower the tolerance or the minimum area and try again.
- Why are two photos in one picture?
- Photos that touch or overlap form one region and are cut out together. Leave a gap between them on the scanner.
- Does it straighten tilted photos?
- Yes, when the tilt is larger than the angle threshold, which is 2 degrees by default. Smaller tilts are left as they are.
- Can I use it on a normal text PDF?
- It will cut blocks of text out as pictures. It is meant for scanned pages that carry photos, receipts or cards.
- Is this the same as Extract Images?
- No. Extract Images pulls the original image objects out of the file. This tool looks at the rendered page and cuts out what it sees, which also works when the whole page is one flat scan.
- How many pages can I process?
- Up to 50 pages per request. A longer file is rejected with an error.
Last updated:
Call this from code
Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.
curl -X POST "https://pdf123.xyz/api/v1/misc/extract-image-scans" \
-F "[email protected]" \
-F "tolerance=30" \
-F "minArea=8000" \
-F "minContourArea=500" \
-F "borderSize=1" \
-F "angleThreshold=2" \
-o output.pdfAlso available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference
Use it from an AI agent
SkillClaude Code, Codex, Cursor and other AI agents can run Extract Image Scans for you with this skill: /skills/pdf123-extract-image-scans.md
Files are used only for this processing job and deleted automatically afterward.