Why dark photos are noisy
Have you ever wondered why a photo taken at night looks grainy?
I had an inclination to think that at night there is less light, and that is why the picture is worse. But I did not understand (and still do not) why I often see better with my eyes than the camera takes a photo at night. I thought the electronics must be better than a human eye (fewer errors?).
So where do the errors come from? To find out, I had to learn what a pixel actually does.
A pixel is a counter
A pixel doesn’t measure brightness. It simply counts! Counts photons. Light arrives as separate photons, like raindrops, and each one that hits the silicon can knock an electron loose (the photoelectric effect). The pixel collects those electrons in a little well, like a bucket in the rain.
Now put two buckets side by side in the same rain for one second. Do they catch the same number of drops? Not quite. One gets 9, the other 11. Two pixels under the same light behave the same way: their counts differ a little. Why?
Because photons do not come uniformly. Each moment, a slightly different number of drops arrives.
I would think, if we take many shots one after another, sum them up and divide by number of the shots taken, we would get a more realistic count. (It turns out that’s a real trick: image stacking, and phone night mode does this.)
But in a single picture, if a pixel got N photons, the count varies by about √N (N ± √N).
Where does √N come from? From the Poisson distribution, somehow. That’s how random counts behave: the noise is the square root of the count. Why exactly, I don’t know yet. With 9 photons, anything from about 6 to 12 is normal:
That difference between pixels is what causes the noise: the grain in the photo.
In the dark, only a few photons are in the scene, and few of them get into the sensor and the photodiode. The noise is √N, and with a small N (the photon count per pixel), the noise is a big part of the value.
If the scene is bright, there are about 10,000 photons per pixel, and the noise, √10,000 = 100, doesn’t play a big role.
The noise doesn’t go away with more light. It grows. But the signal grows faster, so the noise % shrinks:
| Photons in a pixel (N) | Noise (√N) | Noise % |
|---|---|---|
| 9 (dark) | ± 3 | 33 % |
| 100 | ± 10 | 10 % |
| 10,000 (bright) | ± 100 | 1 % |
Here are the three pixels side by side. The wider the curve, the bigger the noise compared to the signal.
I’m not a photo person, but I have heard of ISO. As I understand it now, it’s a volume knob: the picture gets brighter, and the √N noise gets louder too. It doesn’t add a single photon.
My first guess was right
At night there is less light. Yes, I think that is still right. What I did not know was the mechanics: we actually measure a count of photons. And a count comes with a √N error: the smaller N, the bigger the error.
So the grain is not a camera error. It is what you get when you count only a few drops of light.
What I still don’t get
I still don’t understand why my eyes are better at night than a camera (with caveats: I know now, we sacrifice colours for brightness). But that is a topic in itself, and my next post.