Tools,

GIF, WEBP, BMP, AVIF and JP2 to text, tested

3 of 6

readers could not open an AVIF file

Get the one-line fix

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.

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

Lossless or lossy, the words mostly held up

Pillow's default for each format, and the words read
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

Scans, words found in order
Reader PNG GIF
RapidOCR 96.9% 88.5%
Tesseract 96.0% 96.1%
Apple Vision 98.9% 98.7%

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

What I did not test

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

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.