mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-07-31 23:50:17 -04:00
Ghostscript 10.x renders aliased glyphs that OCR frequently misreads as extra word breaks or substituted characters. Enable text and graphics anti-aliasing (-dTextAlphaBits=4 -dGraphicsAlphaBits=4) for the contone raster devices, which empirically improves OCR accuracy on the Ghostscript path, especially for small fonts at moderate DPI. The 1-bit mono devices are excluded, since older Ghostscript rejects alpha bits on them and pngmonod performs its own anti-aliased downscaling. Also log which rasterizer rendered each page at debug verbosity and clarify the --rasterizer help text, so quality reports are easier to diagnose. The default rasterizer (auto) already prefers pypdfium2, which anti-aliases; this primarily benefits --rasterizer ghostscript and installs without pypdfium2. Closes #1439.