Skip to content
Image docs0.3

OCR Integration

Latest stable Based on Image release 0.3.0

bluetape4k-images-ocr adds Tesseract text extraction to the core ImmutableImage model. It is a separate module because OCR brings native packages, language data, latency, and operational failure modes that normal image processing does not need.

OCR request flow from web upload through validation, image preparation, recognition, and response

OcrOptions selects language and engine behavior. OcrResult carries recognized text and result data. TesseractOcrEngine implements the engine, and ImmutableImage.extractText is the convenient entry point for an existing image value.

Configure language and data path explicitly in controlled deployments. Normalize or resize input only when it improves the document class being processed; aggressive filters can remove characters as easily as noise.

Bound upload bytes, decoded dimensions, OCR concurrency, and request time. OCR is a good candidate for a worker queue when documents are large or latency is unpredictable. Apply the same data-protection and retention policy to original media and extracted text; recognized text can be more searchable than the image.

Distinguish configuration failure, engine failure, empty recognized text, and request validation. Do not retry malformed or unsupported input indefinitely.

Complete OCR setup first. Then run the Ktor OCR or Spring Boot OCR workshop and read its tests with the application code.