AnkiOCR

AnkiWeb addon 450181164

1 other version of this addon exists. Compare versions ↓

Generates searchable OCR text in bulk from images in notes using Tesseract, storing it as image tooltips or a separate field.
AI-generated summary; may contain mistakes.

note-managementsearchformattingbeta

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
45 (👍 42 · 👎 3)
Updated
2021-09-19
Anki versions
unknown
License
MIT (from the GitHub repository)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
HTML, C, Batchfile, JavaScript, C++, Python, CSS, VBA, PowerShell, JSON, Ruby, Shell, CMake, YAML, AutoIt, Makefile, TSV, Git Config, Tcl, CSV
Description language
en

Maintenance

abandoned

  • Last update or commit: 2023-12-26 (1041 days before the snapshot).
  • Test files: 5.
  • Commits in the last year: 0.
  • Issues: 19 open, 23 closed.
  • Pull requests: 1 open, 1 merged.
  • Median first response: 117 hours (34 answered issues and pull requests).
  • Outside pull requests: 25% of 4 merged.
  • Forks that may still be maintained: "📸Anki OCR - Generate OCR text from images (Fixed by Shigeඞ)" (546383173).

GitHub

Repository
cfculhane/ankiocr · more by cfculhane
Stars
⭐ 19 · forks 5 · open issues 20
Last commit
2023-12-26
License
MIT
Languages
C, HTML, Roff, C++, Python, CSS, JavaScript, Ruby, Shell, CMake, Makefile
Tests
5

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.0–2021-09-19
History across monthly snapshots

Loading…

Compare versions

The original addon and its forks. The best value in each column is in bold.

VersionWorks on Anki 26.09.3MaintenanceLast activity VotesApprovalGitHub starsNotes
AnkiOCR this addon original unknown abandoned 26 Dec 2023 👍 42 · 👎 3 82% 19 beta
↳ 📸Anki OCR - Generate OCR text from images (Fixed by Shigeඞ) (AI-detected; may be wrong) likely stale 23 Jun 2025 👍 17 · 👎 5 57% –

Forks can add features or work in a different way. Read the description before you change to another version. Fork detection is incomplete, so other versions can exist.

Similar addons

pasteOCR has 1 fork →

Extracts text from clipboard images using Tesseract OCR, letting users paste screenshots of lecture slides or textbooks directly into Anki cards via a button or keyboard shortcut.

card-creationshortcutsbeta

16 votes 72% approval 👍 15 · 👎 1 ⭐ 6 Anki 2.1.16~ Updated 2023-02-26

Description

AnkiOCR Anki 2.1 addon to generate OCR text from images inside of Anki notes/cards. Note that this is only designed for computer generated text, not handwritten. The aim of this addon was to generate searchable text for image-heavy notes, it is not intended to produce high quality, perfectly ordered text! Features
    - Convert many notes at once - Undo changes very easily - Multilanguage support via configuration of detection languages
This is currently in beta stage, please submit a bug report on GitHub if bugs are found, or you want to raise a feature request. Installation AnkiOCR depends on the Tesseract OCR library. If you're on Windows or Mac, teseract is bundled with the addon If you're on Linux carefully follow the instructions here Source code available at my GitHub This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY. Usage 1. Open the card browser and select the note(s) you want to process. Use the search bar at the top, select tags, decks, etc. 2. On the toolbar at the top, select 'Cards', then 'AnkiOCR', and select 'Run AnkiOCR on selected notes', as shown below 3. After processing, each of the images in the note will have the ocr data embedded in the `title` html tag, viewable as a tooltip: 4. If you want to remove the OCR data from any notes, select them and then use the "Remove OCR data from selected notes" option in the menu shown above If you wish to have the OCR data outputted to a separate 'OCR' field on the note, which will modify your note types in your deck, you can set the `text_output_location` config option to `new_field` If you want to add new languages, you need to download the appropriate language data from here. Known issues
    - Will not work with handwritten text, this probably wont change as the library its based on is not optimised for handwritten text - Images with differently sized text, and/or images with low resolution text, may not process properly. If you have examples that you think should have been processed, please raise a GitHub issue so I can look into it - Note that for versions of anki prior to 2.1.41, the addon is locked to AnkiOCR version 0.5.3, due to breaking changes in the Anki API
