How to Split Multiple Scanned Photos Fast

by ScienceDiscoverer in Circuits > Software

2921 Views, 10 Favorites, 0 Comments

How to Split Multiple Scanned Photos Fast

PhotoCut.png

Lets say you found yourself in a situation where you are in desperate need to scan lots of old (analog) family photos. Like around 2000 of them. That's a lot of photos. Scanning them one-by-one is a very bad idea, because this will take forever. Most efficient method of scanning will be to use flatbed scanner and try to fit as many photos in the single scanner page as possible.

But then, you will have additional task of cutting out individual photos from this scanned pages. This can take huge amount of time if done by traditional methods – (MS Paint or Paint.NET) manually cutting single image... Then pressing save... Then selecting quality and waiting for preview... Then selecting save location and manually renaming each single file...

Now, initially I though that people should have already created automatic software solution for this problem. Well, yes and no. Yes, they did it. No, none of the solutions work adequately at all. It only works in ideal conditions and only for specific types of photos.

So far nobody had trained neural network to do this task (probably because its very niche task, companies that earn monies on scanning use automated mechanical solutions), you will have to use your own (very powerful ;) neural network to do it manually!

But how to cut corners and try to minimize time cost as much as possible? This instructable will tell you exactly this! At least one of the possible ways.

Supplies

  • Flatbed scanner
  • IrfanView
  • X-Mouse Button Control
  • New File Auto Incrementer
  • Lots of patience!

Scan All Your Photos

This is self-explanatory. A few tips. Just put as many of them inside your scanner as possible and scan. Use your scanner manufacturer's software to scan with scanner's buttons. Don't use "auto" mode, it will mess things up. Use max DPI and grey-scale setting for BW photos, color setting for colored photos. Save in PNG to not loose any quality on JPEG re-encoding step later. Be careful not to put photos too close to scanner's bottom side, it might be a dead zone and parts of your photos would not be saved.

Get Necessary Programs

  1. IrfanView
  2. X-Mouse Button Control
  3. New File Auto Incrementer (source code, 32_bit)

IrfanView is by far, the best photo editing program that suits this task. It's very fast and convenient in terms of doing lots of repetitive operations, something that many "bigger" and "cooler" programs lack.

X-Mouse Button Control is cool scripting/mouse remapping program. You might even start to use it every day (for example, mapping Ctrl+C, Ctrl+V to mouse side buttons), but in this particular case it will help with instant saving of the image after selecting it's area with just a single mouse button click.

New File Auto Incrementer is a little, tiny modest program that I developed precisely for this task. Its very small, but fulfills very important and repetitive role. You can check source code yourself via the link (if you want, you can compile it yourself too, I attached x64 build here).

Configure X-Mouse Button Control

mouse.png
  1. Create folder for the individual images
  2. Copy nfainc.exe into it
  3. Open first scanned sheet in the IrfanView
  4. Open X-Mouse Button Control Settings
  5. Add IrfanView profile
  6. Choose your preferred button (if your mouse don't have side buttons, use middle button or scroll up/down)
  7. Add "Simulated Keys", paste this inside field and save settings:
    {CTRL}{SHIFT}B{RETURN}

Let the Cutting Begin!

New File Auto Incrementer
  1. Launch nfainc.exe
  2. Select first image to be cut out (you can change rectangle thickness/color in Browsing/Editing settings)
  3. Don't use button for now, use File-->Save Selection As... choose your output folder (where you copied nfainc.exe) and JPEG (or other format that you fancy) quality settings.
  4. After you saved first image, you can just press your scripted mouse button to instantly save selected image

New File Auto Incrementer will scan folder every 0.5 seconds and if it finds any newly created/edited files it will rename it with x_ prefix, where x is your photo number. In this way you can rapidly save huge amounts of them with most annoying repetitive steps out of the way.

With some breaks included in time, I was able to cut out 1751 photos in just 5 hrs 15 min, which is about 10.8 s/photo on average.

Don't worry about rotating your photos or editing them for now. You can do that later much more effectively.

Bonus: Rotate Images in Explorer With a Single Mouse Click

Rotation.png

Open Explorer's image editing panel by pressing little arrow in top right corner of window.

Then add this macroses to X-Mouse Button Control. You might want to use Layer 2 for this to not mess up your usual mouse settings (you can switch layers with RMB press on program icon in taskbar).

Middle Button {LMB}{MSAVE:1}{ASET:36,93}{LMB}{LMB}{MREST:1}
Button 4      {LMB}{MSAVE:1}{ASET:36,93}{LMB}{MREST:1}
Button 5      {LMB}{MSAVE:1}{ASET:101,89}{LMB}{MREST:1}

Top one rotates image 180 deg, middle one turns anti-clockwise and bottom one turns it clockwise. You don't even need to select image you want to rotate, just hover mouse over it and press button that you require for that particular image.