The image in layers of detail sizes, each reduced, lifted or left out
Wavelets separates the image into layers of detail, the finest a pixel wide, the next two, then four, eight and so on, and a residual of everything larger. Each layer can then have its noise reduced, its structures lifted or lowered, or be left out. We use it to reduce noise at the scales where it lives, and to bring out the details of a given size without touching the rest.
A multiscale transform splits an image into a sum: detail layers, each holding the structures of one size, and the residual. Added back together they give the image exactly. Working on each layer alone is what makes the method useful: noise lives mostly in the first two or three layers, a nebula's filaments in the middle ones, the large glow in the residual. Reducing the noise of the small layers leaves the larger structures untouched; lifting a middle layer sharpens structures of that size and no others.
Three transforms are offered. The starlet, the à trous wavelet transform with the B3 spline, is the classic one, fast and smooth. The multiscale linear transform separates the layers with Gaussians. The multiscale median transform separates them with medians, which do not ring around stars and edges: a bright star stays in the smallest layer, and lifting a layer leaves no dark ring around it.
Each layer's noise is measured over the whole image, and its threshold is given in units of that noise: 3 means coefficients under three times the layer's noise are taken as noise. A linear mask, made from the image itself, limits the noise reduction to the faint parts of a linear image; deringing takes back the rings a lifted layer leaves; the dynamic range gives room to what a lifted layer brightens or darkens; and the target chooses what of a color image is processed.
Wavelets is our own engine, one process for two of PixInsight's: a PixInsight icon of MultiscaleLinearTransform or MultiscaleMedianTransform opens here, and the panel saves the one that matches its transform.
At the top of the panel, Layers lists the layers and edits the one chosen. Below it are six sections, Transform, Scales, Linear mask, Deringing, Dynamic range and Target, each of which folds away with the arrow beside its title. Under them are the image the process applies to with the live preview's eye, the buttons and the system bar along the bottom. Settings that do not apply to the transform chosen are grayed out.
Layers: The detail layers, the smallest first, and the residual, R, last. Detail layers sets how many there are, from 1 to 16; 4 by default. The list shows each layer's scale in pixels, its bias and its noise reduction (the threshold, the amount and the iterations); the check box beside a layer keeps it or leaves it out. The layer chosen in the list is edited below it:
Transform: How the layers are separated:
Median-wavelet threshold: With the median-wavelet transform: where the image and its median differ by more than this many times their noise, measured over the whole image, the median is used. From 0 to 20; 5 by default. Lower keeps more small structures out of the smooth layers.
Scaling function (row): The starlet's scaling function, as PixInsight writes it: a list of
coefficients separated by commas. The B3 spline, 0.0625,0.25,0.375,0.25,0.0625, by default;
0.5,1,0.5 is the linear interpolation. The coefficients are normalized, so only their proportions count.
Scaling function (column): The scaling function's column filter: the row filter's when empty.
Layer scales: The scales of the layers: Dyadic (1, 2, 4, 8...), the default and the usual, each layer twice the size of the one before; or Linear (1, 1 + step, 1 + 2 step...), growing by a fixed step, for a finer choice of sizes.
Linear step: The step of the linear scales, in pixels, from 1 to 16.
Linear mask: Off by default. On, the noise reduction works through a mask made of the image itself, amplified: for linear images, where the bright parts need less noise reduction than the faint ones. The mask limits the noise reduction only, not the bias.
Amplification: The image multiplied by this to make the mask, from 1 to 1000; 100 by default.
Smoothness: The standard deviation, in pixels, of the Gaussian that smooths the mask, from 0 to 250; 1 by default.
Inverted: On by default: the mask is inverted, so the bright parts are protected and the faint ones get the noise reduction.
Deringing: Off by default. Takes back the dark and bright rings a lifted layer leaves around stars and edges. The starlet and the multiscale linear transform only: the median transform does not ring.
Dark: How much of the dark rings is taken back, from 0 to 1; 0.1 by default.
Bright: How much of the bright rings is taken back, from 0 to 1; 0 by default.
Low range: Room below 0 for what a lifted layer darkens, from 0 to 1: the result is rescaled into the range from 0 to 1 instead of clipped. 0 by default.
High range: Room above 1 for what a lifted layer brightens, from 0 to 1, the same way. 0 by default.
Target: What of a color image is processed; a gray image is processed as it is:
Live preview (the eye): At the end of the Applies to row; Preview in the system bar is the same switch. On by default. The image shows Wavelets applied to the part in view, as the settings change, with the banner "PREVIEW only, nothing applied"; the image itself does not change until Apply. Before, in the banner, or the backslash key held, shows the image as it is. At 1:1 the preview is what Apply gives there. At a reduced zoom the layers are shifted by whole octaves, so a layer of 4 pixels is a layer of 2 at 1:2, and the finest layers, smaller than a screen pixel, are not computed; the noise of each layer is measured on the reduced view. The preview is then close to Apply, not the same: judge noise reduction at 1:1.
Applies to: The image Wavelets works on, chosen in a list of the open images. It shows the image in front, and follows it as we bring other images to the front. Picking another image in the list makes the panel work on that one, its live preview included, without bringing it to the front; the pick stays while we work on other images, and Follow Active, the small button that appears beside the list, makes the panel follow the image in front again. An image that a tool or a run is working on is listed, but cannot be picked.
Apply: Processes the image named in Applies to, in one history step that Undo takes back, through the image's mask if it has one. The size, the sample format, the metadata and the astrometric solution stay as they are. Results are kept within the range from 0 to 1.
Instance: Shows the process as the panel has it now, as text: the settings as a DSPX
process (.dsproc) or as a PixInsight process icon (.xpsm) of MultiscaleLinearTransform or
MultiscaleMedianTransform, chosen under Format. Copy puts the text on the clipboard; Save... saves
it as a file and puts it on the Process Shelf.
Reset: Puts every setting back to its default.
The system bar along the bottom of the panel has the same commands as small icons: at the left, drag to apply and Apply; at the right, Instance, Help (this page) and Reset. Drag to apply, the first icon, carries the process with its settings: dropped on an image's window, it applies them to that image, whatever image the panel works on; dropped on the Process Shelf, it is kept there as a row of its own. With , the bar alone has them.
For each plane, a channel, the lightness or the luminance, the transform smooths the image again and again, each time at twice the scale: each detail layer is the difference between two successive smoothings, the residual the last smoothing. Then, layer by layer:
Then deringing and the dynamic range, as in Unsharp Mask, and the planes are put back into the image.
PixInsight's multiscale algorithms are not published in full, so our engine follows their documentation and the published definitions of the transforms: results are close to PixInsight's in kind, not the same, in either of DSC Studio's modes. Icons go both ways with every parameter. A few defaults are ours, where we found them better: the scaling function is the B3 spline (PixInsight's MultiscaleLinearTransform starts from the linear interpolation), and the median transform's threshold is 3 (PixInsight's is 1).
Some of PixInsight's options are not done yet: the median transform's adaptive noise reduction; the large scale transfer function; the noise thresholding of all layers at once; the layer and mask preview modes; and the deringing maps. An icon keeps their values, and a run that would need one says it was left out.
Noise reduction on a linear image. Use the Luminance target, or RGB/K, with the linear mask on: the faint sky gets the reduction and the bright parts are protected. Thresholds of 3, 2 and 1 on the first three layers are a good start.
Color noise. The Chrominance target with noise reduction on the first four or five layers smooths the color blotches and leaves the luminance details alone.
Bring out structures of one size. A bias of 0.1 to 0.3 on a middle layer lifts the structures of that size. Use the median transform, or deringing, so the stars get no dark rings.
Take the large glow away. Leaving out the residual keeps only the details: with Pixel Math the result can be a mask of the structures, or a high-pass image to blend.
GPU. In DSPX mode the starlet transform (the B3 spline or another scaling function, with dyadic or linear scales) runs on the graphics card when the image is a quarter of a megapixel or more. Each plane goes to the card once, and the layers, their noise, the thresholds, the linear mask and the recomposition stay there. A 24 MP color image runs about ten to fifteen times faster than on the processor, with the RGB/K target and with the Lightness, Luminance or Intensity target alike: the conversion of the colors runs on the card too, and the image does not go back and forth in between. The Gaussian, median and median-wavelet transforms, the deringing and the dynamic range extension run on the processor, which makes the gain smaller when deringing or the range extension is on. An image with a NaN or an infinite value stays on the processor. The result agrees with the processor's to a few millionths of the range, and the noise measured in each layer is the same. Choose CPU only in to keep it on the processor, and see The Processor and the GPU.
HDR Compression: works on the same layers to compress the large structures.
Multiscale Sharpen: a gain per scale of the starlet, for sharpening.
Unsharp Mask: sharpening at one scale, with the same deringing.
Blur: a simple separation of the large structures from the small ones.