Cleaning up noisy images
This guide focuses on a simple image-cleanup workflow. For broader OCR preprocessing techniques, refer to the OCR preprocessing overview guide.
Noise in scanned images can reduce readability and affect downstream tasks such as OCR and archival processing.
This guide shows how to:
- Load a noisy image
- Run despeckle processing
- Save the cleaned result
Prepare the project
Register the SDK license before running image-processing operations. For setup details, refer to the getting started with .NET SDK guide.
using GdPicture14;
LicenseManager licence = new LicenseManager();licence.RegisterKEY(""); // Set your license keyLoad the noisy image
Create a GdPictureImaging instance and load the source image:
using GdPictureImaging imaging = new GdPictureImaging();
int imageId = imaging.CreateGdPictureImageFromFile(@"input_noise.png");Remove noise
Run despeckle processing on the loaded image:
imaging.FxDespeckle(imageId);Save the cleaned image
Export the processed image to PNG:
imaging.SaveAsPNG(imageId, @"output.png");Additional options
Combine despeckling with other enhancement steps, such as:
- Contrast adjustment
- Thresholding
- Morphological cleanup
Tune processing order and parameters based on your document quality targets.
Conclusion
This workflow removes image speckle noise and writes a cleaned output file for viewing, OCR, or archival use.