How to Read Multi-Frame/Page GIFs and TIFFs
TIFF(Tagged Image File Format) is a popular format for high-quality images. It supports lossless compression, making it suitable for images that need to maintain their original quality, such as scanned documents or professional photography.
GIF(Graphics Interchange Format) is a format primarily used for simple, web-friendly images and animations. GIF supports both lossless and lossy compression. It's known for its ability to include animations in a single file, making it popular for short, looping animations often seen on websites and in messaging apps.
IronOCR provides the capability to read both single and multiple frame/page GIFs and TIFFs. Simply import the image file using one of our methods, and the method will do the rest.
How to Read Multi-Frame/Page GIFs and TIFFs
Install with NuGet
Install-Package IronOcr
Download DLL
Manually install into your project
Install with NuGet
Install-Package IronOcr
Download DLL
Manually install into your project
Start using IronPDF in your project today with a free trial.
Check out IronOCR on Nuget for quick installation and deployment. With over 8 million downloads, it's transforming OCR with C#.
Install-Package IronOcr
Consider installing the IronOCR DLL directly. Download and manually install it for your project or GAC form: IronOcr.zip
Manually install into your project
Download DLLRead a Single/Multi-Frame TIFF Example
To perform OCR, first instantiate the IronTesseract class. Utilize the 'using' statement to create the OcrImageInput object. This constructor supports both single-frame and multi-frame TIFF and TIF formats. Finally, apply the Read
method to perform OCR on the imported TIFF file.
:path=/static-assets/ocr/content-code-examples/how-to/input-tiff-gif-read-tiff.cs
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Import TIFF/TIF
using var imageInput = new OcrImageInput("Potter.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
Imports IronOcr
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Import TIFF/TIF
Private imageInput = New OcrImageInput("Potter.tiff")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
Read GIF Example
Similarly, simply specify the GIF file path while constructing the OcrImageInput class. The constructor will handle all the necessary steps to import the image.
:path=/static-assets/ocr/content-code-examples/how-to/input-tiff-gif-read-gif.cs
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Import GIF
using var imageInput = new OcrImageInput("Potter.gif");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
Imports IronOcr
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Import GIF
Private imageInput = New OcrImageInput("Potter.gif")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
Specify Scan Region
You can include a CropRectangle object when constructing the OcrImageInput class, allowing you to define a specific area within the image document for OCR. This can greatly enhance performance, especially for large image documents.
:path=/static-assets/ocr/content-code-examples/how-to/input-images-read-specific-region.cs
using IronOcr;
using IronSoftware.Drawing;
using System;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Specify crop region
Rectangle scanRegion = new Rectangle(800, 200, 900, 400);
// Add image
using var imageInput = new OcrImageInput("Potter.tiff", ContentArea: scanRegion);
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Output the result to console
Console.WriteLine(ocrResult.Text);
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Specify crop region
Private scanRegion As New Rectangle(800, 200, 900, 400)
' Add image
Private imageInput = New OcrImageInput("Potter.tiff", ContentArea:= scanRegion)
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Output the result to console
Console.WriteLine(ocrResult.Text)