How to Read Screenshots using IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

Screenshots are a quick and easy way to share information and quickly capture vital information to send to colleagues and peers. However, extracting text from screenshots has often proven difficult because of the dimensions and noise involved in taking them. This makes screenshots a less effective medium in the release of OCR.

However, IronOCR resolves that issue by providing specialized methods such as ReadScreenshot to combat this. ReadScreenshot is optimized for reading screenshots and extracting information from them; it also accepts common file formats.

To use this function, you must also install the IronOcr.Extension.AdvancedScan package.

Quickstart: Read Text from a Screenshot

Get started in seconds using IronOCR's ReadScreenshot—just load your screenshot into an OcrInput, call ReadScreenShot, and immediately access the extracted text, confidence score, and text regions via the OcrPhotoResult. It’s the fastest way to turn images into usable text with minimal setup.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. Copy and run this code snippet.

    OcrPhotoResult result = new IronTesseract().ReadScreenShot(new OcrInput().LoadImage("screenshot.png"));
  3. Deploy to test on your live environment

    Start using IronOCR in your project today with a free trial
    arrow pointer

In this guide, we'll quickly demonstrate how to use IronOCR for screenshot text recognition, walking through examples and the properties of the result object.

Read Screenshots Example

To read a screenshot in IronOCR, we have to apply the following steps. We utilize the ReadScreenshot method, which takes an OcrInput as a parameter for the input. This method is more optimized for screenshots than the library's standard Read counterpart.

Por favor nota

  • The method currently works for languages including English, Chinese, Japanese, Korean, and Latin-based alphabets.
  • Using advanced scan on .NET Framework requires the project to run on x64 architecture.

Input

Below is our input for the code example; we'll demonstrate the versatility of this method by mixing different text fonts and sizes.

Input

Code

:path=/static-assets/ocr/content-code-examples/how-to/read-screenshot-read-screenshot.cs
using IronOcr;
using System;
using System.Linq;

// Instantiate OCR engine
var ocr = new IronTesseract();

using var inputScreenshot = new OcrInput();
inputScreenshot.LoadImage("screenshotOCR.png");

// Perform OCR
OcrPhotoResult result = ocr.ReadScreenShot(inputScreenshot);

// Output screenshot information
Console.WriteLine(result.Text);
Console.WriteLine(result.TextRegions.First().Region.X);
Console.WriteLine(result.TextRegions.Last().Region.Width);
Console.WriteLine(result.Confidence);
Imports IronOcr
Imports System
Imports System.Linq

' Instantiate OCR engine
Private ocr = New IronTesseract()

Private inputScreenshot = New OcrInput()
inputScreenshot.LoadImage("screenshotOCR.png")

' Perform OCR
Dim result As OcrPhotoResult = ocr.ReadScreenShot(inputScreenshot)

' Output screenshot information
Console.WriteLine(result.Text)
Console.WriteLine(result.TextRegions.First().Region.X)
Console.WriteLine(result.TextRegions.Last().Region.Width)
Console.WriteLine(result.Confidence)
$vbLabelText   $csharpLabel

Output

Output

As you can see from the console output above, it extracted all instances of text from the screenshot. Let's dive deeper into the properties of OcrPhotoResult.

  • Text: The extracted text from OCR Input.
  • Confidence: A double property that indicates the statistical accuracy confidence, with a scale from 0 to 1, where 1 is the highest confidence level.
  • TextRegion: An array of TextRegion objects, which hold properties returning the areas where text is found on the screenshot. By default, all TextRegion is a derived Rectangle class from the IronOCR models. It includes the x and y coordinates, as well as the height and width of the rectangle.

Preguntas Frecuentes

¿Cómo puedo extraer texto de una captura de pantalla usando C#?

Puedes extraer texto de una captura de pantalla usando el método ReadScreenshot de IronOCR. Este método está optimizado para capturas de pantalla y admite múltiples idiomas. Comienza descargando la biblioteca IronOCR desde NuGet, luego importa tus capturas de pantalla y utiliza la función ReadScreenshot para recuperar texto.

¿Qué formatos de archivo son compatibles con el método ReadScreenshot?

El método ReadScreenshot en IronOCR está diseñado para aceptar formatos de archivo de imagen comunes, lo que lo hace versátil para la extracción de texto de varios tipos de archivos de captura de pantalla.

¿Por qué el método ReadScreenshot es preferible para capturas de pantalla?

El método ReadScreenshot está específicamente optimizado para las dimensiones y el ruido típicamente presentes en las capturas de pantalla, ofreciendo una extracción de texto más precisa en comparación con los métodos OCR estándar.

¿Qué idiomas admite IronOCR para la extracción de texto OCR?

IronOCR admite una variedad de idiomas para la extracción de texto OCR, incluyendo inglés, chino, japonés, coreano y alfabetos basados en el latín, lo que lo hace adecuado para aplicaciones diversas.

¿Cómo funciona la propiedad de confianza en IronOCR?

En IronOCR, la propiedad Confidence es un valor doble que varía de 0 a 1 e indica la probabilidad de la precisión del texto extraído. Un valor más cercano a 1 sugiere un nivel de confianza más alto.

¿Qué son los objetos TextRegion en IronOCR?

Los objetos TextRegion en IronOCR representan las áreas específicas en una captura de pantalla donde se detecta texto. Estos objetos incluyen coordenadas y dimensiones, ayudando a los usuarios a entender la disposición del texto extraído.

¿Necesito paquetes adicionales para mejorar las capacidades de IronOCR?

Sí, para utilizar funciones avanzadas de escaneo en IronOCR, debes instalar el paquete IronOcr.Extension.AdvancedScan desde NuGet, lo que mejora el rendimiento y las capacidades de la biblioteca.

¿Cómo puedo implementar IronOCR en mi proyecto de C# para leer capturas de pantalla?

Para implementar IronOCR en tu proyecto de C# para leer capturas de pantalla, primero descarga la biblioteca desde NuGet, importa tus imágenes de captura de pantalla y luego usa el método ReadScreenshot para extraer texto. Finalmente, procesa los datos extraídos usando la propiedad OcrPhotoResult.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 5,044,537 | Versión: 2025.11 recién lanzado