IRONSOFTWAREHOME

How to Read Photos in C# with IronOCR

Curtis Chau
Curtis Chau
Updated: August 2, 2026

IronOCR's ReadPhoto method extracts text from complex photo formats like TIFF and GIF, providing structured results with text regions and confidence scores, optimized for high-quality scanned documents requiring accurate OCR processing.

When dealing with large volumes of documents, particularly scanned images like TIFF files, manually extracting text becomes time-consuming and error-prone. Optical Character Recognition (OCR) automates this process, converting text from images into digital data. OCR technology handles complex images like scanned documents and photographs, turning them into searchable, editable text. This speeds up document processing and ensures accurate data extraction.

Using OCR on formats like TIFF and GIF enables quick digitization of vast data amounts, despite their size, color depth, or compression challenges. With IronOCR's ReadPhoto function, developers extract text from images and perform advanced operations like keyword searching or converting scanned data into searchable PDFs. This technology benefits industries handling legal documents, archives, or receipts where efficient data retrieval is critical.

This tutorial demonstrates using ReadPhoto and manipulating the results object. We'll discuss when to use ReadPhoto instead of standard Read from IronOCR. For general image processing, explore reading various image formats.

To use this function, install the IronOcr.Extensions.AdvancedScan package.

Quickstart: Use ReadPhoto to Extract Text from Complex Images

Get started fast: use IronOCR's ReadPhoto method on an OcrInput loaded with your image frame to extract all text and regions. It's optimized for TIFFs, GIFs, and similar photo formats.

  1. 1Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. 2Copy and run this code snippet.

    var input = new OcrInput();
    input.LoadImageFrame("photo.tiff", 0);
    var result = new IronTesseract().ReadPhoto(input);
    C#
  3. 3Deploy to test on your live environment

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

How Do I Extract Text from TIFF Images Using ReadPhoto?

Reading high-quality photo formats like TIFF and GIF is straightforward using IronOCR. First, create an OcrInput variable and load the image using LoadImageFrame. Then use the ReadPhoto method to obtain results. The multi-page TIFF OCR tutorial provides additional multi-page document examples.

Please note: - TIFF contains multiple frames; the PageNumber parameter is required with zero-based indexing. - The method currently supports English, Chinese, Japanese, Korean, and Latin Alphabet. - Using advanced scan on .NET Framework requires x64 architecture.

What Input Format Should I Use?

Since browsers don't natively support TIFF format, download the TIFF input here. The displayed version below is converted to WEBP.

Input

How Do I Implement the ReadPhoto Method?

This implementation demonstrates extracting text and region information from a TIFF image. For more examples, see our photo reading code example.

using IronOcr;
using IronSoftware.Drawing;
using System;

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

using var inputPhoto = new OcrInput();
inputPhoto.LoadImageFrame("ocr.tiff", 0);

// Read photo
OcrPhotoResult result = ocr.ReadPhoto(inputPhoto);

// Index number refer to region order in the page
int number = result.TextRegions[0].PageNumber;

// Extract the text in the first region
string textinregion = result.TextRegions[0].TextInRegion;

//Extract the co_ordinates of the first text region
Rectangle region = result.TextRegions[0].Region;

var output = $"Text in First Region: {textinregion}\n"
             + $"Text Region:\n"
             + $"Starting X: {region.X}\n"
             + $"Starting Y: {region.Y}\n"
             + $"Region Width: {region.Width}\n"
             + $"Region Height: {region.Height}\n"
             + $"Result Confidence: {result.Confidence}\n\n"
             + $"Full Scnned Photo Text: {result.Text}";

Console.WriteLine(output);

What Properties Does OcrPhotoResult Provide?

Debug output showing OCR text extraction with phone number, coordinates, and confidence score from processed image

The OcrPhotoResult class provides key properties for analyzing extracted text. For detailed information on working with OCR results, see our guide on data output and results manipulation.

Text: The extracted text from OCR input.
Confidence: Statistical accuracy confidence (0-1 scale, 1 being highest). Learn more about result confidence scores.
TextRegions: List of text regions with location data. Similar to defining OCR regions for targeted extraction.


When Should I Use ReadPhoto Instead of Read?

The main difference between ReadPhoto and standard Read is the result object and supported file formats. LoadImageFrame specifically accepts TIFF and GIF, not formats like JPEG. ReadPhoto is optimized for complex image formats, while standard Read suits simpler images and general text extraction tasks.

Why Does ReadPhoto Only Support TIFF and GIF Formats?

