# Pre-processing

Pre-processing (or image processing) prepares the captured screen image before it's sent to the OCR engine for text recognition.

**Important:** Pre-processing is primarily useful for **traditional OCR engines** (Tesseract OCR and Windows OCR). If you're using **modern OCR engines** like Fast OCR or **AI-based engines** (Google Cloud Vision, Azure Cloud Vision, LLM-based engines), you can skip pre-processing as these engines handle various image conditions automatically.

<div data-full-width="false"><figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2Fw2eEKNluzEdP912QBGdC%2Focr-preprocessing-sample.jpg?alt=media&#x26;token=7a41f28a-4505-468f-ae28-96edc86a266c" alt=""><figcaption></figcaption></figure></div>

#### **When to Use Pre-processing**

Use pre-processing when:

* You're using **Tesseract OCR** or **Windows OCR**
* Game text has colored or complex backgrounds
* There's low contrast between text and background
* OCR accuracy is poor without adjustments

Skip pre-processing when:

* You're using **Fast OCR**, **EasyOCR**, or other modern engines
* You're using **AI-based engines** (Qwen 2.5 VL, GPT-4 Vision, Claude Vision)
* You're using **cloud-based engines** (Google Cloud Vision, Azure Cloud Vision)

***

### Pre-processing Options

#### **Image Upscaler** (OCR Master)

Increases the resolution or size of the captured image. Higher resolution can help the OCR engine recognize small or blurry text more accurately.

#### **Image Filter** (OCR Master)

Removes background colors and enhances text visibility. There are three filter options:

* **Black Text Filter**
  * Converts the image to show black text on a white background
* **White Text Filter**
  * Converts the image to show white text on a black background
* **Color Text Filter**
  * Preserves text colors while removing background

<figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2FIsxr1qJ3C6DIThyZrWfd%2Focr-preprocessing-white-2.jpg?alt=media&#x26;token=f2f6ff92-92ae-4e6c-9324-8e64407d15f0" alt=""><figcaption></figcaption></figure>

<div data-full-width="false"><figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2FIBKW86HZKEfrxHf81au0%2Focr-preprocessing-white-1.jpg?alt=media&#x26;token=375bb2da-d80a-4a96-9ecd-aa524b5a4dd0" alt=""><figcaption></figcaption></figure> <figure><img src="https://4121582948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKz66WcKqTPRwdFrHi4mM%2Fuploads%2FYS5uNjg81GhCM0BTH5aN%2Focr-preprocessing-black-1.jpg?alt=media&#x26;token=bbe05f93-db4f-487d-a801-c542d2fea109" alt=""><figcaption></figcaption></figure></div>

#### Image Adjustments

Fine-tune the captured image for better text recognition:

* **Greyscale**&#x20;
  * Converts the image to black and white (removes all colors)
* **Normalize**
  * Automatically adjusts image brightness and contrast
  * Adjust the threshold value to make text stand out more clearly
* **Invert**
  * Swaps black and white colors in the image
* **Threshold**
  * Controls the contrast between text and background
  * Adjust the threshold value to make text stand out more clearly
* **Lightness**
  * Adjusts the overall lightness of the image
* **Brightness**
  * Adjusts how bright or dark the image appears
* **Sharpen**
  * Makes text edges more defined and clear
