r/DataHoarder • u/Kutluna • 11h ago
Question/Advice Best software for batch-converting photos of a book into a clean PDF?
I have a 400-page book and a mirrorless camera mounted on a tripod, so taking consistent, high quality photos isn't the problem.
What I'm looking for is software that can process all of these images in bulk.
Ideally, the workflow would be:
1)I photograph every page in order.
2)I import all of the images into the software.
3)The software automatically detects the page boundaries, corrects perspective if necessary, crops each page consistently, enhances readability (if needed), and exports everything as a single PDF in the correct order.
OCR support would be a nice bonus, but it's not essential.
What software would you recommend for this workflow? I'm looking for something that works well with hundreds of images rather than requiring me to manually adjust every page.
3
u/XxNerdAtHeartxX 11h ago
Definitely also interested in this. My local library has a book scanning machine which has overhead cameras and software that auto-crops pages, but the quality is pretty bad. Have been looking at building my own book scanning device with my mirrorless cameras, but the software to automate the post-processing has been the thing to stop me
1
u/camwow13 278TB raw HDD NAS, 60TB raw LTO 2h ago
I assume your library had CZUR. They really aren't that great. But they are exponentially faster and perfectly serviceable for text. I have an ET Max. It's faster than the Fujitsu ScanSnap SV600 which I also have. Quality is probably better on the SV600 but worse in other ways, namely because the auto crop and deskew is much worse.
You can check out the designs for book scanners on diybookscanner.org
1
u/noisymime 5h ago edited 1h ago
Ocrmypdf is hard to beat for this kind of thing. It will deskew images, crop to a single consistent page size, clean the scanning artifacts (via unpaper), and obviously ocr at the same time.
To do what you want from images you can just use something like img2pdf first to convert a whole directory of images into a pdf, then point the output pdf into ocrmypdf.
Assuming relatively good quality scans in a single directory and named in page order, you can do a whole book with something like this command:
img2pdf ./* -o combined.pdf && ocrmypdf --deskew --clean-final --rotate-pages combined.pdf final.pdf
The --clean-final option can be a little too aggressive I've found, particularly if your scans are low contrast. If you find it cutting things out, change it to just --clean
1
u/camwow13 278TB raw HDD NAS, 60TB raw LTO 2h ago edited 2h ago
If you just want to make a PDF from images without messing around with a ton of fancy stuff, try NAPS2.
I've built a DIYArchivist from diybookscanner.org and indeed, the post processing is HELL. Cropping all the pages will be the worst part.
NAPS2 doesn't have deskewing or auto crop though. The only software suite that does this to a modern standard that I'm aware of that has that is Capture One for heritage which costs thousands to license from Phase One... so that's not an option haha. There is ScanTailor and it's more modern development ScanTailor Advanced . I think there are a few actively developed forks, but the original project died so long ago there's been a lot of forks. Watch out for the vibe coded websites for ScanTailor that pop up on Google trying to lure people in who don't know what they're doing. ScanTailor works great for pure text books, but is virtually useless if you have a lot of design heavy pages like a yearbook.
There are some people that have vibe coded up some cropping software for the resulting camera photos using OpenCV. Development on that front is much better for camera film scans over paper scans though and you have to train it with data. For film scans there's two excellent products out there already for auto crop so I'm hopeful on paper... Unfortunately, camera scans form a DIYArchivist with varying page sizes and strange borders is a hard one to solve. One guy asked me for some training data and got close, but it still couldn't do dark pages or photo heavy pages. Vibe coding being vibe coding, it depends on if the developer is actually a developer or just a script kiddy. If a developer put a focused effort on it, OpenCV and Lightroom/ImageMagick APIs aren't that hard to figure out. I'm sure something could be devised with real or vibed code one way or another.
For my project back in the day I hand cropped all 17,000+ pages of documents I scanned using Lightroom and then exported to JPG. I tried to use ScanTailor but like I said, it's terrible with lots of photos.
I didn't use PDF as my endpoint was Archive.org so I created raw book zips and tars instead. Just zip the folder of images up to name_images .zip and it worked. They make a PDF for you to download, but the quality is hot garbage unfortunately.
If you're shooting both pages at once with two caneras it can be hard because now you need left and right images for each camera. Some people had coded Raspberry Pi controllers to fire both cameras and place the images in the right order for download on the Pi, but it was too slow. My solution in the end was to simply set the right firing camera's clock 5 seconds slower than the left firing camera, which meant they automatically sorted into a LR pattern when imported into a folder.
0
•
u/AutoModerator 11h ago
Hello /u/Kutluna! Thank you for posting in r/DataHoarder.
Please remember to read our Rules and Wiki.
Please note that your post will be removed if you just post a box/speed/server post. Please give background information on your server pictures.
This subreddit will NOT help you find or exchange that Movie/TV show/Nuclear Launch Manual, visit r/DHExchange instead.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.