An Emacs minor feature that automatically inserts OCR (text recognition) output under images inserted via org-download, using Tesseract OCR. The OCR text is stored in a folded :ocr: drawer directly below the image link, making it searchable but unobtrusive.
Personally, I use this when taking org-roam notes so that screenshots are searchable.
- 🖼️ Automatically runs Tesseract OCR on images inserted via `org-download-clipboard`
- 📦 Inserts OCR text in an Org
:ocr:drawer - 🔍 OCR text is indexed by isearch and other Org search tools
- 🧹 The drawer is folded automatically to keep your buffer clean
- Emacs 27.1+
- org-download package
- Tesseract OCR installed and available on your PATH
Once submitted and accepted to MELPA:
(use-package org-ocr-drawer
:ensure t
:config
(org-ocr-drawer-enable))- Clone this repository:
git clone https://github.com/fkgruber/org-ocr-drawer
- Add the directory to your load-path:
(add-to-list 'load-path "/path/to/org-ocr-drawer") (require 'org-ocr-drawer) (org-ocr-drawer-enable)
- Ensure Tesseract is installed (e.g.
brew install tesseracton macOS). - In an Org buffer, run
M-x org-download-clipboardto paste an image. - A drawer like this will be inserted:
[[file:screenshot.png]] :ocr: Recognized text from the image... :end: - The
:ocr:drawer will be folded automatically.
You can disable the OCR feature at any time with:
(org-ocr-drawer-disable)This project is licensed under the MIT License.
Fred Gruber email {at} fredgruber {dot} org