---
title: "Skip small embedded images during PDF OCR in C#"
url: https://recursiveai.org/oneocr/cookbook/skip-small-images-in-pdf-ocr/
description: "Skip small embedded images during PDF OCR in C# with MinImagePoints. Run an example that reads the main scan but skips a short image label."
version: "1.1.0"
---

# Skip small embedded images during PDF OCR in C#

**OneOcr** is a free, open-source OCR library for .NET from Recursive AI. MIT or Apache-2.0, no native dependencies.

[NuGet](https://www.nuget.org/packages/RecursiveAI.OneOcr.Pdf) · [GitHub](https://github.com/recursive-ai-oss/oneocr-csharp) · [Docs](https://recursiveai.org/oneocr/docs/) · [Download example (.zip)](https://recursiveai.org/oneocr/cookbook/skip-small-images-in-pdf-ocr/skip-small-images-in-pdf-ocr.zip)

Raise `MinImagePoints` from the default 24 points to read “Warehouse inventory” but skip “Shipping department” in the zip’s `labels.pdf`.

```shell
dotnet add package RecursiveAI.OneOcr.Pdf
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported.

```csharp
using OneOcr;
using OneOcr.Pdf;
var engine = OcrEngine.LoadBundled();
var options = new PdfOcrOptions
{ MinImagePoints = 36 };
var page = PdfOcr.Read(
    "labels.pdf", engine, options)[0];
Console.WriteLine(page.ToText());
```

Unzip [the example](https://recursiveai.org/oneocr/cookbook/skip-small-images-in-pdf-ocr/skip-small-images-in-pdf-ocr.zip), then `dotnet run`.

Prints only the words from the larger image:

```text
Warehouse inventory
```

## The full program

A point is 1/72 inch on the page, so 36 points is half an inch. The two images are each about 312 points wide. The inventory image is 48 points tall, and the department label is 32 points tall. There’s no selectable text on the page. The program reads it twice, changing only the minimum image size.

```csharp
using OneOcr;
using OneOcr.Pdf;

var engine = OcrEngine.LoadBundled();
foreach (int points in new[] { 36, 24 })
{
    var options = new PdfOcrOptions { MinImagePoints = points };
    var page = PdfOcr.Read("labels.pdf", engine, options)[0];
    Console.WriteLine($"Minimum: {points} points");
    Console.WriteLine(page.ToText());
    foreach (var note in page.Diagnostics)
        Console.WriteLine(note);
}
```

```text
Minimum: 36 points
Warehouse inventory
OCR301: 1 regions were read from pixels at 300 DPI (2 words).
Minimum: 24 points
Warehouse inventory
Shipping department
OCR301: 2 regions were read from pixels at 300 DPI (4 words).
```

If a label you need goes missing, try lowering the cutoff. Even a wide image is skipped if its height is below the minimum.

## Related recipes

- [Extract text from a scanned PDF](https://recursiveai.org/oneocr/cookbook/ocr-pdf/)
- [Set the DPI for PDF OCR](https://recursiveai.org/oneocr/cookbook/set-pdf-ocr-render-dpi/)
- [Map OCR boxes to PDF page coordinates](https://recursiveai.org/oneocr/cookbook/map-ocr-boxes-to-pdf-page-coordinates/)

## The short answer

Set `PdfOcrOptions.MinImagePoints` when you call `PdfOcr.Read`. An embedded image needs to meet the minimum in both width and height to be considered for image OCR. In the sample, raising the cutoff from the default 24 points to 36 keeps the 48-point-tall scan but skips the 32-point-tall label. Nothing is removed from the PDF.

## How do I skip small embedded images during PDF OCR?

Measure an image by its displayed size on the page, not by its stored pixel dimensions. OneOcr checks the image’s on-page bounds after clipping them to the page. At a cutoff of 36 points, an image exactly 36 points tall passes the size check if it’s also at least 36 points wide. Raising `RenderDpi` doesn’t turn an undersized placement into a larger one: it changes how the page is rendered to pixels, not the bounds used by the size check.

Passing the size check doesn’t mean the image is always read. The [PDF bridge](https://recursiveai.org/oneocr/docs/pdf-bridge/#what-is-read-how) also checks whether accepted text on the page already covers it. If you’re testing a threshold, compare the actual returned words on a few pages with the original so you catch any labels or stamps you meant to keep.

## Can I skip a logo printed inside a full-page scan?

Not with this size setting alone. If the logo and the body text are in the same full-page image, the bridge sees one placed image, not a separate small logo. The threshold tests the size of that full image. It also doesn’t filter selectable PDF words by font size or filter the words recognized within an image by the size of their boxes.

For a document template with separately embedded logos and a larger scan, this cutoff is useful when the placements have distinct sizes. For a flattened scan, use the returned word boxes to decide which recognized text to keep based on where it appears on the page. That filters the result after recognition; it doesn’t stop the recognizer from seeing those pixels.
