{
  "id": 6190143,
  "title": "I built a free image preprocessor to get better OCR results (PrepOCR)",
  "url": "https://urgent.news/2026/09/07/i-built-a-free-image-preprocessor-to-get-better-ocr-results-prepocr",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-07T23:30:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/aranadedoros/i-built-a-free-image-preprocessor-to-get-better-ocr-results-prepocr-52do"
  },
  "original_language": "en",
  "account": "OCR accuracy hinges on the quality of the input image. Scanned forms that are slightly tilted, have low contrast, or a noisy background can significantly harm recognition accuracy, even with a robust OCR engine. Often, the solution isn't a more advanced OCR model; it's about having a cleaner input image. I aimed to create a lightweight tool to pre-process multiple images before they are sent to an OCR pipeline. Thus, I developed PrepOCR - a free image pre-processing service that specifically targets the transformations that truly impact OCR accuracy.\n\nAt present, PrepOCR supports the following transformations: tilt correction (rotating the image by a specified angle), enhancing contrast to ensure text separation from the background, and binarization (converting the image to black and white using a configurable threshold). Users simply upload one or more images, choose their desired settings, and receive a zip file containing the optimized versions. You can test PrepOCR here.\n\nThe backend is built using Scala, http4s, and AssetFlow. Multipart requests are uploaded, validated (checking size, dimensions, and image type via magic bytes, not just file extensions), processed, and zipped before being returned to the user. Processing each file sequentially, as it is in the backend, is CPU-bound and independent of other files. To speed up the process, I switched from sequential processing to parallel processing using parTraverseN. On my machine with 14 cores, converting and optimizing 4 PNG images dropped from about 7 seconds to 2 seconds. However, on the free-tier server on which PrepOCR is hosted, most of this benefit is negated because CPU resources are heavily restricted, resulting in merely interleaved, rather than truly concurrent, processing. A important lesson from this is that the available processors might not accurately reflect the actual CPU power available in a shared environment.\n\nThis project is currently an MVP, built due to a personal need, not based on validated demand. It remains to be seen if this tool will be useful to others. If you work with scanned documents, forms, or OCR pipelines and would like to try out the preprocessing step, I would appreciate any feedback, feature requests, bug reports, or even comments stating that \"this already exists and does it better.\"",
  "summary": "The problem OCR is only as good as the image you feed it. A scanned form that's slightly tilted, low-contrast, or has a noisy background can tank recognition accuracy — even with a good OCR engine behind it. Most of the time the fix isn't a better OCR model, it's a cleaner input image. I wanted something small I could throw a batch of images at before sending them to an OCR pipeline, so I built…",
  "key_points": [
    "PrepOCR is a free image pre-processing service.",
    "Supports tilt correction, contrast enhancement, and binarization.",
    "Parallel processing improves speed on capable machines."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}