IRONSOFTWAREHOME

Fast OCR Configuration in C# for Optimal Performance

Curtis Chau
Curtis Chau
Updated: August 26, 2026

IronOCR's fast configuration can speed up OCR processing - by about 17% in our 10-image benchmark below - with minimal accuracy impact, by using EnglishFast language mode and disabling unnecessary features like barcode reading. This optimization is ideal for high-volume processing where time is critical.

IronOCR works effectively out of the box. When speed is prioritized over absolute accuracy, IronOCR offers a fast configuration. This setting provides significant scanning performance gains with minimal accuracy impact, making it much quicker than the standard OCR configuration.

This article demonstrates how to set up fast configuration and compares benchmark results between fast and standard IronOCR configurations. Whether you're processing scanned documents, PDFs, or images, these optimizations can significantly improve your application's performance.


Quickstart: Configure Fast OCR in C#

The main component for fast configuration is the Language property. Setting the Language property to OcrLanguage.EnglishFast prioritizes speed over a small potential cost in accuracy. This allows IronOCR to read in bulk much more quickly, which is especially useful in mission-critical applications where time is essential.

Along with setting the fast language, you can gain further speed by disabling unnecessary configurations, such as ReadBarCodes. Let IronOCR auto-detect the page segmentation to keep the setup simple. For more advanced configuration options, see our Tesseract detailed configuration guide.

The code example below processes the following input image:

What Input Format Should I Use?

Moby Dick opening text displayed in white on dark background showing Ishmael's introduction

What Code Do I Need for Fast Configuration?

  1. 1Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. 2Copy and run this code snippet.

    /* :path=/static-assets/ocr/content-code-examples/how-to/ocr-fast-configuration.cs */
    using IronOcr;
    using System;
    
    var ocrTesseract = new IronTesseract();
    
    // Fast Dictionary
    ocrTesseract.Language = OcrLanguage.EnglishFast;
    
    // Turn off unneeded options
    ocrTesseract.Configuration.ReadBarCodes = false;
    
    // Assume text is laid out neatly in an orthogonal document
    ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto;
    
    using var ocrInput = new OcrInput();
    ocrInput.LoadImage("image.png");
    
    var ocrResult = ocrTesseract.Read(ocrInput);
    Console.WriteLine(ocrResult.Text);
    C#
  3. 3Deploy to test on your live environment

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

What Output Can I Expect?

Visual Studio editor displaying opening passage from Moby Dick novel

This is the text output extracted from above. The OCR engine accurately captures the literary text while maintaining the original formatting and structure. The fast configuration provides excellent results for clear, high-contrast text like this example.


How Does Fast Configuration Compare to Standard?

To demonstrate the real-world impact, we benchmark the performance of standard against fast configuration. We use a set of 10 sample images, each containing several paragraphs, to compare performance and visualize the trade-offs of using fast configuration.

For the standard configuration, we initialize IronTesseract with its default settings, without applying any speed-oriented properties. This benchmark approach is similar to our performance tracking guide, which shows how to monitor OCR operations in real-time.

Here are the sample inputs we use to run the test. These images represent typical document scenarios you might encounter when processing multi-page documents or batch operations.

How Do I Run the Benchmark?

using IronOcr;
using System;
using System.Diagnostics;
using System.IO;

// --- Tesseract Engine Setup ---
var ocrTesseract = new IronTesseract();
ocrTesseract.Language = OcrLanguage.EnglishFast;
ocrTesseract.Configuration.ReadBarCodes = false;
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto;

// --- 1. Define folder and get files ---
string folderPath = @"images"; // IMPORTANT: Set this to your image directory
string filePattern = "*.png";    // Change to "*.jpg", "*.bmp", etc. as needed
string outputFilePath = "ocr_results.txt"; // The new results file

// Get all image files in the directory
var imageFiles = Directory.GetFiles(folderPath, filePattern);

Console.WriteLine($"Found {imageFiles.Length} total images to process...");
Console.WriteLine($"Results will be written to: {outputFilePath}");

// --- 2. Start timer and process images, writing to file ---
// Open the output file *before* the loop for efficiency
using (StreamWriter writer = new StreamWriter(outputFilePath))
{
    var stopwatch = Stopwatch.StartNew();

    foreach (var file in imageFiles)
    {
        string fileName = Path.GetFileName(file);

        using var ocrInput = new OcrInput();
        ocrInput.LoadImage(file);

        var ocrResult = ocrTesseract.Read(ocrInput);

        // Check if any text was actually found
        if (!string.IsNullOrEmpty(ocrResult.Text))
        {
            // Write to Console
            Console.WriteLine($"--- Text found in: {fileName} ---");
            Console.WriteLine(ocrResult.Text.Trim());
            Console.WriteLine("------------------------------------------");

            // Write to File
            writer.WriteLine($"--- Text found in: {fileName} ---");
            writer.WriteLine(ocrResult.Text.Trim());
            writer.WriteLine("------------------------------------------");
            writer.WriteLine(); // Add a blank line for readability
        }
        else
        {
            // Write to Console
            Console.WriteLine($"No text found in: {fileName}");

            // Write to File
            writer.WriteLine($"No text found in: {fileName}");
            writer.WriteLine();
        }
    }

    stopwatch.Stop();

    // --- 3. Print and write final benchmark summary ---
    string lineSeparator = "\n========================================";
    string title = "Batch OCR Processing Complete";
    string summary = $"Fast configuration took {stopwatch.Elapsed.TotalSeconds:F2} seconds";

    // Write summary to Console
    Console.WriteLine(lineSeparator);
    Console.WriteLine(title);
    Console.WriteLine("========================================");
    Console.WriteLine(summary);

    // Write summary to File
    writer.WriteLine(lineSeparator);
    writer.WriteLine(title);
    writer.WriteLine("========================================");
    writer.WriteLine(summary);

    if (imageFiles.Length > 0)
    {
        string avgTime = $"Average time per image: {(stopwatch.Elapsed.TotalSeconds / (double)imageFiles.Length):F3} seconds";
        Console.WriteLine(avgTime);
        writer.WriteLine(avgTime);
    }
}

