← all experiments

The Dullest Way Down

Experiment № 095 · October 20, 2026

Show

Brush

Cost of a seam

next seam
vs squash & crop
// one seam, top to bottom e = how busy each pixel is // + your paint for each row y, column x: M[y][x] = e[y][x] + min(M[y−1][x−1], M[y−1][x], M[y−1][x+1]) seam = cheapest cell in the last row, followed back up the arrows delete it — every row loses one pixel

drag the width · pick a brush and paint on the picture · space plays · H hides the panel

Experiment № 095 · The story

The Dullest Way Down

Why I picked it

I remember the 2007 SIGGRAPH video by Shai Avidan and Ariel Shamir going round: a beach photo being dragged narrower while the people on it stayed the same size and the empty sand between them simply wasn't there any more. It looked like an editing trick that needed someone to understand the picture. It turned out to need about fifteen lines and no understanding at all, and a version of it shipped in Photoshop as Content-Aware Scale a year or so later. I had already done edit distance as a dynamic program on a grid of letters; this is the same idea on a grid of pixels, and you can see the table.

What I enjoy about it

The "Valleys" view is the dynamic program's table drawn as a picture. Every cell has asked one tiny question, "which of the three cells above me was cheapest to reach?", and the result is a landscape of dark channels running down through the sky and the water, steering around the lighthouse. The best seam is just the bottom of the deepest channel. Nobody told it what a lighthouse is. It only knows that the lighthouse is busy, and the sky isn't.

I also like where it breaks. Drag the city narrow and once the gaps between buildings are used up, the seams have to go through windows, and the towers start to shear. The second cost button is the fix from the follow-up paper (Rubinstein, Shamir and Avidan, 2008): instead of charging a seam for the edges it crosses, charge it for the new edges it creates when the two sides close up. Toggle between them on a diagonal and watch the jaggies come and go.

Something you might take away

"Keep what matters" sounds like it needs judgment. Here it's done the other way round: never decide what's important, just find what nobody would miss, one pixel per row, and take that away. Repeat it and the important parts are what's left. When it gets something wrong, one stroke of the Protect brush is enough to fix it. The algorithm can't know what you care about, but a single number per pixel is all it needs to be told.