multi_scale_enhance
Enhance faint details and balance dynamic range by applying masked three-scale Local Histogram Equalization, with an optional HDRMultiscaleTransform pass.
Instructions
Masked three-scale LocalHistogramEqualization on a view, in one call, with an optional HDRMultiscaleTransform pass. The mask is the image lightness (CIE L* for colour, the image itself for mono) mapped as max((L - mask_clip_low) / (1 - mask_clip_low), 0), raised to the power 1/mask_gamma and blurred with a Gaussian of sigma mask_blur (0 = no blur). LHE then runs at the large, mid and fine radius in that order through the mask; the large and mid scales use lhe_slope_limit, the fine scale lhe_fine_slope_limit; other LHE parameters are PixInsight's defaults. Giving hdrmt_layers adds an HDRMultiscaleTransform pass through the same mask. The mask is closed afterwards. Reports a detail score before and after: the mean squared Sobel gradient of luminance (Rec.709 weights) over pixels brighter than median + 8 x 1.4826 x MAD, sampled every 8 pixels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view_id | Yes | View ID to enhance (modified in place) | |
| mask_blur | Yes | Gaussian blur sigma of the mask in pixels (0 = no blur) | |
| mask_gamma | Yes | Mask gamma: the rescaled mask is raised to the power 1/mask_gamma (1 = unchanged) | |
| hdrmt_layers | No | HDRMultiscaleTransform number of layers. Giving it runs the HDRMT pass; omitted, no HDRMT runs | |
| mask_clip_low | Yes | Lightness mapped to 0 in the mask; values above it are rescaled to 0-1 | |
| hdrmt_inverted | No | HDRMT inverted iterations (needs hdrmt_layers; omitted = PixInsight default) | |
| lhe_mid_amount | Yes | Mid-scale LHE amount, 0 to 1 | |
| lhe_mid_radius | Yes | Mid-scale LHE kernel radius in pixels | |
| lhe_fine_amount | Yes | Fine-scale LHE amount, 0 to 1 | |
| lhe_fine_radius | Yes | Fine-scale LHE kernel radius in pixels | |
| lhe_slope_limit | Yes | LHE contrast slope limit of the large and mid scales | |
| hdrmt_iterations | No | HDRMT number of iterations (needs hdrmt_layers; omitted = PixInsight default) | |
| lhe_large_amount | Yes | Large-scale LHE amount, 0 to 1 | |
| lhe_large_radius | Yes | Large-scale LHE kernel radius in pixels | |
| hdrmt_to_lightness | No | HDRMT toLightness: on a colour image, apply the transform to the lightness only (needs hdrmt_layers; omitted = PixInsight default) | |
| lhe_fine_slope_limit | Yes | LHE contrast slope limit of the fine scale | |
| hdrmt_median_transform | No | HDRMT median transform instead of the wavelet transform (needs hdrmt_layers; omitted = PixInsight default) |