IronOCR on Windows: DeNoise() Amplifies Background Noise into Speckle (Colored-Paper Scans)
Note: From IronOCR v2026.10.2, DeNoise() has an opt-in adaptive mode for this type of scan: input.DeNoise(use3x3: false, adaptive: true). The default DeNoise() behavior is unchanged, so on any version you can still use AdaptiveThreshold() as shown below.
Overview
DeNoise() (aliased internally as Despeckle()) is built for one job: removing small, isolated dark specks on a clean white background. It doesn't handle continuous texture.
Colored-paper documents scanned as black and white lose their color contrast and turn into a uniform gray grain across the whole page. DeNoise()'s fixed threshold misreads that grain as widespread speckle — so it makes the image noisier, not cleaner.
Fix: use AdaptiveThreshold() instead of DeNoise().
Environment
- OS: Windows 11
- Language/Runtime: C# (.NET 8 WinForms)
Version Metadata
- Version found: 2026.6.1
- Version resolved: 2026.10.2
Cause
DeNoise() is built only for isolated dark specks on an otherwise clean background — it does not adapt to continuous texture. Colored-paper pages scanned as black and white lose their color contrast and become a uniform gray-toned grain across the whole page, which the fixed global threshold misreads as widespread speckle rather than isolated noise. This is a design limitation of the default DeNoise() for this input type, not an environment-specific bug. From v2026.10.2, the adaptive mode (DeNoise(false, true)) is designed for it.
Solution
-
From v2026.10.2: use adaptive DeNoise(). Pass
adaptive: trueto switchDeNoise()to local (Sauvola) thresholding, which is designed for pages with a continuous background texture such as colored paper scanned as black and white:input.DeNoise(use3x3: false, adaptive: true);
Plain
DeNoise()keeps its original behavior, so this has to be enabled explicitly. On earlier versions, or if the result is still noisy, useAdaptiveThreshold()as shown below. - Replace
DeNoise()withAdaptiveThreshold()for this document type:using (var input = new OcrInput())
Suggested tuning range for
{
foreach (var imagePath in pageImagePaths)
{
input.LoadImage(imagePath);
}
// Replaces input.DeNoise() for this document type
input.AdaptiveThreshold(0.15f);
var ocrResult = ocr.Read(input);
ocrResult.SaveAsSearchablePdf(outputPath);
}thresholdLimit:0.10–0.20. - If
AdaptiveThreshold()alone doesn't fully clean up other documents in your batch, applyContrast()first to widen the separation between text and background before binarizing:input.Contrast(1.3f); // try a range of 1.3f–1.4f
input.AdaptiveThreshold(0.15f);
Workarounds That Don't Work
- Applying
DeNoise()alone, with no Deskew or other filter in the pipeline — confirmed ineffective; it worsens the image by amplifying background noise.