Walking into a good coffee shop is often like stepping into another world, heralded by the distinctive aroma and the clinking of cups. There’s a low murmur from the humans summoned by the shiny espresso machines, which hiss like dragons as they spit out liquid black gold. I don’t drink much coffee, but I’m fascinated by the ritual associated with it.

And since I’m a physicist who specializes in bubbles, what really attracts me is the foam: the white milk foam and the brown foam on an espresso (called crema). It’s the art...