Changelog
    - 0.7.1 - 2021-09-19 - Removing Chinese, German, French and Spanish language data to reduce filesize - Updating readme with link to language data - 0.7.0 - 2021-09-19 - Updating vendorised pytesseract - Updating mac tesseract dependencies - Updated build script for tesseract for mac - The above fixes #27, #28, #29 - 0.6.1 - 2021-09-17 - Attempting to fix error where image does not exist - Improved exception display to end user if processing fails unexpectedly, adding debug info - 0.6.0 - 2021-09-13 - Fixes #26, thanks @bwhurd for the bug report - Other small fixes to support Anki 2.1.41 and beyond - Drop support for Anki versions prior to 2.1.41, but it should still work. - 0.5.3 - 2021-09-04 - Fix raising of KeyError when img src is not found, thanks @thiswillbeyourgithub for the fix! - 0.5.2 - 2021-05-22 - Fix error on some Linux environments, see https://github.com/cfculhane/AnkiOCR/issues/20 , thanks to user thiswillbeyourgithub for the fix! - 0.5.1 - 2021-05-02 - Hotfix to include accidentally gitignored tesseract mac libs - 0.5.0 - 2021-05-02 - Added bundled tesseract for Mac, no longer any need to install it separately - Split out `tessdata` to its own folder, allowing easier installation of new languages - Change in the way note ID's are processed, no longer limited to 1000 cards - Fixed issue causing a crash in anki versions > 2.1.40 - Added some log text that will appear when invalid notes are encountered during a processing run - 0.4.3 - 2021-01-22 - Hotfix for config.json syntax error - 0.4.2 - 2021-01-19 - Add `num_threads` config option to allow manual setting of number of threads - Add `use_batching` config option to allow disabling of batching for those for which this causes performance issues - Added more unit tests to releasing new versions - Fixed an issue where OCR text containing "::" would break clozes, now cleans duplicate colons in text - 0.4.1 - 2021-01-01 - Reduced batch_size default to 5 to improve the progress bar updating frequency and feel of speed - added total time readout to final message on completion - added ability to cancel during processing - 0.4.0 - 2020-12-31 - Major feature update, now is multithreaded for roughly a 10x speed improvement - Complete refactor of code for readibility and maintability - Addition of basic unit tests for OCR section of codebase - Improved progress bar messaging - 0.3.1 - 2020-10-11 - Config setting for `text_output_location` is now read properly when starting OCR class - More detailed exception readout when exception occurs during processing - 0.3.0 - 2020-10-06 - New method for storing the ocr text, now stores it in title attr of the img html tag - Handle old verions of Anki not having different progressbar.update() - 0.2.6 - 2020-10-06 - Handle old verions of Anki not having different progressbar.update() - 0.2.5 - 2020-10-06 - Add alternate import method for Collection due to API changes in Anki - 0.2.4 - 2020-10-05 - Changed order of operations so that OCR is attempted before notes are modified to eliminate risk of database errors - Updated path to tesseract executable for mac and linux - 0.2.3 - 2020-10-05 - HOTFIX for tesseract cmd path on Mac - 0.2.2 - 2020-10-05 - Removed the install file for Tesseract-OCR for windows, now that the binaries themselves are included. - Updated the initial message the user sees to notify re: the database change message Anki will show. - 0.2.1 - 2020-10-05 - HOTFIX for Fixing tesseract executable detection - 0.2.0 - 2020-10-05 - Now packaged with windows binaries for Tesseract-OCR, no install necessary! - Added flag in config.json to indicate valid tesseract exec - Updates to README to reflect above changes - 0.1.0 - 2020-10-05 - Initial Release

README

AnkiOCR

Anki 2.1 addon to generate OCR text from images inside of Anki notes/cards. Note that this is only designed for computer generated text, not handwritten.

The aim of this addon was to generate searchable text for image-heavy notes, it is not intended to produce high quality, perfectly ordered text!

Note that because this addon changes the note template, you will see a warning about changing the database and uploading to AnkiWeb. This is normal.

Usage

  1. Open the card browser and select the note(s) you want to process. Use the search bar at the top, select tags, decks, etc.

  2. On the toolbar at the top, select 'Cards', then 'AnkiOCR', and select 'Run AnkiOCR on selected notes', as shown below

docs/menu.png

  1. After processing, each of the images in the note will have the ocr data embedded in the title html tag, viewable as a tooltip:

docs/text_tooltip.png

  1. If you want to remove the OCR data from any notes, select them and then use the "Remove OCR data from selected notes" option in the menu shown above

If you wish to have the OCR data outputted to a separate 'OCR' field on the note, which will modify your note types in your deck, you can set the text_output_location config option to new_field

If you want to add new languages, you need to download the appropriate language data from here.

Installation

AnkiOCR depends on the Tesseract OCR library.

If you're on Windows or Mac, tesseract is bundled with the addon.

If you're on Linux carefully follow the instructions here

AnkiOCR was built on Python 3.9.

It is highly recommended to to use inside the Anki application, by installing the addon from AnkiWeb If you want to run it externally to anki, see below:

  • Ensure you have pyenv and poetry installed
  • Then clone the git repo: git clone https://github.com/cfculhane/AnkiOCR
  • Setup env and install dependencies make install

Testing

make test