Files
rapidocr/python/tests
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
..
2026-05-22 14:45:35 +08:00
2024-10-17 22:24:31 +08:00
2026-06-11 18:54:58 +08:00
2026-06-17 10:57:41 +08:00
2026-06-23 09:54:53 +08:00