Skip to content

Split scanned photos

Find each photograph on a scanner page and save them as separate straightened files.

Drop your file here

Processed securely and deleted within the hour.

Up to 40 MB · free · no signup
    Raise this if dust and scanner artefacts are coming out as photos.
    Removes the thin line of scanner background that otherwise survives along the edge of a crop.

    The tedious part of digitising an album

    Nobody scans family photographs one at a time. You lay four or six prints on the flatbed, scan the lot, and end up with a single large image containing several photographs surrounded by white — and then face cropping and straightening each one by hand, several hundred times. That is the job this does.

    How each photograph is found

    The page is first separated into "photograph" and "scanner lid" by a threshold chosen from the image's own histogram rather than a fixed brightness. That matters more than it sounds: scanner lids vary from bright white to dull grey, and a hard-coded cut-off that works on one machine fails on the next. Otsu's method reads the distribution of the page in front of it and picks the split point that best separates the two peaks.

    The mask is then closed to bridge small gaps — so a print with a pale sky does not break into two separate regions — and opened to drop dust and scanner speckle. Each remaining region gets a minimum-area rectangle, and anything that fills much less than its own rectangle is discarded, because a photograph is a rectangle and a shadow or a smear is not.

    Straightening

    Prints are never laid down square. Each region's rectangle carries its own angle, so each photograph is rotated back independently rather than the whole page being rotated by an average — which would fix one print and tilt the others.

    There is a subtlety worth knowing about, because it is a classic bug in this kind of code: the angle reported for a rectangle is the angle of one of its sides, and it wanders through a ninety-degree range as the rectangle turns. Used naively it stands landscape prints on end. The angle is normalised to the nearest upright here, so a landscape print stays landscape.

    The white line along the edge

    A crop taken exactly at the detected boundary usually keeps a thin line of scanner background along one or two edges, because the threshold sits a pixel or two outside the print. A small trim removes it. Two pixels is enough for most scans; raise it if you can still see a pale border.

    Order

    The files come out numbered the way you would read them — top to bottom, then left to right — with the rows banded so two prints laid side by side but a few pixels apart vertically still come out left-then-right rather than interleaved.

    Getting good results

    Leave a clear gap between prints so they are not detected as one region. Close the scanner lid, because an open lid gives a dark, uneven background that no threshold handles well. If dust is coming out as tiny photographs, raise the minimum size. If a genuine small print is being skipped, lower it.

    01

    Common questions

    How many photos can be on one page?

    As many as fit with a visible gap between them. Prints that touch are detected as a single region, so leave a few millimetres.

    My scanner has a black lid — does that work?

    Yes, switch the background setting to dark. The detection is inverted rather than re-tuned, so it works equally well either way.

    Why is one photo missing?

    Usually it is smaller than the minimum size, or it touches another print and the two were merged. Lower the minimum size, or rescan with more space between them.

    Does it straighten each photo separately?

    Yes. Every print is rotated by its own angle rather than the page being straightened as a whole, which is what makes it work when prints are laid down at different angles.

    Are the photos re-compressed?

    They are saved as high-quality JPEG. Scan at 300 DPI or higher if these are going to be archived, because nothing here can add detail the scan did not capture.

    What if there is only one photo on the page?

    You get a single straightened, cropped file rather than a zip — which is a useful way to auto-crop one scan.