A portrait as a ground state

interactive
statistical-physics
Boltzmann condenses out of thermal noise: an Ising lattice whose external field is a photograph.
Published

September 29, 2026

What you’re seeing

Each spin sits in an external field set by how dark the photograph is at that point, \(h_i = h_0\,(2d_i - 1)\) with darkness \(d_i\) between 0 and 1. The lattice starts hot and disordered and cools toward the final temperature, so the portrait condenses out of thermal noise.

The coupling \(J\) decides the style. When it is weak, the spins are nearly independent and each one points up with probability set by its own field, \(\langle s_i \rangle \approx \tanh(h_i / k_B T)\). The density of dark spins then tracks the tone of the photo, which is a stochastic halftone. When \(J\) is strong and the temperature is below the critical point, neighbors insist on agreeing, and gradients of tone collapse into flat domains. Near \(T_c\), fluctuations appear on every length scale and the picture is never quite still.

Things to try

  • Switch to time-averaged spins. Averaging over recent frames turns the halftone into continuous tone, much like an old photogravure.
  • Raise the coupling above about 0.5 at low temperature. The face turns into a few large domains, and small features like the glasses disappear first: they cost more domain wall than their field is worth.
  • Lower the field strength while the coupling is strong. Only the largest regions of tone can still pay for their domain walls, so the portrait simplifies toward a silhouette.
  • Try Gibbs. His portrait has a dark studio background, which dominates the field and makes the face harder to recover. The denoising note handles him with a little edge enhancement.

Credits and source

Portraits of Ludwig Boltzmann (1902) and J. Willard Gibbs (before 1903) are in the public domain, via Wikimedia Commons. The simulation is heat-bath Monte Carlo on a 128 × 160 lattice, written in plain JavaScript: ising-portrait.js and the shared ising-core.js.