Portrait relight guide

Overview

Portrait relight lights a flat picture again, with a key light that circles it, and can carry picture A into picture B with a band of light.

An ornate figure with a pale, jewelled face, a gold sunburst halo and ropes of pearls, lit low from one side so every bead and fold stands out
The Raking stone preset partway through a run: a low light skims the picture from one side.

It is a relight. The tool reads how bright each pixel is and treats that as height: bright parts stand up, dark parts sink. See depth from brightness and luminance.

From the change in brightness around each pixel, measured with a Sobel filter, it works out which way that pixel faces. That set of directions is a normal map.

A key light then shades every pixel with Blinn–Phong shading: a floor of ambient fill, brightness that follows how directly the pixel faces the light, and a bright specular highlight where it faces the light and you at once. See Lambert shading and key light.

During a run the light circles the picture, an orbit sweep. One number, the transition progress, runs from 0 to 1, and an easing curve sets how it speeds up and slows down. Only the shading changes; no pixel moves.

With the light-band wipe on, the run becomes an image transition between two pictures, A and B: a band of light crosses the frame and leaves B behind it. See picture A and picture B and sweep cut.

Six presets set every slider at once: Raking stone, Bronze idol, Moonlit, Hard key, Candle orbit and Sweep cut. You can swap in your own two pictures, and keep a PNG or a video.

Open Portrait relight Start here

In this guide

  1. StartWhat you need and your first relight in five steps.
  2. Every controlEvery control in the panel, one line each.
  3. Three looksThree presets caught while the light moves, and how each was made.
  4. Keep your workThe PNG and the video.
  5. HelpWhat to do when something goes wrong.

It runs in your browser with WebGL, worked out for each pixel in a fragment shader on the GPU. Your pictures stay on your device and nothing is uploaded. A mouse, a trackpad, a pen and a finger all work.