A 3x3 median left 38,475,640 of the 63,016,384 pixels exactly as they were, 61.0566 percent of the batch. The other 24,540,744 changed, by an average of 2.1356 levels. Larger kernels changed more and erased more: the 5x5 median touched 31,266,828 pixels, 27.4078 percent more than the 3x3, and cut the edge signal to 46.00 percent against 67.01 percent.
The trap is that the same setting is not the same operation across files. The 3x3 median moved 54.4678 percent of a 128 pixel icon and 0.0004 percent of a transparent logo. And every output was rewritten: six settings, six folders larger than the 19.97 MB they came from, the gentlest at 1.6375 times.
This page runs one folder through six clean-up settings and records, per file, what moved, what stayed, and how much edge survived. Its closest neighbours are the batch blur measurement, which is the same neighbourhood arithmetic used on purpose, and the batch sharpen measurement, which pushes the other way. If you are choosing between the two families, read the edge column in section 2 first: the median and the Gaussian do not differ mainly in how much they change, but in what they leave standing.
One note on scope. The tools that show up for this kind of job split into two kinds: browser batch tools that run a fixed neighbourhood filter on your files, and learned models that try to tell noise from detail. This page measures the first kind, and it does not test any particular site's implementation. What follows is the arithmetic those tools all perform, so the numbers apply to any of them that uses a median, a Gaussian or a box blur.
For filing and export questions around the same files, see the EXIF viewer and the image info page.
Twelve files, 20,934,926 bytes on disk, eleven of which decoded into 63,016,384 pixels. Each file was read, converted to RGBA for comparison, and pushed through six settings: a 3x3 median, a 5x5 median, a Gaussian with radius 1.0, a Gaussian with radius 2.0, three passes of a 3x3 box blur, and a median applied to the luma channel only. Nothing was colour-managed, nothing was resampled, and no setting was tuned per file.
One detail matters for everything that follows. The two portrait files are byte-identical copies, and they produced identical change counts and identical hashes, down to the last digit. Whatever else these settings do, they do the same thing twice.
Six settings, the same 63,016,384 pixels, one run each. The changed column counts pixels whose value moved at all, at any of the three channels. Unchanged is what is left: pixels that came out bit-identical to their input.
| Setting | Changed pixels | Share changed | Unchanged | Mean change per pixel | Edge energy kept |
|---|---|---|---|---|---|
| 3x3 median | 24,540,744 | 38.9434% | 38,475,640 | 2.1356 | 67.01% |
| 5x5 median | 31,266,828 | 49.617% | 31,749,556 | 4.6408 | 46.00% |
| Gaussian 1.0 | 23,600,930 | 37.4521% | 39,415,454 | 3.8455 | 54.16% |
| Gaussian 2.0 | 32,188,244 | 51.0792% | 30,828,140 | 6.7856 | 29.02% |
| Box 3x3, three passes | 31,023,851 | 49.2314% | 31,992,533 | 5.4939 | 39.29% |
| Median 3x3 on luma only | 18,716,506 | 29.701% | 44,299,878 | 2.1142 | 67.18% |
Mean change per pixel is the average absolute difference across all three channels, in levels out of 255. Edge energy kept is the mean absolute luma gradient after the setting divided by the same figure before it, averaged over files weighted by pixel count.
Read the last two columns against each other and the six collapse into two groups. Gaussian 1.0 and the 3x3 median changed almost the same number of pixels, 23,600,930 against 24,540,744, a difference of 939,814 or 3.8296 percent of the median's count. But the Gaussian's average change per pixel was 1.8 times the median's, and it kept 12.85 points less of the edge signal. Same reach, rougher ink.
There is a cheaper observation hiding in this table. The box filter is Gaussian 1.0 run three times, and it lands at 49.2314 percent changed with 39.29 percent of the edge energy, between the two Gaussians on both counts, at 5.4939 mean change per pixel. If a tool offers a passes field instead of a radius, that is what the field is doing: three passes of a 3x3 box sit closer to a single 5x5 window than to the single pass it looks like.
Pillow's own documentation says as much about its Gaussian: the function is written as a sequence of extended box filters that approximates a Gaussian kernel, with a citation for the accuracy question. So the near-agreement between box and Gaussian is not a coincidence of this run. It is the implementation.
The table above says how much changed. It says nothing about whether the change was the right change. For that, take a clean 512 x 512 crop of the landscape photo, add noise of a known strength, run each setting, and compare the result with the clean original. Lower is better: the number is the root-mean-square error against the untouched crop, and the percentage is how much of the injected noise each setting removed.
| Noise strength | Error before any filter | 3x3 median | 5x5 median | Gaussian 1.0 | Gaussian 2.0 |
|---|---|---|---|---|---|
| 2 | 1.341 | 12.674 (-8831.23%) | 25.989 (-37458.77%) | 6.581 (-2308.43%) | 30.255 (-50800.34%) |
| 5 | 3.32 | 12.819 (-1391.19%) | 25.95 (-6011.0%) | 6.893 (-331.14%) | 30.268 (-8213.65%) |
| 10 | 6.608 | 13.303 (-305.32%) | 25.912 (-1437.73%) | 7.817 (-39.95%) | 30.3 (-2002.6%) |
| 20 | 13.003 | 14.905 (-31.39%) | 26.091 (-302.63%) | 10.669 (32.67%) | 30.45 (-448.4%) |
A negative percentage means the setting left the crop further from the clean original than the noise itself did. That is not a bug in the measurement; it is detail being removed faster than noise at low noise levels. Positive is better.
This is the part most bulk previews hide. On a photo that is only slightly grainy, every setting in the table made it worse. The 3x3 median turned an error of 1.341 into 12.674, and Gaussian 2.0 turned it into 30.255, 22.6 times the noise it was asked to remove. Only at a noise strength of 20 did Gaussian 1.0 become useful, cutting the error by 32.67 percent, and only then did the 3x3 median stop being actively harmful, still 31.39 percent on the wrong side.
A second test makes the same point with a different noise shape. Salt-and-pepper noise is not a gentle wobble; it is individual pixels dragged to pure black or pure white. Against that, the 3x3 median behaves exactly as advertised: a 2.5 percent dose left an error of 6.403 against 9.667 unfiltered, a 56.13 percent cut, and the cut rises to 92.01 percent at a 20 percent dose. That is the case the median was designed for, and it is the one case here where the result is unambiguously an improvement.
So the honest summary of section 3 is a boundary, not a recommendation. Below a certain noise level these settings delete more than they clean. Above it, and for noise shaped like isolated bad pixels rather than a fine grain, they work. Where that boundary falls for your own photos depends on the file.
Now the folder, with the 3x3 median applied identically to every file. This is the number to look at before batching anything.
| File | Pixels | Changed | Share | Largest single change | Gaussian 1.0, share |
|---|---|---|---|---|---|
| small_icon.png | 16,384 | 8,924 | 54.4678% | 157 | 60.9985% |
| photo_square.png | 9,000,000 | 4,537,297 | 50.4144% | 162 | 47.5063% |
| exif_orient6.jpg | 3,000,000 | 1,282,963 | 42.7654% | 159 | 41.664% |
| photo_portrait.jpg | 12,000,000 | 4,888,711 | 40.7393% | 160 | 37.9664% |
| photo_landscape.jpg | 12,000,000 | 4,789,849 | 39.9154% | 161 | 37.497% |
| screenshot.webp | 1,440,000 | 564,643 | 39.2113% | 188 | 41.8356% |
| gray_8bit.jpg | 12,000,000 | 3,579,529 | 29.8294% | 160 | 31.8594% |
| gray_16bit.png | 480,000 | 109 | 0.0227% | 1 | 0.7481% |
| animation.gif | 120,000 | 4 | 0.0033% | 200 | 2.48% |
| logo_alpha.png | 960,000 | 4 | 0.0004% | 216 | 2.2646% |
| broken.jpg | failed to decode at read time, not processed | ||||
The shares run from 0.0004 percent to 54.4678 percent, a spread of 136,169.5 times, and the three bottom files are not badly photographed. They are flat: a transparent logo drawn on a uniform field, a 16-bit grey ramp, and a 400 x 300 animation with large single-colour areas. A neighbourhood filter has nothing to average there, so it barely moves. In a batch of product shots on white, that is the whole batch.
Three details in that table deserve a second look. The icon and the logo both changed four pixels in the same run, but the icon has 16,384 pixels and the logo 960,000, so the same effort lands as 54.4678 percent on one and 0.0004 percent on the other. The 16-bit grey file changed 109 pixels and none of them by more than 1 level, because the filter ran on 8 bits of a 16-bit ramp that had nothing fine enough to erode. And the largest single change reached 216 on the logo, which sounds violent until you notice that it was on one of four pixels out of 960,000.
Four file features sit outside what these settings are for, and each behaves in a way worth knowing before a folder run.
| File | Before | After | What it means |
|---|---|---|---|
| logo_alpha.png | RGBA, 607,580 fully transparent pixels | RGBA, alpha unchanged | 4 pixels of colour moved under the transparency; everything else identical |
| animation.gif | 6 frames, 120,000 pixels | 1 frame in the output | 4 of 120,000 pixels changed, 0.0033 percent, because the frame is mostly flat |
| gray_16bit.png | 16 bits per sample, 480,000 pixels | 8-bit output | 109 pixels moved, none by more than 1 level |
| exif_orient6.jpg | orientation tag 6 | tag not carried | 2000 x 1500 as stored, 42.7654 percent of pixels changed |
The transparency result is the cleanest one in the whole run: 4 changed pixels out of 607,580 transparent ones. A median does not invent colour under an alpha of zero, so the veil you designed survives untouched. The frame result is the opposite, and it is about the file rather than the filter. The output is one frame; the other five are simply gone, and no setting in this table brings them back.
Bit depth collapses, too. The 16-bit grey file came through with 109 pixels moved and a maximum change of 1 level, which looks like a success until you notice that the output is 8-bit. The filter did not damage that ramp; the save did, by dropping it to 256 levels. On a file whose only content is the number of levels, that is the whole file.
Every output was written as an 8-bit PNG with default settings, and the input was whatever the folder already held. That comparison is not fair to JPEG sources, which is exactly the comparison a batch tool performs, so the numbers below are what a folder run actually costs.
| Setting | Output bytes | Against the 20,934,926 input bytes |
|---|---|---|
| Median 3x3 on luma only | 48,564,137 | 2.3198× |
| 3x3 median | 47,269,951 | 2.2579× |
| Gaussian 1.0 | 45,236,303 | 2.1608× |
| 5x5 median | 41,390,943 | 1.9771× |
| Box 3x3, three passes | 37,955,543 | 1.813× |
| Gaussian 2.0 | 34,281,142 | 1.6375× |
Same twelve files, same run. Every output saved as an 8-bit RGB PNG with Pillow 13.0.0 defaults, bytes counted after the save. Input bytes are the on-disk sizes of the same files, including the 1,200-byte truncated JPEG that never decoded.
Six settings, six folders bigger than the one they came from, and the gentlest is still 1.6375 times. The averages hide the interesting part, though, because the per-file ratios split cleanly by source format. The 3x3 median made the landscape JPEG 4.098 times its size and the screenshot 6.335 times, while it made the 3000 x 3000 PNG 0.872 times and the six-frame GIF 0.107 times. A PNG source has little to lose; a JPEG source loses its compression on the way through.
So five of the ten processed files came out smaller and five came out larger, and the folder still more than doubled. That is not a contradiction, it is the shape of the batch: the two 12-megapixel JPEGs and the grey JPEG carry most of the original bytes, and all three grew by between 2.522 and 4.098 times.
Whether that matters is a delivery question, and it does not depend on the filter. A re-encoded file is not the original, no matter how small the difference, and a folder that grew 2.2579 times is a folder that needs a second decision about export format before it ships. Keep the originals until the batch has been looked at.
Every tool that offers this at scale offers at least two of these six. The differences inside each family are gentle; the differences between families are not.
| If your files are | Start with | Why, from this run |
|---|---|---|
| isolated bad pixels, specks, hot pixels | 3x3 median | Cut salt-and-pepper noise by 56.13% at a 2.5% dose and 92.01% at 20%, the only unambiguous win in the measurement |
| fine grain on a normal photo | Gaussian 1.0, then compare | 37.4521% changed against the median's 38.9434%, 3.8296% fewer pixels moved, though it costs more edge (54.16% kept against 67.01%) |
| a mix of logos, screenshots and photos | Sort first, then run | The same setting changed 54.4678% of an icon and 0.0004% of a logo |
| a folder you cannot easily restore | Gaussian 2.0, if anything | The smallest growth of the six, at 1.6375× the input bytes, and it still changed 51.0792% of the pixels |
| 16-bit scans or animated files | Do not batch these | Depth fell to 8 bits and six frames became one, on settings that otherwise did nothing to them |
The luma-only median is the odd one out and deserves its own line. It kept 67.18 percent of the edge energy, the highest of the six, and changed the fewest pixels, 29.701 percent. On the colour photographs that is a real advantage. But the colour noise it leaves behind is exactly the part the eye notices as blotches, so it trades one visible defect for another. Whether that trade is good depends on how much of your noise is chroma, and this run did not separate the two.
One 4000 x 3000 photo, 12,000,000 pixels, on one machine, three settings back to back.
| Setting | Seconds | Pixels per second |
|---|---|---|
| 3x3 median | 1.977 | 6,070,000 |
| Gaussian 1.0 | 0.641 | 18,720,000 |
| Box 3x3, three passes | 0.957 | 12,540,000 |
The median costs 3.08 times what the Gaussian costs per photo, which is what a sort of nine values per pixel should cost next to a weighted average. On the scale of a folder this is small. Eleven files and six settings ran in 172.31 seconds. Two runs of the same setting on the same file produced byte-identical output, hash 42e723c5532f918de1113275dfe9985ad6e98656c4a4c88d8bde5130e94cd7bd both times, in 2.02 and 2.033 seconds. Nothing here wanders between runs.
See all measured guidesIn this measurement it means the tiny sample-to-sample wobble that sits on top of a real edge. A clean 512 x 512 crop was degraded with known noise and run through six settings. A 3x3 median cut that noise by 69.71 percent at a standard deviation of 2 and by 82.77 percent at 20, while Gaussian 2.0 left 50800.34 percent more error than the unfiltered crop at 2 and 448.4 percent more at 20. Anything below the wobble is what you keep; anything at the same scale as the wobble is what the filter erases with it.
Grain is the older name, from film, and it is a pattern; noise is the flat, random version a sensor produces in dim light. This page treats both as small variations that a neighbourhood filter can average away, and its point is that a neighbourhood filter cannot tell one from a texture. On the same photo, 3x3 median changed 39.9154 percent of the 12,000,000 pixels while a median applied to the luma channel only changed 28.951 percent, because the colour noise survived the second route.
It means replacing each pixel with a number derived from its neighbours instead of its own value. Every setting measured here does exactly that, and the size of the neighbourhood decides everything: the 3.0 pixel kernel of a 3x3 median changed 24,540,744 pixels of the batch, a 5x5 kernel changed 31,266,828, 27.4078 percent more. None of them learned anything about the image, which is why the same setting gives wildly different results from file to file.
Noise is high-frequency, so removing it is supposed to keep the edges. These settings do not offer that: edge energy on the batch fell to 67.01 percent with the 3x3 median, 54.16 percent with Gaussian 1.0 and 29.02 percent with Gaussian 2.0, so the strongest setting threw away about seven tenths of the edge signal as well. Blur is the same trade without the claim. The one setting that kept edges nearly intact, a median on the luma channel, kept 67.18 percent and changed the fewest pixels, 29.701 percent.
This page measures filters, not cameras, so the cause is out of scope and it will not guess one. What it can say is that the amount is measurable. A mild noise level of 2 standard deviations took a 3x3 median to remove 69.71 percent of it, while a heavy level of 20 only got 82.77 percent and left a residue of 18.185 against a clean reference. If your pictures look grainy at a hundred percent zoom and fine at fit-to-screen, the noise is smaller than a screen pixel and the first two settings in the table are the ones to try.
For a folder, the two settings worth comparing first are a 3x3 median and Gaussian 1.0. On 63,016,384 pixels they changed 38.9434 percent and 37.4521 percent respectively, only 3.8296 percent apart in count, but the median kept 67.01 percent of the edge energy against 54.16 percent and its average change per pixel was 2.1356 against 3.8455. The cost runs with pixels, not files: a single 12,000,000-pixel photo took 1.977 seconds for the median and 0.641 for the Gaussian, on one machine.
One 4000 x 3000 photo, 12,000,000 pixels: 1.977 seconds for a 3x3 median, 0.641 seconds for Gaussian 1.0, 0.957 seconds for three passes of a 3x3 box. The whole batch of eleven readable files, 63,016,384 pixels, ran once in 172.31 seconds with six settings, so the wall clock grows with total pixel count and setting count rather than with the number of files. Forty 128 pixel icons are 655,360 pixels in total and cost less than a twentieth of one photo.
Yes, and the arithmetic is the same for every file, which is the problem. One 3x3 median setting changed 54.4678 percent of a 128 pixel icon, 39.9154 percent of a landscape photo and 0.0004 percent of a transparent logo in the same run, a spread of 136,169.5 times between the largest and smallest share. A per-file check is the only way to know which of your files belong in the weak group; the table below flags the two shapes where a filter does almost nothing at all.
Every setting here rewrites the whole file, and all six made the folder bigger. Against the 20,934,926 input bytes, the 3x3 median came out 2.2579 times larger, Gaussian 2.0 was the smallest at 1.6375, and the luma median produced 2.3198 times the input. Quality in the visible sense also moves: the batch's average change per pixel was 2.1356 levels for the 3x3 median and 6.7856 for Gaussian 2.0, and the largest single-pixel change reached 216 on a 1200 x 800 logo.
This page did not test a learned model, so it will not claim what one can do. What it can show is what a local neighbourhood filter cannot: it has no notion of which fine structure is noise. The strongest setting, Gaussian 2.0, changed 51.0792 percent of the batch and cut edge energy to 29.02 percent, so about 70.98 percent of the edge signal went with the noise. A median on the luma channel kept 67.18 percent of the edges and changed 29.701 percent, which is the closest this run gets to both at once.