Console.WriteLine($"\nSuccessfully saved results to {outputFilePath}");

This benchmark code demonstrates several important concepts:

  1. Batch Processing: The code processes multiple images in a single operation, similar to our multithreaded OCR example, which shows how to leverage parallel processing for even greater speed improvements. The two settings work on different axes and combine well: fast configuration trades a little accuracy for speed, while MaxDegreeOfParallelism trades throughput for a smaller memory footprint.
  2. Performance Measurement: Using the Stopwatch class provides accurate timing measurements down to milliseconds, essential for comparing different configurations.
  3. Result Logging: Both console and file output ensure you can analyze the results later and verify accuracy differences between configurations.

What Performance Gains Can I Expect?

ModeTotal TimeAvg. Time / ImageTime Gain vs. StandardAccuracy Gain vs. Standard
Standard10.40 s1.040 sBaselineBaseline
Fast8.60 s0.860 s+17.31% (Faster)+0% (Identical)

The benchmark comparison between standard and fast configurations shows a significant performance advantage for fast configuration. By establishing the standard mode as the baseline (10.40 seconds total time), fast configuration completed the same batch of 10 images in just 8.60 seconds. This represents a time gain of 17.31% in this test. Crucially, for these clear, high-contrast samples the speed improvement did not compromise quality - both configurations produced identical text output. Note that EnglishFast may reduce accuracy on lower-quality or noisy inputs.

To verify the results, you can download both the fast text output and the standard text output.

When Should I Use Fast Configuration?

Fast configuration is particularly beneficial for:

  • High-volume document processing where thousands of pages need quick processing
  • Real-time applications where response time is critical
  • Web applications that need to maintain responsive user experiences
  • Batch processing systems that run on tight schedules

For more complex scenarios involving multiple languages, low-quality scans, or specialized document types like license plates or passports, you may want to use standard configuration to ensure maximum accuracy.

IronOCR makes switching between configurations simple - just change a few properties and your application can adapt to different performance requirements without major code changes.

Frequently Asked Questions

What is the main benefit of using IronOCR's fast configuration in C#?

The primary benefit of using IronOCR's fast configuration is a performance improvement of approximately 17%, as shown in benchmark tests. This is achieved with minimal impact on accuracy, making it ideal for high-volume OCR tasks where speed is critical.

How does IronOCR's EnglishFast mode enhance OCR processing speed?

IronOCR's EnglishFast mode prioritizes speed by simplifying language processing. It enables faster text extraction with a slight trade-off in accuracy, which is negligible for clear, high-contrast text.

Why should you disable unnecessary features like barcode reading in fast configuration?

Disabling unnecessary features like barcode reading in IronOCR's fast configuration reduces the processing overhead, allowing the OCR engine to focus solely on text extraction, thereby speeding up the entire process.

What types of applications benefit most from IronOCR's fast configuration?

Applications that benefit most from fast configuration include high-volume document processing, real-time systems, web applications requiring rapid responses, and batch processing systems with tight schedules.

How does IronOCR maintain accuracy while boosting speed with fast configuration?

IronOCR maintains accuracy by optimizing language processing with EnglishFast mode and focusing on text areas while extracting information, ensuring that high-contrast text is accurately read even at faster speeds.

What are the steps involved in setting up IronOCR's fast configuration?

To set up IronOCR's fast configuration: install the OCR library via NuGet, initialize the OCR engine, set the Language to EnglishFast, disable the ReadBarCodes property, and proceed with loading and processing images.

Can IronOCR's fast configuration handle batch processing efficiently?

Yes, IronOCR's fast configuration is designed for efficient batch processing, allowing multiple images to be processed in a single operation with enhanced speed due to reduced computational load per image.

How does benchmark testing demonstrate the performance of fast configuration?

Benchmark testing with a set of sample images revealed that fast configuration can process images 17% quicker than the standard mode, demonstrating its superior speed without compromising text output accuracy.

When should the standard OCR configuration be preferred over fast configuration?

The standard OCR configuration should be used in scenarios requiring high accuracy, such as processing low-quality scans, recognizing multiple languages, or handling specialized documents like passports or license plates.

Is it easy to switch between fast and standard configurations in IronOCR?

Yes, IronOCR allows easy switching between configurations by changing a few properties, enabling swift adaptation to varying performance needs without complex code adjustments.

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