BookNotesSlidesP-sets Syllabusdraft · v0.2.49.1
◀▲⌂▶
💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.
💡 In a hurry? Jump to this chapter’s 1 big lesson ↓

10.4 Local Laplacian filters⧉

Enhancing rock texture should not put a bright rim around a mountain silhouette. Local Laplacian filters control detail and large contrast through a pointwise remapping used to construct each output pyramid coefficient Paris et al. 2011.

The goal is simple. At every pixel and every scale, an image carries some amount of local contrast, how far this pixel departs from its blurred surroundings. Some of that contrast is detail (the rock grain, the pine needles): small departures we want to amplify. Some of it is an edge (the mountain against the sky): a large departure we want to leave exactly alone. Edge-aware detail manipulation is, at heart, nothing but the wish to grab the small departures and lift them while the large ones pass through untouched. The trouble has always been telling the two apart cleanly enough that the boundary between them does not itself become an artifact.

This chapter is one very clean answer, due to Sylvain Paris, Samuel Hasinoff and Jan Kautz (2011). It does not build a base layer and does not weigh any pair of pixels. Instead it processes a Laplacian pyramid (the multiscale decomposition of Chapter 6.6, Pyramids and wavelets) by reshaping each coefficient with a smooth point curve that is recomputed, per output pixel, to know whether that pixel sits on detail or on an edge. The pyramid uses ordinary blurring, but the remapping used to obtain each coefficient gives explicit control over small and large intensity differences. This substantially reduces the halos of naive coefficient manipulation. The same family of curves supports detail enhancement, tone mapping and inverse tone mapping; a sampled approximation makes the construction practical and connects it to the unnormalized bilateral filter Tomasi & Manduchi 1998.

10.4.1 The wish, and why the bilateral leaves a halo⧉

Recall the two-scale story of Chapter 10.1, Bilateral filtering and Chapter 18.2, Global tone mapping. To manipulate detail or compress a high-dynamic-range (HDR) scene, the classic move is to split the image into a base (a piecewise-smooth, edge-respecting version that holds the large-scale tones) and a detail layer (everything the base threw away). You then squash the base to fit the display and add the detail back, often boosted. The base is built with an edge-preserving smoother (a bilateral filter, say) precisely so that the strong edges land in the base and do not get manipulated as if they were texture.

It works beautifully right up until the base is imperfect at the edge, and that is where halos come from. If the base layer rounds a sharp silhouette even a little (underestimating the bright side and overestimating the dark side) that error lands in the detail layer as a contrast-shaped bump straddling the edge. Boost the detail and you boost the bump: a glowing rim on one side, a dark trench on the other. Worse, push hard enough and a gradient can reverse: the detail layer's overshoot dominates and the slope across the edge flips, so a bright-to-dark edge reads locally as dark-to-bright. Halos and gradient reversals are the two failure modes that motivated the bilateral in the first place, and the bilateral merely reduces them; it does not abolish them, because the single base layer still has to commit, once, to one smoothed value at each pixel of the edge.

Local Laplacian filtering changes how the coefficients are constructed. The decision about which intensity differences to modify is made for each coefficient through a remapping curve, rather than through one base/detail split. This provides more control over the interaction between detail and strong edges (Figure 10.4.1).

fig-base-detail-halo
Figure 10.4.1. Why a base/detail split can halo, and the local-Laplacian alternative. Top row (1-D scan across a strong edge): the input step with fine ripple on it; the edge-preserving base that slightly rounds the step; the detail = input − base, in which the base's rounding error appears as a contrast-shaped bump straddling the edge; and detail boosted and added back, where that bump becomes a bright overshoot and a dark undershoot (a halo) and, pushed harder, a gradient reversal. Bottom row: the same scan filtered by local Laplacian: the ripple is amplified everywhere but the step itself rides the identity part of the remapping and is reproduced exactly, so no overshoot is ever created.

10.4.2 What a Laplacian pyramid hands you⧉

Local Laplacian filtering is built directly on the Laplacian pyramid Burt & Adelson 1983 (Laplacian pyramid) of Chapter 6.6, Pyramids and wavelets, so recall exactly what that decomposition gives. Blur the image and subtract the blur from the original: what remains is the finest band, the contrast the blur removed, namely the texture and edges at the smallest scale. Now downsample the blurred image and repeat: each level $\ell$ holds the contrast at one scale, and the bottom of the pyramid holds the leftover low-frequency residual. Collapsing the pyramid (upsampling and adding the bands back) reconstructs the image exactly.

