5 ms·
Ask HN: How to turn a series of photos of documents into a PDF?
I often come across the problem that I need the scan of a physical (machine or handwritten) document (black letters on white sheet) in a situation where there is no scanner available. So taking a picture and convert the jpg into a pdf is often the best/only possible solution. Usually I collect all pictures into one folder and apply image magick convert. The hard part is to find the parameters resulting in the best compromiss between quality and size of the final pdf. Here are the main occuring problems:
1) You hardly manage to take the picture perfectly from the top of the document. The result is that your rectangle-shaped A4 document is (in best cases) a trapeze on your picture. A good algorithm should recognize the geometry of the sheet and then stretch it to a rectangle and crop the surroundings. Taking the picture on a dark background, this should not be a big problem. For a possibly curled sheet of a college block, you may also take into acount the crossed lines.
2) Brightness/Contrast should be adjusted. However it may happen that one part of the document is pictured brighter that another one. By choosing extreme values in brightness/contrast parts of the background will turn black and other parts of the letters will vanish to white.
This should be easily solvable. The brightness difference from background to letter varies abruptly, while the brightness of the background only varies lightly when moving far across the picture. One should probably apply a contrast adjustment of the gradient of the picture first to iron out these artefacts. Then adjust brightness/contrast of the 'ironed' picture.
3) Each picture should be treated individually, because the artefacts coming from points 1) and 2) may vary between the taken pictures
As I will hardly be the first person having this problem, I am asking you for your favourite/most convenient solution. Do you know a nice tool or have you written a script (maybe even using image magick)?
- navjack27 8y agoThere are so many manual ways to do this that aren't that painful. Phone's are useful for this too, just get the scans on to your phone and some apps do it.
- kup0 8y agoDepends on the platform, but I've used Readdle's Scanner Pro on iOS and it does pretty a pretty good job at auto-adjusting the contrast and geometry of scans, and they can be output to PDF. You can scan multiple pages into one "document" then export that document.
- towndrunk 8y agoInstall Microsoft Office Lens. Works great for taking pictures of documents, white boards etc.
- c_void 8y agoOkay I should have found out before that there are many good apps solving the problem. Thank you for your advices anyway! After testing some of them, let me also answer my question by myself. I tried the apps Simple Scan, Tiny Scanner, Cam Scanner and Microsoft Office Lens. I skipped Adobe Scan, as I had to register before being able to use it. (The Free versions of) Simple Scan and Cam Scanner had too much ads for my taste. I could not find Readdle's Scanner Pro for Android in Google's playstore. Imo Tiny Scanner worked best for my particular problem. You can take picture after picture, cropping, stretching and brightness adjusting is almost automatic. After that you can save the scan series into a single PDF file. Also of good quality is Open Note Scanner, which however does only cropping and brightness/contrast adjustment without stretching, cropping and assembling to a PDF file. For photographs, paintings and screens I also liked Microsofts Lens, which is perfect for stretching and cropping without brightness/contrast and monochrome adjustment.