TIFF is a lossless format for condensing multiple pages and frames into one file. It's used for high-quality, multi-image storage like legal documents and medical images. Being more complex than JPEG, it requires different methods for text extraction. The specialized handling ensures optimal results with professional-grade image formats.

TIFF images use different compression methods, so IronOCR employs specialized algorithms to decipher text. The advanced algorithms in ReadPhoto handle TIFF compression characteristics, ensuring accurate extraction from complex multi-layered documents.

Here's a comparison between TIFF and JPEG formats:

FeatureTIFF (Tagged Image File Format)JPG/JPEG (Joint Photographic Experts Group)
CompressionLossless or uncompressed (preserves quality)Lossy compression (reduces quality for smaller file size)
File SizeLarge (due to high quality and optional lack of compression)Smaller, optimized for web use and fast loading
Image QualityHigh (ideal for professional use, retains all details)Lower (due to lossy compression, some quality is sacrificed)
Color DepthSupports high color depth (up to 16-bit or 32-bit per channel)24-bit color (16.7 million colors)
Use CaseProfessional photography, publishing, scanning, archivingWeb images, social media, everyday photos
TransparencySupports transparency and alpha channelsDoes not support transparency
EditingGood for multiple edits (no quality loss with resaving)Quality degrades with repeated edits and saves
CompatibilityWidely supported in professional softwareUniversally supported across all platforms and devices
AnimationDoes not support animationDoes not support animation
MetadataStores extensive metadata (EXIF, layers, etc.)Stores EXIF metadata but is more limited

How Do I Choose Between ReadPhoto and Read for My Application?

Consider each production use case to optimize application performance. While ReadPhoto suits complex TIFF images, it processes more slowly. JPEG offers faster processing but lower quality, which may result in low OCR confidence rates. Use image quality correction filters to improve results when needed.

The confidence property in OcrPhotoResults or any IOcrResult interface class indicates result accuracy, allowing developers to test and optimize. For highest accuracy requirements, ReadPhoto with high-quality TIFF images provides best results, especially for archival or legal document processing where precision matters.

Find the balance between efficiency and accuracy by ensuring images meet certain quality thresholds. For mixed document types, implement a hybrid approach: use ReadPhoto for critical documents requiring high accuracy and standard Read for routine tasks prioritizing speed.

Frequently Asked Questions

What is the ReadPhoto method in IronOCR?

The ReadPhoto method in IronOCR is used to extract text from complex photo formats such as TIFF and GIF, providing structured results with text regions and confidence scores for accurate OCR processing.

How does IronOCR ensure accuracy when extracting text from TIFF and GIF images?

IronOCR uses the ReadPhoto method, which is optimized for high-quality scanned documents. It provides structured OCR results with confidence scores to ensure accurate text extraction from TIFF and GIF images.

Why is OCR beneficial for processing large volumes of scanned documents?

OCR technology automates the conversion of scanned images into digital data, making document processing faster and minimizing errors, especially when dealing with large volumes of documents.

Can IronOCR convert TIFF and GIF images into searchable PDFs?

Yes, IronOCR's ReadPhoto function allows developers to extract text from TIFF and GIF images and perform advanced operations, including converting scanned data into searchable PDFs.

What are the benefits of using IronOCR for legal or archiving applications?

IronOCR facilitates efficient data retrieval for industries handling legal documents or archives by enabling accurate text extraction from high-quality, complex image formats like TIFF and GIF.

What is the difference between using ReadPhoto and Read methods in IronOCR?

The ReadPhoto method is optimized for complex formats like TIFF and GIF, while the standard Read method suits simpler images and general text extraction tasks.

How does IronOCR handle different image compressions in TIFF formats?

IronOCR employs specialized algorithms in the ReadPhoto method to handle TIFF compression characteristics, ensuring accurate text extraction from complex multi-layered documents.

What additional tools does IronOCR provide to improve OCR results?

IronOCR offers image quality correction filters to enhance OCR results, allowing for better accuracy even with lower-quality images.

Is there support for multiple languages with the ReadPhoto method?

Yes, IronOCR's ReadPhoto method supports multiple languages, including English, Chinese, Japanese, Korean, and Latin Alphabet, enhancing its usability across different languages.

How can developers view and manipulate extracted data using IronOCR?

Developers can use the OcrPhotoResult property in IronOCR to view and manipulate extracted data, allowing for detailed analysis and handling of OCR results.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

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

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronOcr
nuget.org/packages/IronOcr/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronOCR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronOCR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronOCR.dll"

Licenses from $999

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