M 149 / 18307 Filters & Motionalgorithm output

Median Filter

filtering, restoration & motion

Typeface · Azeret Mono

Real-world algorithm demonstration, applied to a NASA portrait.
Real-world algorithm demonstration, applied to a NASA portrait.Image: NASA / Eileen Collins · scikit-image (public domain)View source ↗

Prompt

Apply Median Filter to remove isolated bright and dark specks while smoothing tiny texture variations. Give fine details a slightly simplified, flattened appearance, but keep major boundaries relatively firm and colors faithful. Avoid luminous halos, directional smearing, and excessive loss of recognizable features. Preserve the original subject and composition.

Identify

Fine details appear smoothed, hard edges remain relatively stable.

Principle

The median1 replaces each pixel with a neighborhood rank value.

Try it out

Add salt and pepper noise2 beforehand.

Classification

Calculated image processing result.

Further examples · 8 images

Median filter example
02 Median filter exampleA grid shows a plush toy subject to increasing median filter radiuses. The images demonstrate how the filter suppresses high-frequency noise while maintaining the general boundary shapes and colors of the object.Debivort at en.wikipedia · CC BY-SA 3.0 · Wikimedia Commons
Salt and pepper steps
03 Salt and pepper stepsThe image sequence shows an original photo, the same photo corrupted by salt and pepper noise, and the result after a median filter. It clearly demonstrates the filter's ability to remove impulsive noise while preserving edges.Median_filtered_salt_and_pepper.png: User Markome on en.wikipedia Noise_salt__and_pepper.png: User Markome on en.wikiped · CC BY-SA 3.0 · Wikimedia Commons
Srtm-repair-median
04 Srtm-repair-medianTopographic map data processed with a median filter to repair missing information. The result shows smoothed terrain contours where noise was removed and gaps were filled using local neighborhood rank values.Alexrk2 · Public domain · Wikimedia Commons
Median Filter, applied to “Lamps EM Belysning Viborg Denmark 2016-12-30-”
05 Median Filter, applied to “Lamps EM Belysning Viborg Denmark 2016-12-30-”Black and white speckles obscure the interior shop display of lamps. The median filter successfully removes the salt and pepper noise while preserving the rounded shapes of the lamp shades.Slaunger (photo); processed for the Atlas · CC BY-SA 4.0 · Wikimedia Commons
Median Filter, applied to “Área Recreativa de Arenas Negras 01”
06 Median Filter, applied to “Área Recreativa de Arenas Negras 01”Grainy noise covers the wooden picnic table in the dark. Applying the filter eliminates the impulsive noise, resulting in a smoothed surface where the main structural edges remain intact.El Grafo (photo); processed for the Atlas · CC BY-SA 4.0 · Wikimedia Commons
Median Filter, applied to “Allium rothii 1”
07 Median Filter, applied to “Allium rothii 1”Salt and pepper noise is scattered across the Allium flower and background. The processed result removes the pixels of noise, though the small flower petals appear slightly rounded and simplified.Gideon Pisanty (Gidip) גדעון פיזנטי (photo); processed for the Atlas · CC BY 3.0 · Wikimedia Commons
Median Filter, applied to “Houten deur van een woonhuis in Guarda. 20-09-2019. (actm.)”
08 Median Filter, applied to “Houten deur van een woonhuis in Guarda. 20-09-2019. (actm.)”A green wooden door is heavily distorted by digital noise. The median filter effectively cleans the image, maintaining the large rectangular panels and archway while smoothing the rough texture of the wall.Agnes Monkelbaan (photo); processed for the Atlas · CC BY-SA 4.0 · Wikimedia Commons