How to Read Photos in C# with IronOCR
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.
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.
-
1Install IronOCR with NuGet Package Manager
-
2Copy and run this code snippet.
var input = new OcrInput(); input.LoadImageFrame("photo.tiff", 0); var result = new IronTesseract().ReadPhoto(input);C# -
3Deploy to test on your live environment
Start using IronOCR in your project today with a free trial
Minimal Workflow (5 steps)
- Download the C# library for reading photos
- Import the images for processing
- Use the appropriate import method based on the image type
- Use the
ReadPhotomethod to extract data from the image - Access the OcrPhotoResult property to view and manipulate the extracted data
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.
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.

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);Imports Microsoft.VisualBasic
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
' Instantiate OCR engine
Private ocr = New IronTesseract()
Private inputPhoto = New OcrInput()
inputPhoto.LoadImageFrame("ocr.tiff", 0)
' Read photo
Dim result As OcrPhotoResult = ocr.ReadPhoto(inputPhoto)
' Index number refer to region order in the page
Dim number As Integer = result.TextRegions(0).PageNumber
' Extract the text in the first region
Dim textinregion As String = result.TextRegions(0).TextInRegion
'Extract the co_ordinates of the first text region
Dim region As Rectangle = result.TextRegions(0).Region
Dim output = $"Text in First Region: {textinregion}" & vbLf & $"Text Region:" & vbLf & $"Starting X: {region.X}" & vbLf & $"Starting Y: {region.Y}" & vbLf & $"Region Width: {region.Width}" & vbLf & $"Region Height: {region.Height}" & vbLf & $"Result Confidence: {result.Confidence}" & vbLf & vbLf & $"Full Scnned Photo Text: {result.Text}"
Console.WriteLine(output)What Properties Does OcrPhotoResult Provide?

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:
| Feature | TIFF (Tagged Image File Format) | JPG/JPEG (Joint Photographic Experts Group) |
|---|---|---|
| Compression | Lossless or uncompressed (preserves quality) | Lossy compression (reduces quality for smaller file size) |
| File Size | Large (due to high quality and optional lack of compression) | Smaller, optimized for web use and fast loading |
| Image Quality | High (ideal for professional use, retains all details) | Lower (due to lossy compression, some quality is sacrificed) |
| Color Depth | Supports high color depth (up to 16-bit or 32-bit per channel) | 24-bit color (16.7 million colors) |
| Use Case | Professional photography, publishing, scanning, archiving | Web images, social media, everyday photos |
| Transparency | Supports transparency and alpha channels | Does not support transparency |
| Editing | Good for multiple edits (no quality loss with resaving) | Quality degrades with repeated edits and saves |
| Compatibility | Widely supported in professional software | Universally supported across all platforms and devices |
| Animation | Does not support animation | Does not support animation |
| Metadata | Stores 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 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.