DeNoise() Worsens Colored-Paper Scans
DeNoise() makes colored-paper documents noisier instead of cleaner when they are scanned as black and white. The page turns into uniform gray grain, and the default filter misreads that grain as speckle.
DeNoise() (aliased internally as Despeckle()) is built for one job: removing small, isolated dark specks on an otherwise clean white background. It does not adapt to continuous texture. When a colored-paper page is scanned as black and white, it loses its color contrast and becomes a uniform gray-toned grain across the whole page. The fixed global threshold reads that grain as widespread speckle rather than isolated noise, so it amplifies the background instead of removing it. This is a design limitation of the default DeNoise() for this input type, not an environment-specific bug.
Solution
Option 1: Adaptive DeNoise() (v2026.10.2+)
Pass adaptive: true to switch DeNoise() 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 mode has to be enabled explicitly. On earlier versions, or if the result is still noisy, fall back to AdaptiveThreshold().
Option 2: AdaptiveThreshold()
Replace DeNoise() with AdaptiveThreshold() for this document type:
using (var input = new OcrInput())
{
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);
}Using input As New OcrInput()
For Each imagePath In pageImagePaths
input.LoadImage(imagePath)
Next
' Replaces input.DeNoise() for this document type
input.AdaptiveThreshold(0.15F)
Dim ocrResult = ocr.Read(input)
ocrResult.SaveAsSearchablePdf(outputPath)
End UsingUsing input As New OcrInput()
For Each imagePath In pageImagePaths
input.LoadImage(imagePath)
Next
' Replaces input.DeNoise() for this document type
input.AdaptiveThreshold(0.15F)
Dim ocrResult = ocr.Read(input)
ocrResult.SaveAsSearchablePdf(outputPath)
End UsingAdaptiveThreshold() binarizes against a local threshold, so it handles the page-wide grain that trips up the fixed-threshold filter. A good tuning range for thresholdLimit is 0.10 to 0.20.
If AdaptiveThreshold() alone does not fully clean up other documents in your batch, apply Contrast() 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);
DeNoise() alone, with no Deskew or other filter in the pipeline, is confirmed ineffective for this input: it worsens the image by amplifying background noise.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.