3 ms·
I finally figured out how to use the Tesseract CLI utility on macOS today (installed from Homebrew). It's really neat - you can use it to turn a PNG into a PDF
by simonw 5y ago
I finally figured out how to use the Tesseract CLI utility on macOS today (installed from Homebrew). It's really neat - you can use it to turn a PNG into a PDF with embedded text, which you can then copy-and-paste: https://til.simonwillison.net/tesseract/tesseract-cli https://til.simonwillison.net/tesseract/tesseract-cli
I learned about it from this post: https://alexn.org/blog/2020/11/11/organize-index-screenshots-ocr-macos.html https://alexn.org/blog/2020/11/11/organize-index-screenshots...
- m-p-3 5y agoI used it on Android through Termux, it was quite handy to convert a large amount of image-based files to text in a pinch.
- ramraj07 5y agoDoes it work well on photographs ? I’d love to run it on my photo library so I can search for shop names etc!
- simonw 5y agoI just tried it on a photo of a fish counter at a supermarket with some text labels on some of the fish and it did very well (printed text, in focus) - so yeah this may well be worth trying!
- markmaglana 5y agoThis is the OCR engine used by Mayan EDMS[1] which I've used since 2018. The reliability has been topnotch. [1] https://www.mayan-edms.com/ https://www.mayan-edms.com/
- alexcnwy 5y agoTesseract is mainly for documents and generally doesn’t work well on photos but you can try EasyOCR for photos.
- jimmySixDOF 5y agoFor Android there is a old project from Mozilla that just works like a firecracker on whatever size screenshot directory you have : Firefox ScreenshotGo[beta] https://mzl.la/2NMgD30 https://mzl.la/2NMgD30
- piceas 5y agoIt uses Google firebase on device ML OCR (appears to be rebranded as ML Kit). https://github.com/mozilla-tw/ScreenshotGo https://github.com/mozilla-tw/ScreenshotGo
- eastendguy 5y agoTesseract is not really good for text on pictures (non-white background). You can use the free Space OCR API at https://ocr.space https://ocr.space instead. Or, just upload your photographs to Google Photos. Google OCRs all images automatically(!) and you can search them for text in the images. This includes text e. g. on posters in the background.
- garblegarble 5y ago>Does it work well on photographs Usefully, the new macOS / iOS releases will do this automatically (although for macOS you'll need to be running Apple Silicon)
- protomyth 5y agomacports also had Tesseract CLI available with a lot of language packs.
- Abishek_Muthian 5y agoThat's a nifty use case! I use it to organize screenshots as well. I read HN on my kindle[1] to assimilate knowledge from the comments using its highlighting, clipping features. But commenting is painful on Kindle's 'forever experimental browser' so I take a screenshot and when I connect it to the computer the to-comment stack on a network to-do list is updated with a ready to visit HN story URL using query from the text on the screenshot parsed using Tesseract. [1] https://hntokindle.com/ https://hntokindle.com/ (Disclaimer: I built this)
- wlesieutre 5y agoIf you're just looking to copy/paste text from images, there are a couple of small utilities for this using the built-in Vision framework. OwlOCR is the one I use, with shortcuts set up next to the cmd-shift-3/4/5 screenshot keys. TextSniper is another one, and I think there was a third that I can't remember the name of.