# Image & Video OCR

***

### Image & Video Text Recognition (OCR) <a href="#ocr" id="ocr"></a>

Heimdall uses OCR to extract text from media sent in chat. This prevents scammers from bypassing text-based filters by putting their spam inside images or videos.

* **Image processing:** Images are converted to grayscale with automatic level and contrast enhancement for maximum OCR accuracy
* **Video processing:** Heimdall extracts the middle frame of a video (for best content representation) and runs OCR on it
* **Fallback logic:** If no text is found in the initial scan, additional frames are extracted and scanned
* **Spam checking:** All extracted text is combined with the message text and checked against the full spam detection ruleset

**Supported formats:** JPG, PNG, WebP, GIF, BMP, MP4, AVI, MKV, WebM, MOV, WMV, FLV, and more.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.odin.tools/tools/heimdall-protection-bot/image-and-video-ocr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