A Laplacian-pyramid coefficient $\ell_\ell(p)$ at level $\ell$ and pixel $p$ is the local contrast at that scale and place, how far $p$ departs from its blurred surroundings at that scale. Its magnitude is the natural measure of "detail versus edge": small coefficients are fine modulation we may want to lift; large coefficients are strong structure we want to preserve. So the wish from the opening (amplify small departures, leave large ones alone) translates cleanly into the pyramid: amplify small-magnitude coefficients, pass large-magnitude ones through.

The difficulty is that a coefficient arrives unlabeled. A coefficient of a given magnitude over a smooth region might be the fine texture we want to boost; a coefficient of the same magnitude sitting on the flank of a strong edge is part of that edge and must not be touched. The naive remedy ("amplify coefficients below some magnitude threshold and not above") is exactly the base/detail thresholding that halos: it makes a hard, per-coefficient cut with no regard for the pixel the coefficient belongs to, and the discontinuity at the threshold becomes the artifact. We need a decision that depends on the value of the pixel the coefficient is reporting on, and that is the move the next section makes.

10.4.3 The mechanism: a remapping recomputed per output pixel⧉

For output coefficient $(\ell,p)$, use the reference value $g=G_\ell[I](p)$ from the input Gaussian pyramid at the same level and location. Remap the full-resolution input about $g$, construct its Laplacian pyramid, and take coefficient $(\ell,p)$. Repeat for the output coefficients and reconstruct using the matching pyramid expansion. Using the full-resolution value $I(p)$ at every level would be a different algorithm.

That sounds extravagant, and naively it is (we will address the cost at the end). But look at why it does the right thing. The curve $r_g$ is centered on $g$ and reshapes intensities by how far they sit from $g$:

$$ r_g(i) \;=\; \begin{cases} g + \operatorname{sign}(i-g)\,\sigma\,\bigl(|i-g|/\sigma\bigr)^{\alpha} & |i-g|\le \sigma \quad(\textbf{detail}),\\[4pt] g+\operatorname{sign}(i-g)[\sigma+\beta(|i-g|-\sigma)] & |i-g|>\sigma \quad(\textbf{edge}). \end{cases} $$

For departures below $\sigma$, $\alpha<1$ enhances small differences and $\alpha>1$ suppresses them. For larger departures, $\beta$ controls the slope: $\beta=1$ retains them, $0<\beta<1$ compresses them, and $\beta>1$ expands them. Both branches meet at the threshold. Values very close to the reference need care when $\alpha<1$, because the power curve has a steep derivative and can amplify noise.

The remapping distinguishes departures relative to the local Gaussian reference. It can reduce the halos of a single blurred-base decomposition, but the argument is not that every coarse reference equals one side of an edge. Inspect the assembled multiscale result, especially at extreme parameters.

fig-local-laplacian-params
Figure 10.4.2. The two parameters of the remapping curve, from Paris, Hasinoff and Kautz. The amplitude threshold $\sigma$ sets the boundary between detail (departures from $g$ smaller than $\sigma$, which the bent center of the curve reshapes) and edge (larger departures, which ride the identity tails untouched); the exponent $\alpha$ sets the slope of that center, with $\alpha<1$ amplifying detail and $\alpha>1$ compressing it. Sweeping the two and watching the output makes the dials concrete: $\sigma$ chooses how large a contrast still counts as texture, and $\alpha$ chooses how hard to push it: two knobs that, between them, span enhancement, tone mapping, and everything between. From Paris et al. 2011.
fig-local-laplacian-remap-family
Figure 10.4.3. The family of point-wise remapping functions local Laplacian filtering applies around each pixel's value: the detail exponent $\alpha$ reshapes the bent center (amplifying or compressing texture) while the tone slope $\beta$ sets the pitch of the identity tails (compressing or expanding large-scale contrast): one parameterized curve that spans detail enhancement through tone mapping Paris et al. 2011.
fig-local-laplacian
Figure 10.4.4. Local Laplacian filtering on a real high-dynamic-range scene (a backlit sunset), implemented after Paris et al. 2011. Top row, three ways to fit the scene's range to a display: a naive global curve blows out the sky and crushes the shadows; a Gaussian base/detail split compresses the range but leaves a bright halo ringing the high-contrast sun-and-skyline silhouette; local Laplacian compresses the same range and keeps the foreground crisp with no halo. Bottom left, the remapping curve $r_g(\cdot)$ centered on a pixel's value $g$ with a compressive center ($\alpha>1$): intensities within $\sigma$ of $g$ are gently compressed (the detail band) while intensities farther than $\sigma$ lie on the identity tails (a strong edge) and pass through unchanged. Bottom right, zoom crops along the silhouette: the Gaussian base shows a gray halo around the sun and skyline; the local-Laplacian result has none, because the strong edge rides the identity tails and is reproduced verbatim. The same machinery, with an expansive center ($\alpha<1$), does halo-free detail enhancement.
fig-local-laplacian-teaser
Figure 10.4.5. The original local-Laplacian teaser, from Paris, Hasinoff and Kautz. A single photograph is pushed hard in two opposite directions by the same machine: strong detail enhancement that lifts every fine texture, and aggressive tone manipulation that compresses or inverts the large-scale contrast, both completely free of the halos and gradient reversals that such heavy edits usually produce. This is the published result our from-scratch figure reproduces; seeing the authors' own example makes the claim concrete: one per-pixel remapping of a Laplacian pyramid spans the whole range of edge-aware contrast edits. From Paris et al. 2011.

