Why a Hole Smaller Than Your Fingernail Can Project a Perfect Image
Light has only one rule: it never bends. This single fact—called rectilinear propagation—is why a pinhole can do what a thousand-dollar glass lens does: cast a sharp, real image that you can project onto a wall.
I’ve spent years watching physics simulations model this moment. The mathematics are clean and the formulas are simple. But nothing prepared me for seeing it happen in real life.
The One Rule That Makes It Possible
Before cameras had lenses, before microscopes had glass, there was the camera obscura. A dark room with a single hole in one wall. Light enters that hole and—nothing else. No mirrors, no adjustments. Just straight lines.
Aristotle noticed that sunlight passing through gaps in tree leaves creates circular spots on the ground. He couldn’t explain it. It took until the 10th century for Alhazen to work out what was happening: light travels in straight lines. Every point on the sun maps to a point on the ground through every gap. The circular spots were solar images—eclipses occurring naturally in miniature.
This is the physics behind pinhole imaging. It is also the same principle behind every solar eclipse projection method astronomers use today.
The Geometry of Inversion
In the interactive pinhole simulation, the object is an arrow placed 30 centimeters from the pinhole. The image forms 20 centimeters on the other side. Run the numbers: magnification equals image distance divided by object distance, so 20 divided by 30 gives you two-thirds. An 8-centimeter-tall object produces an image roughly 5.3 centimeters tall.

The image is also inverted. Light from the top of the object passes through the pinhole and lands at the bottom of the image plane. Light from the bottom strikes the top. This inversion happens not because of some optical trick but because geometrically, there is no other possibility—straight lines crossing an aperture simply invert.
You can scale this up. Place a 20-meter tree 15 meters from a pinhole and project the image onto a screen 10 meters on the other side. The magnification is 10 divided by 15, or two-thirds. The tree’s image on your screen would be roughly 13.3 meters tall—and inverted, with the crown pointing down.
Why Smaller Isn’t Always Better
There is a counterintuitive trade-off in pinhole photography. The instinct is to make the hole as small as possible for maximum sharpness. In practice, going too small causes diffraction—light bends around the edges of the aperture instead of passing through cleanly—and the image starts to blur again.

The sweet spot for a pinhole in visible light is typically between 0.3 and 0.5 millimeters. At this size, the hole is small enough to block most stray light but large enough to avoid significant diffraction. The simulation exposes this clearly: drag the pinhole size slider from 1 millimeter down to 0.1 millimeters and watch the image sharpen at first, then gradually lose contrast as diffraction dominates.
Every optical system faces this trade-off. Microscopes, telescopes, cameras—all of them balance resolution against light-gathering ability. The pinhole just makes it visible in the simplest possible system.
Why Pinhole Imaging Still Matters
Modern cameras use lenses because lenses gather far more light and can be corrected for aberrations. But lenses introduce their own problems: they absorb and distort light, they have limited field of view, and they are expensive to manufacture precisely. A pinhole has none of these issues.
The pinhole camera is completely achromatic—no color fringing, no chromatic aberration, because nothing in the system selectively bends different wavelengths differently. This is why pinhole photography produces such naturalistic images compared to cheap lenses.
NASA uses pinhole optics in solar observation. The pinhole projection method is the only safe way to observe an eclipse without damaging your eyes. Forensic scientists use pinhole imaging for document examination. Artists use it for the distinctive soft, one-of-a-kind quality that no lens can replicate.
The principle also explains why small gaps in cloud cover during an eclipse create crescent shapes on the ground—each gap is a pinhole casting a solar image.
What the Simulation Reveals That Equations Don’t
The formulas for pinhole imaging—magnification = image distance / object distance, image height = object height × magnification—are clean and simple. But running the simulation and watching rays draw themselves in real time communicates something the equations cannot: the sheer volume of independent straight-line paths that converge to form a coherent image.

With rays visible, you see why the image is inverted. You see why moving the object closer makes the image larger. You see why changing the pinhole size affects sharpness nonlinearly. The geometric intuition builds in a way that reading the formula never achieves.
The simulation also makes clear that pinhole imaging is not a degraded version of lens imaging. It is a different optical system with different trade-offs. Lenses win on light gathering and convenience. Pinholes win on simplicity, cost, and optical purity.
The Question That Lenses Can Never Answer
Push the simulation far enough and a question surfaces naturally: if light always travels in straight lines, what happens when it doesn’t? The answer leads out of classical optics entirely—into wave optics, quantum mechanics, and eventually the realization that “light travels in straight lines” is itself an approximation that breaks down at small enough scales. The pinhole reminds us that even the most fundamental-seeming rules in physics are summaries of deeper, stranger phenomena—and that understanding why a rule works often teaches us more than memorizing the rule itself.
The universe is not more complicated than a small hole in a box. Sometimes it is exactly that simple: one hole, one rule, one image formed by nothing but geometry. But the fact that something so simple produces something so beautiful should make us curious about what else we are missing by assuming the universe is complicated.

