No Login Data Private Local Save

Median Filter Denoiser – Online Remove Salt & Pepper Noise

6
0
0
0

Median Filter Denoiser

Remove salt & pepper noise from images using median filtering — 100% free, browser-based, no upload required.

Privacy Safe Instant Processing Unlimited Use

Drop your image here or click to browse

Supports JPG, PNG, WebP, BMP — Max ~20MB recommended

Frequently Asked Questions

A median filter replaces each pixel's value with the median of its neighboring pixels within a defined window (kernel). Salt & pepper noise appears as random pure black (pepper) or pure white (salt) pixels. Since these extreme values are outliers, the median operation naturally discards them while preserving edges and smooth gradients. Unlike averaging filters, the median filter doesn't blur edges because it selects an actual pixel value from the neighborhood rather than computing a blended average.

3×3 kernel — Best for light noise; preserves fine details and textures. Ideal for images with minor salt & pepper artifacts.
5×5 kernel — Good balance; handles moderate noise while retaining most structural details. Recommended for general-purpose denoising.
7×7 kernel — Strongest denoising; effective for heavy noise but may soften fine edges and thin lines. Use when noise density exceeds 10%.

Pro tip: Start with 3×3. If noise persists, move up to 5×5. Use 7×7 sparingly for severely corrupted images.

Salt & pepper noise (also called impulse noise) appears as randomly scattered white and black pixels across an image—like grains of salt and pepper. It commonly arises from:

Sensor defects in digital cameras (dead or hot pixels)
Transmission errors in analog or digital signal paths
Dust or scratches on scanned photographs and film
Bit errors during image compression or storage
Cosmic ray impacts on imaging sensors in specialized applications

Median filtering is the gold-standard technique for removing this type of noise while preserving image sharpness.

Median filter is uniquely suited for impulse noise because it replaces outlier pixels entirely rather than blending them with neighbors. A Gaussian or averaging filter would spread the noise into surrounding pixels, creating a blurred halo around each noisy spot. Key advantages of median filtering:

• Preserves sharp edges and object boundaries
• Does not introduce new pixel values (uses existing ones)
• Effectively removes extreme outliers in a single pass
• Maintains image brightness and contrast

For salt & pepper noise specifically, median filtering consistently outperforms linear smoothing methods in both visual quality and quantitative metrics like PSNR.

Applying median filtering multiple times can further reduce stubborn noise, but diminishing returns apply quickly. After 1–2 passes, most removable noise is already eliminated. Additional passes may cause:

• Unnecessary softening of fine textures
• Loss of thin lines and small details
• "Blocky" or posterized appearance in smooth gradient areas

Recommendation: Try increasing kernel size (e.g., from 3×3 to 5×5) before adding extra iterations. Use 2–3 passes only when a single pass with a larger kernel isn't sufficient.

Yes, your images are completely secure. All processing happens entirely in your browser using JavaScript and the HTML5 Canvas API. Your images are never uploaded to any server, transmitted over the network, or stored anywhere. The tool works offline once the page is loaded. You can verify this by disconnecting your internet after loading the page — the tool will continue to function perfectly. This is a core design principle: privacy by default, zero data collection.

Input: The tool accepts all common image formats — JPEG (.jpg, .jpeg), PNG, WebP, BMP, and TIFF (browser-dependent). Simply drag & drop or click to upload.

Output: Processed images are downloaded in PNG format to preserve full quality without compression artifacts. This ensures your denoised image retains all the detail recovered by the median filter. PNG is lossless and widely supported across all platforms and applications.

Median filtering is optimized for impulse noise (salt & pepper). For Gaussian noise (random intensity variations following a normal distribution), other techniques are more appropriate:

Gaussian blur / smoothing — for mild Gaussian noise
Bilateral filter — preserves edges while reducing Gaussian noise
Non-local means denoising — advanced, detail-preserving for Gaussian noise
Wavelet-based denoising — effective for mixed noise types

Applying a median filter to Gaussian noise will provide some reduction but may introduce artifacts. Use the right tool for your specific noise type.