5.5 Local Laplacian filters⧉
Take a photograph of a mountain at dusk and ask for the one edit every landscape app promises: bring out the texture. Lift the grain of the rock, the needles on the pines, the ripples on the lake — without the picture turning into the over-cooked, ringed mess that "clarity" sliders so often produce. The thing you do not want is a bright or dark band hugging the mountain's silhouette against the sky, a halo, the telltale artifact of an edit that mistook the silhouette for texture and pushed on it too. You met that halo in Bilateral filtering: it is what a base/detail split leaves behind when its base layer is not quite faithful at the strong edge.
The dream is simple to state. 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 Linear 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. Because nothing is ever blurred across an edge and no two regions are ever averaged together, the method is halo-free by construction. We will see the mechanism, why it cannot ring, the one curve that does detail enhancement, tone mapping and inverse tone mapping alike, and the fast approximation that makes it practical — which, satisfyingly, turns out to be the multiscale relative of the unnormalized bilateral filter.
5.5.1 The wish, and why the bilateral leaves a halo⧉
Recall the two-scale story of Bilateral filtering and 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 — overshooting on the bright side, undershooting on 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 removes the premise. There is no single base layer to be imperfect, and no detail layer for an error to hide in. The decision "is this detail or an edge?" is not made once, globally, by a smoother; it is made per coefficient, by a curve, in a way we can read off exactly — and the answer, by construction, can never manufacture contrast that was not there (Figure 5.5.1).
5.5.2 What a Laplacian pyramid hands you⧉
Local Laplacian filtering is built directly on the Laplacian pyramid of Linear pyramids and wavelets, so it is worth recalling 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 — 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.
The point that matters here is what a single coefficient means. 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 currency 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 snag — the one the whole method exists to solve — 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.
5.5.3 The mechanism: a remapping recomputed per output pixel⧉
Here is the construction, stated carefully, because the indexing is the trick. We want the output's Laplacian coefficient at one pixel $p$ and one level $\ell$. Take that pixel's value $g = I(p)$. Now apply a pointwise remapping function $r_g(\cdot)$ to the entire input image — a smooth curve, centered on $g$, that decides, relative to this pixel's value, what counts as detail and what counts as an edge. Build a Laplacian pyramid of that remapped image $r_g(I)$. Read off just the one coefficient you were after, at this pixel $p$ and this level $\ell$. Discard the rest of that pyramid. Step to the next output pixel — which has its own value $g'$, hence its own curve $r_{g'}$ and its own remapped image — and repeat. Every output coefficient is the corresponding coefficient of a Laplacian pyramid built from an image that was remapped specifically for it. Collapse the assembled output pyramid and you have the filtered result.
That sounds extravagant, and naively it is (we will pay the bill, and discount it, 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$:
Read it in two halves. When an intensity $i$ is within $\sigma$ of $g$ — a small departure, which over a region near value $g$ is exactly what we call detail — the curve bends it: the exponent $\alpha$ controls the slope near the center, so $\alpha<1$ amplifies small differences (detail enhancement) and $\alpha>1$ compresses them. When $i$ is more than $\sigma$ from $g$ — a large departure, an edge as seen from this pixel — the curve is the identity, $r_g(i)=i$, changing nothing. The threshold $\sigma$ is the dial that says how big a contrast still counts as detail; everything beyond it is an edge and is left exactly as it was.
Now the payoff for halos. Consider an output pixel $p$ that sits on (or near) a strong edge, so $g=I(p)$ is one of the two levels the edge separates. The pixels on the other side of that edge differ from $g$ by more than $\sigma$ — so in $r_g(I)$ they are mapped by the identity and keep their original values. The big jump across the edge is therefore reproduced verbatim in the remapped image, and the Laplacian coefficient read off there is the input's own edge coefficient, untouched. The method literally cannot invent an overshoot at the edge, because at every pixel the part of the image that lies across a strong edge is passed through unchanged. Meanwhile the small ripples on the same side as $g$, within $\sigma$, are reshaped by the bent center of the curve — so detail is lifted exactly where it is detail and edges are preserved exactly where they are edges, with the cut between them made smoothly, per pixel, by a continuous curve rather than a hard global threshold (Figure 5.5.2).
5.5.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 machine — a clean instance of big lesson L9, that the eye reads local contrast and not absolute level, so the right place to edit is the multiscale contrast itself.
- Detail enhancement. Make the center of the curve steeper than the identity ($\alpha<1$): small departures from $g$ are stretched, so texture and fine local contrast leap out, while edges on the identity tails stay put. This is the "clarity" edit done honestly — strong, halo-free, with no ringing on silhouettes.
- HDR tone mapping. Make the center shallower than the identity ($\alpha>1$): small departures are compressed. Applied across the pyramid this squashes local contrast gently and uniformly, shrinking the scene's range to fit a display while keeping detail intact — the local-tone-mapping goal of Tone mapping reached without a base layer to halo. As there, you work in a log (or otherwise perceptually uniform) domain, so that equal coefficient changes mean equal perceived contrast changes; the encoding discipline of the tone-mapping recap applies unchanged.
- Inverse tone mapping. Invert that compression — expand large-scale contrast — to take a flat or low-dynamic-range image and re-inflate its range, the operation you want when feeding standard-range content to an HDR display.
All three are halo-free for the same structural reason: nothing was blurred across an edge and no two regions were averaged. The only thing that changed between an enhanced rock face and a tone-mapped interior is the slope you wrote into the center of $r_g$.
The eye cares about local contrast, not absolute values — so edit the contrast directly, in the multiscale decomposition. Where gradient-domain methods (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 makes the result halo-free by construction, abolishing rather than merely reducing the artifact that motivated the bilateral. (L9, registered in Poisson image editing; this is its multiscale-decomposition appearance.)
5.5.5 Contrast with the bilateral base/detail split⧉
It is worth saying precisely how this differs from the bilateral approach, because they are aiming at the very same target. The bilateral two-scale decomposition (Bilateral filtering, Tone mapping) and local Laplacian filtering share the goal — compress the range or boost the detail of an image without halos — and they are even 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.
The local-Laplacian route never builds a base, never measures pairwise similarity, and never commits once. It manipulates the multiscale decomposition directly, coefficient by coefficient, with a curve that is recomputed for each output pixel and that passes strong contrasts through untouched on its identity tails. There is no single layer to be wrong at the edge — the "detail versus edge" decision is remade, locally and smoothly, at every coefficient — which is exactly why it cannot halo. Same destination; the bilateral takes the affinity road and the local Laplacian takes the pyramid road.
5.5.6 The cost, and the fast version⧉
The honest catch is cost, and reading the recipe back makes it plain: 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.
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 Bilateral filtering — the delta-from-input form
with no division by the normalizer. So the outlier is not so estranged after all. Zoom into a single band and the affinity reappears; the multiscale local Laplacian is that unnormalized-bilateral move stacked across the levels of a pyramid. The method that builds no affinity is, scale by scale, an affinity filter in disguise — which is why it lands at the same destination, and why it has the bilateral's strengths without its single-commitment halo.
Big lessons of this chapter
The recurring principles from this chapter, gathered for review.
The eye cares about local contrast, not absolute values — so edit the contrast directly, in the multiscale decomposition. Where gradient-domain methods (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 makes the result halo-free by construction, abolishing rather than merely reducing the artifact that motivated the bilateral. (L9, registered in Poisson image editing; this is its multiscale-decomposition appearance.)