Fundamentals · PixInsight 1.9.x

LocalHistogramEqualization (LHE)

LocalHistogramEqualization (LHE) spreads the brightness values of each pixel’s surroundings. Structures that differ only slightly from their immediate neighbourhood stand out – even when they lie in the same midtones as the rest of the image.

Purpose

TaskSetting
emphasise large shapes and edgeslarge kernel
emphasise fine structure within the shapessmall kernel
bothtwo passes, first large, then small

Principle

WhyLHE rather than a curve?

A curve acts globally: every pixel with the same value is changed in the same way, regardless of its position. LHE acts locally: for each pixel it looks at its surroundings (kernel) and spreads the brightness values there. Nebula filaments, veils and dark clouds often differ only slightly from their surroundings – exactly what LHE is made for.

The kernel size determines which structure size is emphasised. A kernel much larger than the structure emphasises not the structure but its surroundings.

Parameters

ParameterEffectTypical range
Kernel Radiussize of the surroundings considered; determines the emphasised structure sizelarge: overall shapes; small: fine detail
Contrast Limitlimits the contrast gain; without it, massive noise amplification in uniform areas1.5–2.0
Amountblend with the original; 1.0 is usually too harsh0.1–0.4
Histogram Resolutionlevels of the local histogram (8 bit = 256, 10 bit = 1,024, 12 bit = 4,096); internal only, the image stays 32 bit8 bit
Circular Kernelequal weighting in all directions; a square kernel favours diagonals and can create block patternsenabled

Operation

  • Apply to a starless image or a luminance: stars would otherwise get halos and rims.
  • Use the Real-Time Preview; judge the effect at 1:1.
  • Raise the histogram resolution to 10 or 12 bit only when steps or bands appear in smooth areas – noticeably slower, especially with a large kernel.
  • LHE makes noise more visible; denoise after LHE.

Typical applications

Two passes

Whytwo passes?

A large kernel emphasises entire shapes, a small one the fine structure within them. A single medium kernel achieves both only halfway.

PassKernel RadiusContrast LimitAmountemphasises
1 large-scale64–1281.5–2.00.2–0.4large nebula shapes, filaments, edges
2 fine16–321.50.1–0.2fine structure within the shapes

Narrow filaments

For narrow, fibrous structures (e.g. supernova remnants such as the Veil Nebula) use smaller kernels: pass 1 with 48–64, pass 2 with 12–24. A large kernel would emphasise the surroundings of the fibres instead of the fibres themselves.

What a good result looks like

Typical errors

ObservationCauseRemedy
Effect too weakAmount lowraise Amount in steps of 0.05
Rims at edges, harsh lookAmount or Contrast Limit too highlower Amount or Contrast Limit
Noise amplified in the backgroundContrast Limit highlower Contrast Limit; then
Steps, bands in smooth areashistogram too coarseHistogram Resolution 10 or 12 bit
Block-like patternssquare kernelenable Circular Kernel
Halos around starsapplied to an image with starsapply to the starless image

When to use it – and when not

Good forBetter another tool
emphasising local contrast of nebula structuresshaping global contrast →
bringing out fine structure in a luminanceraising structures only above the background →
Used in

CurvesTransformation · GeneralizedHyperbolicStretch (GHS) · HaLRGB workflow · Narrowband workflow (HOO/SHO) · OSC workflow with a quad band-pass filter · RangeSelection (Range Mask)