Files
rapidocr/python/rapidocr
Jyotishman Das ae1d898295 fix(python): convert palette and CMYK images before OCR (#773)
img_to_ndarray passed the raw PIL array straight to convert_img. For
palette (P) images that array holds palette indices, so a typical
two-colour PNG reaches the detector as an almost black image and no
text is found. CMYK images give four ink channels that were treated as
RGBA, so a CMYK JPEG also returned no result.

Convert P images to RGBA, which keeps any palette transparency for the
existing alpha handling, and CMYK images to RGB. Path, bytes and PIL
inputs all go through this function.
2026-11-12 21:57:38 +08:00
..
2025-02-12 10:26:43 +08:00
2026-06-11 18:54:58 +08:00
2026-10-08 22:51:03 +08:00