IRONSOFTWAREHOME
OCR a Region of an Image
using IronOcr;
using IronSoftware.Drawing;
using System;

var ocrTesseract = new IronTesseract();

using var ocrInput = new OcrInput();
// A 41% improvement on speed by specifiying a pixel region
var ContentArea = new Rectangle(x: 215, y: 1250, width: 1335, height: 280);
ocrInput.LoadImage("img/example.png", ContentArea);

var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
Imports IronOcr
Imports IronSoftware.Drawing
Imports System

Dim ocrTesseract = New IronTesseract()

Using ocrInput = New OcrInput()
    ' A 41% improvement on speed by specifiying a pixel region
    Dim ContentArea = New Rectangle(x:=215, y:=1250, width:=1335, height:=280)
    ocrInput.LoadImage("img/example.png", ContentArea)

    Dim ocrResult = ocrTesseract.Read(ocrInput)
    Console.WriteLine(ocrResult.Text)
End Using
NuGet Download
PM > Install-Package IronOcr
OCR a Region of an Image

OCR a Region of an Image

This example demonstrates how to improve OCR speed by choosing a specific area of an image to perform OCR (Optical Character Recognition) in .NET. These are called ContentAreas or CropAreas.

Discover How to Use Input Images with IronOCR
View on GitHub

Ready to Get Started?

Nuget Downloads 6,236,385Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required