---
title: "Reading text from images | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/ocr/usage/read-text-from-image/"
md_url: "https://www.nutrient.io/guides/dotnet/ocr/usage/read-text-from-image.md"
last_updated: "2026-05-28T01:45:39.254Z"
description: "How to extract text from images using OCR in Nutrient .NET SDK."
---

# Reading text from images

This guide demonstrates how to extract text from an image using OCR.

Use this workflow when you need to:

- Convert image-based text into editable text output

- Index scanned content for search

- Feed OCR output into validation or automation pipelines

## Project setup

Install:

- The core Nutrient Native SDK package

- `GdPicture.Resources` for OCR language resources

## Prepare the project

Register the SDK license before running OCR operations. For setup details, refer to the [getting started with.NET SDK](https://www.nutrient.io/sdk/dotnet/getting-started.md) guide.

```csharp

using GdPicture14;

LicenseManager licence = new LicenseManager();
licence.RegisterKEY(""); // Set your license key

```

## Load and prepare the image

Create imaging and OCR instances, load the source image, and set it for OCR:

```csharp

using GdPictureImaging imaging = new GdPictureImaging();
using GdPictureOCR ocr = new GdPictureOCR();

// Load the image containing text to be extracted
int imageId = imaging.CreateGdPictureImageFromFile(@"input.png");

// Apply the image to the OCR engine for processing
ocr.SetImage(imageId);

```

## Run text recognition

Execute OCR and read the recognized text result:

```csharp

// Run OCR analysis to identify and extract text
string ocrResultId = ocr.RunOCR(OCRSpecialContext.None);

// Retrieve the recognized text content
string result = ocr.GetOCRResultText(ocrResultId);

```

## Save extracted text

Write OCR output to a text file:

```csharp

// Save the extracted text to a file
File.WriteAllText(@"output.txt", result);

```

## Additional OCR options

Extend this workflow with:

- Language-specific OCR configuration for targeted recognition

- Confidence-based review logic

- Region-based OCR for specific image areas

- Layout-aware post-processing for structured documents

## Conclusion

This workflow extracts text from an image and saves it as plain text for downstream processing.
---

## Related pages

- [Applying OCR to a PDF document](/guides/dotnet/ocr/usage/apply-ocr-to-pdf.md)
- [C# barcode recognition](/guides/dotnet/ocr/usage/barcode-recognition.md)
- [Converting an image to a searchable PDF in memory](/guides/dotnet/ocr/usage/image-to-searchable-pdf-in-memory.md)
- [Converting images to searchable PDFs](/guides/dotnet/ocr/usage/image-to-searchable-pdf.md)
- [C# OCR scanning to searchable PDFs](/guides/dotnet/ocr/usage/ocr-scan.md)
- [OCR PDF in C#](/guides/dotnet/ocr/usage/pdf-to-searchable-pdf.md)
- [Reading multilingual text from images](/guides/dotnet/ocr/usage/read-text-from-image-multi-language.md)
- [Convert images into searchable PDF/A files in C#](/guides/dotnet/ocr/usage/pdfa-archiving.md)

