The picture
OriginalWhat you’d normally see: a grid of brightness values.
Its recipe
Paint hereThe same picture as a recipe of stripe patterns. Drag to erase ingredients.
Rebuilt from your recipe
ResultRebuilt from whatever is left in the recipe, updated as you paint.
What am I looking at?
In the 1800s, Joseph Fourier showed that any signal can be built by adding up simple waves. A picture is no exception: it can be rebuilt exactly from a stack of smooth stripe patterns of different sizes, angles and strengths. The middle panel shows that stack.
Reading the recipe
Each dot in the middle panel stands for one stripe pattern. Its brightness is how much of that pattern the picture contains.
Its distance from the center is how fine the stripes are. Broad shapes and overall brightness live near the center; sharp edges and fine detail live near the rim.
Its direction from the center is the angle of the stripes.
Why patterns become stars
A real scene needs thousands of ingredients spread across the recipe. A repeating pattern like a window screen is the opposite: it’s made of just one or two stripe patterns, so all its energy piles up in a few bright stars.
That’s why erasing a handful of dots removes the pattern and leaves the picture almost untouched. Every star appears twice, mirrored through the center, so the brush always erases both.
Where you’ve met this
Photos and video: JPEG uses a close cousin of this idea, keeping the ingredients your eye notices and discarding fine detail it won’t miss.
Medicine: an MRI scanner measures the recipe first, and a computer turns it into the image.
Sound: noise-cancelling headphones and audio equalizers work on the same principle, one dimension down.
Picture to numbers
The image becomes a 256 × 256 grid of brightness values.
cvtColor
Numbers to recipe
The Fourier transform finds how much of every stripe pattern is present.
dft
Edit the recipe
Your brush turns ingredients down to zero, with soft edges to avoid ripples.
mask × spectrum
Recipe to picture
The inverse transform adds the remaining stripes back together, live.
dft (inverse)