The computational expense follows directly from selecting one coefficient at a time. For the requested level and position, use the corresponding value in the original Gaussian pyramid as the remapping reference. Remap the input around that reference, construct the needed Laplacian coefficient, and copy it into the output pyramid. A different level or position generally selects a different reference and therefore a different remapping. The conceptual algorithm recomputes far more than the one coefficient it keeps, which motivates the later approximation using a finite set of reference intensities. This also explains why taking one globally remapped image and building its pyramid is a different operation.

10.4.4 One curve, three edits: enhancement, tone mapping, inverse tone mapping⧉

Because the entire design lives in the shape of $r_g$, three different photographic operations are three settings of the same method, a clean instance of big lesson L10.4, that the eye reads local contrast and not absolute level, so the right place to edit is the multiscale contrast itself.

fig-local-laplacian-detail-space
Figure 10.4.6. Detail enhancement across scale, from Paris, Hasinoff and Kautz. Because the curve acts on a Laplacian pyramid level by level, the same machine can boost detail at a chosen scale (fine texture, medium structure, or both) by enhancing the corresponding bands while leaving the others alone. Working in the multiscale decomposition gives you a scale selector for free: detail enhancement becomes a per-band choice rather than one global slider, all of it halo-free because every band's strong edges still ride the identity tails. From Paris et al. 2011.
fig-local-laplacian-range-compression
Figure 10.4.7. Halo-free range compression, from Paris, Hasinoff and Kautz. A high-dynamic-range scene is squeezed to fit a display by compressing the large-scale contrast ($\alpha>1$) while the fine detail is preserved, so the interior and the bright window, or the shadowed foreground and the blazing sky, are all legible in one frame, with no glow ringing the high-contrast silhouettes. Compare it mentally to the haloed Gaussian-base result earlier: the difference is the identity tails, which reproduce every strong edge verbatim and so leave nothing for a halo to form on. This is the authors' tone-mapping result (Paris et al. 2011).

These settings change different ranges of contrast. They do not guarantee artifact-free output or recover radiance lost to clipping. Noise, strong parameter settings and finite intensity sampling remain practical limitations.

fig-local-laplacian-demo
Figure 10.4.8. One editable curve, three edits, live. The curve $T$ reshapes each pixel's detail $d=(\text{value}-\text{local reference})$ before the Laplacian pyramid is rebuilt and collapsed, using the sampled version of the local Laplacian filter: seven reference values stand in for a reference at every intensity, and the original coarse residual is kept. Drag the dots: steepen the curve's center and fine detail is boosted (the "clarity" edit); flatten its tails and strong edges are compressed; push the tails past the diagonal and contrast is expanded; leave every dot on the gray diagonal and the input comes back unchanged. The presets jump between identity, detail boost, and tone compress. Push the curve hard and watch the silhouettes: large-contrast pixels ride the curve's tails, which is why halos stay small, but seven samples and an arbitrary curve can still leave artifacts, so halo-free is a tendency of the method rather than a guarantee of this demo. The curve acts on the gray code values of images that were already tone mapped from HDR radiance maps (a vine sunset, the Memorial church and Grace Cathedral's nave by Paul Debevec, the Design Center loft by Byong Mok Oh, and an Antelope Canyon capture), not on the radiance itself.
💡 Big lesson (L10.4)

