Convolution
Sliding a small tile across a photo to score it, spot by spot
- Convolution is a method that slides a small tile across a photo bit by bit, repeating the same calculation at every spot it overlaps.
- What comes out of one spot is a single number — how clearly that pattern showed up right there.
- Once the tile has moved all the way through, you get one table laid out in the same arrangement as the original photo.
- How many spots it moves at a time, and how the edges get handled, changes the size of the result.
- The same one tile is used across the whole photo, so a pattern gets caught the same way no matter where it sits.
Contents
1The analogy
A thick logbook lies open on a reception desk, and in your hand is a small comparison card with just nine squares. Lay the card over the top-left corner of the logbook and nine squares overlap. Count how many of the overlapping squares match up and write down a single number. Slide the card one square to the right and count again, then slide again. Reach the right edge, drop down a row, and start again from the left.
Once the whole logbook has been covered, the numbers you wrote down line up in roughly the same shape as the logbook itself. A spot with a big number matched the card well; a spot with a small number barely matched at all. You never judged the whole logbook at once, yet the table shows exactly where the matches cluster. That's what convolution does to a photo.
2In detail
Only the overlapping spot gets counted
Convolution never looks at the whole photo at once — only as much as the small tile covers. If the tile is three squares by three squares, it's only looking at nine points of the photo at any one time.
The calculation itself is simple, too. Pair up the brightness of each overlapping point with the number written on the tile at that same spot, multiply them, and add up all the results. When a bright point lands where the tile has a big number, the sum grows large; when they don't line up, the sum stays small. The single number that comes out becomes a score for "how clearly that pattern showed up right here."
This calculation is exactly the same at every spot. Top left or bottom right, same tile, same method. Treating every spot identically turns out to be a big advantage later on.
It slides one step at a time, all the way through
Once a spot is scored, the tile slides sideways. It usually moves one square at a time, so the spot it just looked at and the new spot it's about to look at mostly overlap. Sliding this way, with overlap, means a pattern straddling two spots never gets missed.
You can also choose how many squares to slide at a time. Slide one square and you scan densely, but the result table comes out the same size as the original; slide two squares and the number of scans is cut in half, but the result table shrinks to half its size too. When a photo is large and computation needs to be conserved, taking bigger strides is an option.
The wider the tile, the wider the range it covers at once. But make the tile too big without limit and both the values to remember and the computation grow together. That's why a small tile scanned many times is the more common choice — stacking two small tiles ends up covering a wide range anyway, at a fraction of the values.
The edges need special handling
Moving the tile only within the photo's interior creates a problem. The points right at the edge never get a turn at the tile's center, so they end up under-counted, and the result table comes out slightly smaller than the original. Let that loss stack up across many stages and edge information keeps eroding away.
A common fix is to wrap a ring of empty squares around the outside of the photo before scanning — much like adding a mat around a picture in a frame. That lets edge points sit at the tile's center too, and keeps the result table the same size as the original.
Scanning leaves behind a single table
One score from one spot means nothing by itself. It only starts to mean something once scanning finishes and the scores line up in their original arrangement, because exactly where a pattern was caught stays intact as position.
Prepare several tiles and scan with each one separately, and you get that many separate tables. A table made by a tile hunting for vertical lines, a table made by a tile hunting for horizontal lines, stacked up side by side. The next stage receives this bundle of tables as if it were a new photo and scans it again. Stacking scans one on top of another is exactly why this calculation ends up handling bigger and bigger patterns — it's the reason this operation gets piled into layers.
3More precisely
Convolution is a calculation that multiplies and adds an input against a small value tile at matching positions, repeating that as the position shifts. The result at one spot comes from adding a reference value to the sum of products, then passing it through an activation function. The numbers written on the tile aren't chosen by a person — they're adjusted little by little during training.
The logbook comparison breaks down in one place. A person counting matches in a logbook counts how many line up, but convolution multiplies and adds, so the result can come out negative — a pattern that's inverted produces a large negative number. And while a person scans one spot at a time in order, the actual calculation handles every spot at once; the order makes no difference to the result.
For color photos, the tile isn't a single flat sheet — it's a thick block covering three layers, red, green, and blue, at once. All three layers get multiplied and added together into one number, so even with color the result is still a single table.
4Try it yourself
5Common misconceptions
It's easy to think convolution is a blurring effect, but actually, depending on what's written on the tile, it can blur or sharpen edges — it's a much broader calculation than that.
It's easy to assume the order the tile moves in affects the result, but actually each spot's calculation is independent, so it makes no difference which spot gets counted first.
It's easy to think convolution always shrinks the photo, but actually padding the edges with a border keeps the size exactly the same.
7One-line summary
In shortConvolution slides a small tile across a photo, scoring every spot it overlaps, then lays those scores out in their original arrangement to build a single table.
Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02