GIF, WEBP, BMP, AVIF and JP2 to text, tested
3 of 6
readers could not open an AVIF file
Who opens what: 6 readers, 6 formats
| Reader | Would not open |
|---|---|
| Tesseract 5.5.4 (Homebrew) | AVIF |
| Apple Vision | None |
| RapidOCR | None |
| EasyOCR 1.7.2 | AVIF |
| OCRmyPDF 17.13.0 | An image with no dpi, unless you add one |
| Our Actor's code, build 0.1.145 | GIF, BMP, AVIF and JP2 |
I saved 20 images 6 ways with Pillow's defaults: 120 files.
- Scans: 10 proofread book pages, 1,955 words.
- Screenshots: 10, from articles to spreadsheets, 1,218 words.
The free fix: convert to PNG first
On a Mac, with sips, which comes with macOS:
sips -s format png file.gif --out file.png
With ImageMagick 7 on any system (AVIF needs its libheif delegate):
magick file.avif file.png
- From WEBP, GIF, BMP and JP2, the PNG had the same pixels. From AVIF, the scan came out a little different.
- Our Actor opened every converted PNG.
- It fixes opening, not quality: a GIF keeps its lost colors as PNG.
Lossless or lossy, the words mostly held up
| Format | Pillow saves it | Words against PNG |
|---|---|---|
| BMP | Lossless | Same, within 1 word |
| JP2 | Lossless | Same |
| WEBP | Lossy, 7% of the PNG size | Within 2 points |
| AVIF | Lossy, 8% of the PNG size | Within 2 points |
| GIF | 256 colors | RapidOCR lost 8.4 points on scans, the rest within 0.2 |
Sizes are for the scans. Within 2 points: every reader that opened the file, on both sets, but our Actor on WEBP screenshots.
Every score: scans, 1,955 words
| Reader | PNG | WEBP | GIF | BMP | AVIF | JP2 |
|---|---|---|---|---|---|---|
| Tesseract | 96.0% | 95.9% | 96.1% | 96.1% | no | 96.0% |
| Apple Vision | 98.9% | 98.7% | 98.7% | 98.9% | 98.8% | 98.9% |
| RapidOCR | 96.9% | 97.0% | 88.5% | 96.9% | 97.3% | 96.9% |
| OCRmyPDF | 96.0% | 96.2% | 96.0% | 96.0% | 96.0% | 96.0% |
| Our Actor | 96.2% | 95.8% | no | no | no | no |
True words found in order. No: the reader did not open the file. EasyOCR: screenshots only.
Every score: screenshots, 1,218 words
| Reader | PNG | WEBP | GIF | BMP | AVIF | JP2 |
|---|---|---|---|---|---|---|
| Tesseract | 79.5% | 79.6% | 79.3% | 79.5% | no | 79.5% |
| Apple Vision | 95.1% | 95.4% | 94.9% | 95.1% | 95.3% | 95.1% |
| RapidOCR | 97.3% | 97.2% | 97.5% | 97.3% | 95.6% | 97.3% |
| EasyOCR | 80.5% | 80.0% | 80.5% | 80.5% | no | 80.5% |
| OCRmyPDF | 79.0% | 79.3% | 78.8% | 79.0% | 78.9% | 79.0% |
| Our Actor | 97.0% | 91.5% | no | no | no | no |
True words found in order. No: the reader did not open the file.
GIF scans tripped up RapidOCR
| Reader | PNG | GIF |
|---|---|---|
| RapidOCR | 96.9% | 88.5% |
| Tesseract | 96.0% | 96.1% |
| Apple Vision | 98.9% | 98.7% |
- GIF keeps 256 colors. One scan page had 34,831 colors as PNG.
- The loss sat on 5 pages of one book, where RapidOCR garbled some lines.
- Screenshots have few colors. As GIF, RapidOCR's total held: 97.5% against 97.3%.
- Single files moved both ways: one lost 19 words, another gained 19.
AVIF: Tesseract and EasyOCR say no
Tesseract from Homebrew exits with one line:
Error during processing.
Its image library, Leptonica, was built without AVIF. EasyOCR crashes:
AttributeError: 'NoneType' object has no attribute 'shape'
The OpenCV wheel it installs reads no AVIF: imread returns None. Open the file with Pillow and pass an array:
import easyocr
import numpy as np
from PIL import Image
reader = easyocr.Reader(["en"], gpu=False)
img = np.array(Image.open("file.avif").convert("RGB"))
print("\n".join(reader.readtext(img, detail=0)))
On one screenshot: 142 words, against 143 from the PNG.
OCRmyPDF needs a dpi for images
Without one, it stopped on PNG, WEBP, GIF, AVIF and JP2 with a DpiError: the image "has no resolution (DPI) in its metadata."
BMP ran: Pillow writes 96 dpi into a BMP by default. Add the flag:
ocrmypdf --image-dpi 300 --sidecar out.txt file.avif out.pdf
With it, all 120 files ran, AVIF too. The text is in out.txt.
Our Actor: all 6 formats since build 0.1.147
PDF OCR to Markdown, our Apify Actor, takes PDF, PNG, JPEG, WEBP, TIFF, HEIC, AVIF, GIF, BMP and JP2. Builds 0.1.139 to 0.1.146 refused GIF, BMP, AVIF and JP2 with:
Unsupported file type. Supported: PDF, PNG, JPEG, WEBP, TIFF and HEIC.
An animated GIF gives its first frame only.
| Build 0.1.145 on | PNG | WEBP |
|---|---|---|
| Scans | 96.2% | 95.8% |
| Screenshots | 97.0% | 91.5% |
| Spreadsheet 1 | 77 of 77 | 40 of 77 |
| Spreadsheet 2 | 77 of 77 | 38 of 77 |
- Its table finder broke the grid of the lossy WEBP. Build 0.1.146 fixed that.
- For a spreadsheet screenshot, send PNG.
- Images and scanned pages: $0.006 each, plus $0.00005 a run at 1 GB.
What I did not test
- Other save settings. Pillow's defaults only: no lossless WEBP, no lossy JP2, no animated GIF, no 16-bit or see-through images.
- More files. One file holds 6% to 16% of a set's words. Here one file moved a cell by 3.2 points at most.
- Phone photos: JPG to text.
- iPhone files: HEIC OCR.
- Our Actor on Apify. Its code from build 0.1.145 ran on this Mac.
How I tested it
- Scans: 10 proofread Wikisource book pages, 1920 px JPEGs, 1,955 words.
- Screenshots: 10 light scenes drawn in headless Chromium at 1x, 1,218 words.
- Pillow 12.1.1 decoded each image once and saved it with its defaults, the format from the file name.
- Score: true words found in order, against the known text. A file a reader would not open counts as no text.
- Tesseract 5.5.4 (Homebrew) command line. Apple Vision VNRecognizeTextRequest, accurate.
- RapidOCR 3.10.0 defaults. EasyOCR 1.7.2 on the CPU, screenshots only.
- OCRmyPDF 17.13.0 with --image-dpi 300, the text from --sidecar.
- The Actor: its own code at build 0.1.145, run on this Mac with text output, its defaults, and Homebrew's Tesseract 5.5.4, not the image's Debian build.
- On this Mac the code had no HEIC library, so its message left out HEIC. The quote is build 0.1.145's message, from its code.
- The fix: sips and ImageMagick 7.1.2-11, on the first file of each set and format.
- macOS 26.6 (arm64). No speeds: other jobs kept the Mac busy.
- Scripts and results stay in our private repo, in research/bench/image-formats-ocr-2026-11-26/.
Sources
- Pillow: image file formats
- OCRmyPDF on GitHub
- RapidOCR on GitHub
- EasyOCR on GitHub
- Apple: VNRecognizeTextRequest
- Book pages: The Boy Scouts of the Air at Cape Peril, Wikisource.
- Book pages: A Warning to the Curious, Wikisource.
- We make the Apify Actor, and none of the other tools here.
Questions people ask
How do I convert a GIF to text?
Tesseract, Apple Vision, RapidOCR, EasyOCR and OCRmyPDF (with --image-dpi) all opened GIF. On GIF scans, Apple Vision found 98.7% of words and Tesseract 96.1%. RapidOCR fell to 88.5%, so use another reader for a scan saved as GIF.
Can Tesseract read AVIF?
Not the Homebrew build we tested. It exits with "Error during processing." because its Leptonica has no AVIF library. Convert the file to PNG first, or use Apple Vision or RapidOCR, which opened AVIF.
Does WEBP lose OCR accuracy?
Little for plain text. At Pillow's default quality, the 5 free readers stayed within 2 points of PNG. Our Actor lost words on 2 spreadsheet screenshots, so send a table as PNG.
Why does OCRmyPDF give a DpiError on an image?
The image has no dpi in its metadata. Add --image-dpi 300. With it, all 120 of our files ran, AVIF too.
Can OCR read a JP2 file?
Yes, 5 of our 6 readers opened JP2, the JPEG 2000 format (OCRmyPDF with --image-dpi). A lossless JP2 gave the same words as the PNG. Our Actor was the one that did not, and it takes JP2 now.