The eye cares about local contrast, not absolute values, so edit the contrast directly, in the multiscale decomposition. Where gradient-domain methods (Chapter 10.8, Poisson image editing) manipulate the gradient field and re-integrate, local Laplacian filtering manipulates the Laplacian-pyramid coefficients (the local contrast at each scale) with a per-pixel point curve, then collapses the pyramid. Both discard or reshape contrast while letting the absolute level fall out, and both are kin to the bilateral base/detail split; the difference is that working band by band with an identity tail for large contrasts removes the mechanism that makes a single base layer halo: no base value is committed once for the whole edge. In practice the halos shrink to the point of being hard to find at moderate settings, though extreme parameters can still produce small artifacts near strong edges. (L10.4, registered in Chapter 10.8, Poisson image editing; this is its multiscale-decomposition appearance.)

10.4.5 Contrast with the bilateral base/detail split⧉

This differs from the bilateral approach in one specific way, though both aim at the same target. The bilateral two-scale decomposition (Chapter 10.1, Bilateral filtering, Chapter 18.2, Global tone mapping) and local Laplacian filtering share the goal of compressing the range or boosting detail without halos, and they are formal cousins. They part on the machinery.

The bilateral route is affinity-based and once-committing: it measures how similar nearby pixels are (the range weight), averages the similar ones into a single base layer, and then manipulates the detail = input − base. Every pixel of the edge gets one smoothed base value, and any imperfection in that one commitment becomes a halo in the boosted detail.

Local Laplacian filtering constructs coefficients using remappings centered at Gaussian-pyramid values. The pyramid still uses blurring and a coarse residual; the distinction is how each coefficient is chosen, not the absence of a base or averaging at all scales.

10.4.6 The cost, and the fast version⧉

The plain catch is cost, and reading the recipe back makes it clear: the naive filter rebuilds an entire Laplacian pyramid per output pixel and per level, which is wildly redundant. Most of each rebuilt pyramid is thrown away after one coefficient is read. Done literally, that is far too slow for a real photo.

fig-fast-local-laplacian-1
Figure 10.4.9. The headline result of the fast version, from Aubry, Paris, Hasinoff, Kautz and Durand. The same strong, halo-free detail and tone edits we have been building from scratch, pushed hard enough to lift every fine texture and reshape the large-scale contrast, now computed in a fraction of the time, fast enough to run on a real photograph. The speed-up costs nothing visible: this is the authors' own published output of the practical filter, and it is the same halo-free, gradient-reversal-free quality as the slow construction. From Aubry et al. 2014.

The fast version, Mathieu Aubry, Sylvain Paris, Samuel Hasinoff, Jan Kautz and Frédo Durand (2014), recovers practicality with two observations. The first is sheer efficiency: the remapping $r_g$ depends on $g$ only through a smooth dependence on the center value, so it suffices to evaluate the construction for a small handful of representative values of $g$ spanning the intensity range and interpolate between the resulting pyramids, turning a per-pixel rebuild into a few full-image pyramids plus a lookup. The second is conceptual, and it is the one this book cares about most: the single-scale special case of the local-Laplacian construction is exactly the unnormalized bilateral filter from the end of Chapter 10.1, Bilateral filtering, the delta-from-input form

$$ I^{\mathrm{bf}}_p \;=\; I_p + \eta\sum_q w(p,q)\,\bigl(I_q - I_p\bigr), $$

This connection requires matching kernels, remappings and normalization conventions; it is not an identity for every choice of local-Laplacian curve and bilateral weights. The explicit step size here follows Chapter 10.1, Bilateral filtering.

fig-bilateral-unnormalized
Figure 10.4.10. The single-scale special case, on a step edge. The ordinary normalized bilateral averages each pixel with its similar neighbors and divides by the weight sum. The unnormalized form in Aubry et al. adds weighted differences to the pixel instead, $I_p+\sum_q w(p,q)(I_q-I_p)$, without dividing; stacked across pyramid levels with the per-coefficient remap, that form becomes the local-Laplacian filter, which is why a method that builds no affinity is, scale by scale, an affinity filter in disguise. The plotted unnormalized curve approximates that form: it divides the weighted sum by a fixed full-window weight, which agrees in a flat interior but darkens near a truncated boundary, even for a constant input. After Aubry et al. 2014.

