using IronOcr;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Import TIFF/TIFusing var imageInput = new OcrImageInput("Potter.tiff");// Perform OCROcrResult ocrResult = ocrTesseract.Read(imageInput);
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);
ImportsIronOcr' Instantiate IronTesseractPrivate ocrTesseract As New IronTesseract()' Import TIFF/TIFPrivate imageInput = New OcrImageInput("Potter.tiff")' Perform OCRPrivate ocrResult AsOcrResult = 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)
using IronOcr;IronTesseract ocrTesseract = new IronTesseract();// Import multi-page TIFFusing var imageInput = new OcrImageInput("multipage-document.tiff");// Perform OCROcrResult result = ocrTesseract.Read(imageInput);// Access results by pageforeach (var page in result.Pages){Console.WriteLine($"Page {page.PageNumber}:");Console.WriteLine(page.Text);Console.WriteLine("---");}
using IronOcr;
IronTesseract ocrTesseract = new IronTesseract();
// Import multi-page TIFF
using var imageInput = new OcrImageInput("multipage-document.tiff");
// Perform OCR
OcrResult result = ocrTesseract.Read(imageInput);
// Access results by page
foreach (var page in result.Pages)
{
Console.WriteLine($"Page {page.PageNumber}:");
Console.WriteLine(page.Text);
Console.WriteLine("---");
}
ImportsIronOcrDim ocrTesseract As New IronTesseract()' Import multi-page TIFFUsing imageInput As New OcrImageInput("multipage-document.tiff") ' Perform OCR Dim result AsOcrResult = ocrTesseract.Read(imageInput) ' Access results by page For Each page In result.PagesConsole.WriteLine($"Page {page.PageNumber}:")Console.WriteLine(page.Text)Console.WriteLine("---") NextEndUsing
Imports IronOcr
Dim ocrTesseract As New IronTesseract()
' Import multi-page TIFF
Using imageInput As New OcrImageInput("multipage-document.tiff")
' Perform OCR
Dim result As OcrResult = ocrTesseract.Read(imageInput)
' Access results by page
For Each page In result.Pages
Console.WriteLine($"Page {page.PageNumber}:")
Console.WriteLine(page.Text)
Console.WriteLine("---")
Next
End Using
using IronOcr;using System.Drawing;// Configure OCR for individual frame processingIronTesseract ocrTesseract = new IronTesseract();// Load and split TIFF framesusing var multiFrameInput = new OcrImageInput("document.tiff");// Process specific pages (0-indexed)var pageIndices = new[] { 0, 2, 4 }; // Process pages 1, 3, and 5 onlyforeach (int pageIndex in pageIndices){ using var pageInput = new OcrImageInput("document.tiff", pageIndex); // Apply page-specific preprocessing if needed pageInput.DeNoise(); pageInput.Deskew(); var pageResult = ocrTesseract.Read(pageInput);Console.WriteLine($"Page {pageIndex + 1} text: {pageResult.Text}");}
using IronOcr;
using System.Drawing;
// Configure OCR for individual frame processing
IronTesseract ocrTesseract = new IronTesseract();
// Load and split TIFF frames
using var multiFrameInput = new OcrImageInput("document.tiff");
// Process specific pages (0-indexed)
var pageIndices = new[] { 0, 2, 4 }; // Process pages 1, 3, and 5 only
foreach (int pageIndex in pageIndices)
{
using var pageInput = new OcrImageInput("document.tiff", pageIndex);
// Apply page-specific preprocessing if needed
pageInput.DeNoise();
pageInput.Deskew();
var pageResult = ocrTesseract.Read(pageInput);
Console.WriteLine($"Page {pageIndex + 1} text: {pageResult.Text}");
}
using IronOcr;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Import GIFusing var imageInput = new OcrImageInput("Potter.gif");// Perform OCROcrResult ocrResult = ocrTesseract.Read(imageInput);
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Import GIF
using var imageInput = new OcrImageInput("Potter.gif");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
ImportsIronOcr' Instantiate IronTesseractPrivate ocrTesseract As New IronTesseract()' Import GIFPrivate imageInput = New OcrImageInput("Potter.gif")' Perform OCRPrivate ocrResult AsOcrResult = 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)
using IronOcr;IronTesseract ocrTesseract = new IronTesseract();// Import GIF with preprocessingusing var imageInput = new OcrImageInput("low-quality.gif");// Apply filters to improve qualityimageInput.ToGrayScale(); // Convert to grayscaleimageInput.Contrast(1.5); // Increase contrastimageInput.DeNoise(); // Remove noiseimageInput.EnhanceResolution(); // Upscale for better OCR// Perform OCR with enhanced imageOcrResult result = ocrTesseract.Read(imageInput);
using IronOcr;
IronTesseract ocrTesseract = new IronTesseract();
// Import GIF with preprocessing
using var imageInput = new OcrImageInput("low-quality.gif");
// Apply filters to improve quality
imageInput.ToGrayScale(); // Convert to grayscale
imageInput.Contrast(1.5); // Increase contrast
imageInput.DeNoise(); // Remove noise
imageInput.EnhanceResolution(); // Upscale for better OCR
// Perform OCR with enhanced image
OcrResult result = ocrTesseract.Read(imageInput);
ImportsIronOcrDim ocrTesseract As New IronTesseract()' Import GIF with preprocessingUsing imageInput As New OcrImageInput("low-quality.gif") ' Apply filters to improve quality imageInput.ToGrayScale() ' Convert to grayscale imageInput.Contrast(1.5) ' Increase contrast imageInput.DeNoise() ' Remove noise imageInput.EnhanceResolution() ' Upscale for better OCR ' Perform OCR with enhanced image Dim result AsOcrResult = ocrTesseract.Read(imageInput)EndUsing
Imports IronOcr
Dim ocrTesseract As New IronTesseract()
' Import GIF with preprocessing
Using imageInput As New OcrImageInput("low-quality.gif")
' Apply filters to improve quality
imageInput.ToGrayScale() ' Convert to grayscale
imageInput.Contrast(1.5) ' Increase contrast
imageInput.DeNoise() ' Remove noise
imageInput.EnhanceResolution() ' Upscale for better OCR
' Perform OCR with enhanced image
Dim result As OcrResult = ocrTesseract.Read(imageInput)
End Using
using IronOcr;using IronSoftware.Drawing;using System;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Specify crop regionRectangle scanRegion = new Rectangle(800, 200, 900, 400);// Add imageusing var imageInput = new OcrImageInput("Potter.tiff", ContentArea: scanRegion);// Perform OCROcrResult ocrResult = ocrTesseract.Read(imageInput);// Output the result to consoleConsole.WriteLine(ocrResult.Text);
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);
ImportsIronOcrImportsIronSoftware.DrawingImportsSystem' Instantiate IronTesseractDim ocrTesseract As New IronTesseract()' Specify crop regionDim scanRegion As New Rectangle(800, 200, 900, 400)' Add imageUsing imageInput As New OcrImageInput("Potter.tiff", ContentArea:=scanRegion) ' Perform OCR Dim ocrResult AsOcrResult = ocrTesseract.Read(imageInput) ' Output the result to consoleConsole.WriteLine(ocrResult.Text)EndUsing
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Specify crop region
Dim scanRegion As New Rectangle(800, 200, 900, 400)
' Add image
Using imageInput As New OcrImageInput("Potter.tiff", ContentArea:=scanRegion)
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Output the result to console
Console.WriteLine(ocrResult.Text)
End Using
using IronOcr;using IronSoftware.Drawing;// Define regions for form fieldsvar nameFieldRegion = new Rectangle(100, 50, 300, 40);var dateFieldRegion = new Rectangle(100, 100, 200, 40);var amountFieldRegion = new Rectangle(100, 150, 150, 40);// Create OCR instanceIronTesseract ocr = new IronTesseract();// Extract from each regionusing var tiffInput = new OcrImageInput("form.tiff");// Process each fieldvar name = ocr.Read(new OcrImageInput("form.tiff", ContentArea: nameFieldRegion)).Text.Trim();var date = ocr.Read(new OcrImageInput("form.tiff", ContentArea: dateFieldRegion)).Text.Trim();var amount = ocr.Read(new OcrImageInput("form.tiff", ContentArea: amountFieldRegion)).Text.Trim();Console.WriteLine($"Name: {name}");Console.WriteLine($"Date: {date}");Console.WriteLine($"Amount: {amount}");
using IronOcr;
using IronSoftware.Drawing;
// Define regions for form fields
var nameFieldRegion = new Rectangle(100, 50, 300, 40);
var dateFieldRegion = new Rectangle(100, 100, 200, 40);
var amountFieldRegion = new Rectangle(100, 150, 150, 40);
// Create OCR instance
IronTesseract ocr = new IronTesseract();
// Extract from each region
using var tiffInput = new OcrImageInput("form.tiff");
// Process each field
var name = ocr.Read(new OcrImageInput("form.tiff", ContentArea: nameFieldRegion)).Text.Trim();
var date = ocr.Read(new OcrImageInput("form.tiff", ContentArea: dateFieldRegion)).Text.Trim();
var amount = ocr.Read(new OcrImageInput("form.tiff", ContentArea: amountFieldRegion)).Text.Trim();
Console.WriteLine($"Name: {name}");
Console.WriteLine($"Date: {date}");
Console.WriteLine($"Amount: {amount}");
ImportsIronOcrImportsIronSoftware.Drawing' Define regions for form fieldsDim nameFieldRegion As New Rectangle(100, 50, 300, 40)Dim dateFieldRegion As New Rectangle(100, 100, 200, 40)Dim amountFieldRegion As New Rectangle(100, 150, 150, 40)' Create OCR instanceDim ocr As New IronTesseract()' Extract from each regionUsing tiffInput As New OcrImageInput("form.tiff") ' Process each field Dim name AsString = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=nameFieldRegion)).Text.Trim() Dim date AsString = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=dateFieldRegion)).Text.Trim() Dim amount AsString = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=amountFieldRegion)).Text.Trim()Console.WriteLine($"Name: {name}")Console.WriteLine($"Date: {date}")Console.WriteLine($"Amount: {amount}")EndUsing
Imports IronOcr
Imports IronSoftware.Drawing
' Define regions for form fields
Dim nameFieldRegion As New Rectangle(100, 50, 300, 40)
Dim dateFieldRegion As New Rectangle(100, 100, 200, 40)
Dim amountFieldRegion As New Rectangle(100, 150, 150, 40)
' Create OCR instance
Dim ocr As New IronTesseract()
' Extract from each region
Using tiffInput As New OcrImageInput("form.tiff")
' Process each field
Dim name As String = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=nameFieldRegion)).Text.Trim()
Dim date As String = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=dateFieldRegion)).Text.Trim()
Dim amount As String = ocr.Read(New OcrImageInput("form.tiff", ContentArea:=amountFieldRegion)).Text.Trim()
Console.WriteLine($"Name: {name}")
Console.WriteLine($"Date: {date}")
Console.WriteLine($"Amount: {amount}")
End Using
using IronOcr;using IronSoftware.Drawing;// Test different regions to find optimal coordinatesvar testRegions = new[] { new Rectangle(100, 100, 200, 50), new Rectangle(100, 160, 200, 50), new Rectangle(100, 220, 200, 50) };IronTesseract ocr = new IronTesseract();foreach (var region in testRegions){ using var input = new OcrImageInput("document.tiff", ContentArea: region); // Save highlighted region for visual verification input.HighlightTextAndSaveAsImages(ocr, $"region_{region.X}_{region.Y}.png", ResultHighlightType.Word);}
using IronOcr;
using IronSoftware.Drawing;
// Test different regions to find optimal coordinates
var testRegions = new[]
{
new Rectangle(100, 100, 200, 50),
new Rectangle(100, 160, 200, 50),
new Rectangle(100, 220, 200, 50)
};
IronTesseract ocr = new IronTesseract();
foreach (var region in testRegions)
{
using var input = new OcrImageInput("document.tiff", ContentArea: region);
// Save highlighted region for visual verification
input.HighlightTextAndSaveAsImages(ocr, $"region_{region.X}_{region.Y}.png", ResultHighlightType.Word);
}
Cropping enhances OCR performance by reducing the processing area, which speeds up execution. It also focuses detection on specific regions, uses memory more efficiently, and can eliminate irrelevant areas contributing to noise.
What preprocessing techniques can improve GIF OCR quality?
Improving GIF OCR quality involves preprocessing steps like converting to grayscale, increasing contrast, denoising, and enhancing resolution. These steps help mitigate color limitations and compression artifacts typical of the GIF format.
Why does IronOCR handle frame extraction automatically for TIFF and GIF files?
IronOCR's automatic frame extraction simplifies the development process by eliminating the need for manual handling of each frame. The library processes each frame and aggregates results, making it ideal for both single and multi-frame document workflows.
How is text from animated GIFs captured and organized by IronOCR?
IronOCR captures text from animated GIFs by extracting each frame and processing them separately. Text from each frame is captured, organized chronologically, and consolidated into a final readable format, facilitating structured data analysis.