With the filter now fast, the authors put it through the photographic operations the slow version promised, at full image resolution. The first is the hardest test of the whole approach: range compression and detail enhancement at once, in a single pass.

fig-fast-local-laplacian-6
Figure 10.4.11. Range compression with detail enhancement, done together, from Aubry, Paris, Hasinoff, Kautz and Durand. A high-dynamic-range scene is squeezed to fit a display and has its fine texture lifted in the same filtering pass: the shadows and the highlights are both legible while the local detail reads crisp, with no halo on the strong silhouettes. The lesson is that the two edits we treated as opposite settings of $r_g$ (compress the large contrasts, expand the small ones) are not mutually exclusive: one curve can do both at the right scales, and the fast filter makes the combination practical. From Aubry et al. 2014.

The remaining results probe what the dials actually do once the filter is cheap enough to sweep them. The most structural dial is the depth of the pyramid, how many scales the remapping is allowed to touch.

fig-fast-local-laplacian-7
Figure 10.4.12. The effect of pyramid depth, from Aubry, Paris, Hasinoff, Kautz and Durand. Varying the number of levels the remapping reaches sets the coarsest scale at which local contrast is reshaped: a shallow pyramid edits only the fine bands and leaves the broad tonal structure alone, while a deeper pyramid carries the manipulation up to ever larger-scale contrast, changing the overall look from a light touch of clarity to a sweeping tonal redistribution. "Scale" is a genuine control here: depth chooses how large a structure the filter is permitted to call detail. From Aubry et al. 2014.

Because the filter acts on coefficients, it can also be driven toward a target rather than a fixed curve, iterating the remapping until a desired statistic of the result is met.

fig-fast-local-laplacian-9
Figure 10.4.13. Iterative gradient-histogram transfer, from Aubry, Paris, Hasinoff, Kautz and Durand. Instead of a fixed remapping, the fast filter is applied repeatedly to push the image's gradient histogram toward a target distribution: each pass reshapes the multiscale contrast and the result is re-measured, converging on an image whose statistics of local contrast match the desired ones. The point is that the per-pixel curve need not be set by hand: because it operates directly on the contrast coefficients, the filter slots into an iterative, statistics-matching loop, all of it still halo-free. From Aubry et al. 2014.
fig-fast-local-laplacian-12
Figure 10.4.14. Comparison with two-scale tone management, from Aubry, Paris, Hasinoff, Kautz and Durand. The fast local-Laplacian result is placed beside the two-scale tone-management approach of Bae et al. 2006 (Bae et al. 2006) on the same scene: both reshape large-scale tone while keeping detail, but the local-Laplacian result holds its strong edges without the residual halo or detail loss that a base/detail split can leave behind. Against a respected baseline, manipulating the multiscale decomposition directly, with identity tails on the strong contrasts, buys a cleaner edge than committing once to a base. From Aubry et al. 2014.
Video 10.4.1. Video: Local Laplacian Filters: Edge-Aware Image Processing with a Laplacian Pyramid, Paris, Hasinoff & Kautz 2011 (YouTube). The authors' walkthrough of reshaping each Laplacian-pyramid coefficient with a per-pixel point curve, producing detail enhancement and tone manipulation that are halo-free by construction.

In CompPhotoRoom

The Highlights and Shadows sliders of Chapter 8.13, A raw developer in the browser run a real local-Laplacian kernel, written in Halide and compiled to WebAssembly; the method menu also carries the global-curve prototype, so the halos this chapter promises from the naive approach can be produced on demand and then made to vanish.

Recap: big lessons of this chapter

💡 Big lesson (L10.4)

The eye cares about local contrast, not absolute values, so edit the contrast directly, in the multiscale decomposition. Where gradient-domain methods (Chapter 10.8, Poisson image editing) manipulate the gradient field and re-integrate, local Laplacian filtering manipulates the Laplacian-pyramid coefficients (the local contrast at each scale) with a per-pixel point curve, then collapses the pyramid. Both discard or reshape contrast while letting the absolute level fall out, and both are kin to the bilateral base/detail split; the difference is that working band by band with an identity tail for large contrasts removes the mechanism that makes a single base layer halo: no base value is committed once for the whole edge. In practice the halos shrink to the point of being hard to find at moderate settings, though extreme parameters can still produce small artifacts near strong edges. (L10.4, registered in Chapter 10.8, Poisson image editing; this is its multiscale-decomposition appearance.)