Integrate two aligned linear master images using measured source quality. Version 1.20.1. [more]
Keywords: linear images, image integration, PSF, FWHM, signal weight, SNR, preview, blink
[hide]
[hide]
Linear Master Blend matches the brightness of two aligned master images and integrates them with quality-based weights. The base quality balance uses PSF Signal Weight (40 percent), PSF SNR (40 percent) and inverse combined FWHM (20 percent). Adjustable Sharpness preference gives additional influence to the master with narrower stellar profiles. The result is a new linear image. Both source images remain unchanged.
[hide]
With TGScripts installed through PixInsight's standard update system, choose Script > TG Scripts > Linear Master Blend.
Open two already aligned and cropped linear masters. Use matching dimensions and either two grayscale images or two RGB images. Remove alpha channels and correct gradients before combining. Both image selectors start empty.
[hide]
1. Select the two images as Master 1 and Master 2. Set Sharpness preference: the default is 1; increase it for more influence from the sharper master.
2. Click the magnifier to calculate Preview. It first measures both master PSFs and selects the master with the lower combined FWHM as the reference frame. It then matches the other master's brightness to the reference and calculates the integration. Master 1 and Master 2 keep their selection order.
3. Inspect the Output preview and blink against either master. Open Measurements to see which master became the reference, both master FWHM X/Y values, the contributions and the output measurements in one table.
4. Click the green checkmark to create the integrated image. Create uses the current preview's normalization and weights. Apply an STF to view the linear image, then save it as XISF.
If you edit either source outside the script, calculate a fresh Preview before creating the result. The script does not save the output automatically.
[hide]
Each source is measured using the same accepted stars. Higher PSF Signal Weight and PSF SNR favor a source. Smaller combined FWHM favors sharper stellar profiles. Combined FWHM is the median of sqrt(FWHM X * FWHM Y) over the matched stars.
Each criterion is normalized across the two sources before the contributions are added. With S for PSF Signal Weight, N for PSF SNR and F for combined FWHM:
Base 1 = 0.4 * S_1 / (S_1 + S_2) + 0.4 * N_1 / (N_1 + N_2) + 0.2 * F_2 / (F_1 + F_2).
Base 2 = 1 - Base 1.
With p for Sharpness preference:
Weight 1 = (Base 1 / F_1^p) / (Base 1 / F_1^p + Base 2 / F_2^p).
Weight 2 = 1 - Weight 1.
Zero applies the base quality balance alone. Increasing p increases the contribution of the master with smaller combined FWHM. At p = 1, a master with half the FWHM receives twice the relative weight it had in the base balance; at p = 2, it receives four times the relative weight. The pair is then normalized to sum to 100 percent. Equal widths leave the base balance unchanged.
Output = Weight 1 * Master 1 + Weight 2 * Master 2, with both masters on the reference brightness scale.
The contributions sum to 100 percent. Equally measured sources receive 50 percent each. One pair of weights applies to the entire image and to all RGB channels. The measured contributions and the numeric combination formula appear below the scatter plot.
PSF Signal Weight combines stellar signal, its concentration, noise and background residuals. PSF SNR compares stellar signal with measured noise. These two metrics share sensitivity to noise. The signal measurements use the accepted star sample, so their absolute values can differ from SubframeSelector measurements based on a different stellar population.
For RGB images, quality is measured on equal-weight linear intensity, (R+G+B)/3, after brightness matching. Sigma remains available separately for each channel. Exposure time and sky conditions are not scored directly.
This is a weighted average of both masters at every pixel. A contribution from a broader-PSF source can broaden output stars. The quality weights balance signal and sharpness; inspect the result rather than assuming that every output measurement will improve.
[hide]
The scatter plot shows the background-subtracted flux of each matched star: the other master horizontally and the reference master vertically. The axes identify Master 1 and Master 2. The yellow line shows the brightness scale to the reference and passes through zero. Blue points support the fit, gray points have reduced influence, and red points are rejected. At least ten reliable stars are required in every channel.
The other master is scaled to the reference independently in each channel. Its background is matched separately using the backgrounds around the accepted stars. This is a global brightness match; it does not remove spatial gradients.
The reference frame is identified above a single table with rows for Master 1, Master 2 and Output. The table reports Sigma, FWHM X, FWHM Y, PSF Signal Weight, PSF SNR, Contribution and Stars. Sigma is the noise standard deviation on the reference image's brightness scale. Hover over a value for measurement details. For RGB images, the channel selector changes Sigma and the scatter plot.
FWHM X and Y are the fitted major and minor axes in aligned-image pixels, which can be rotated relative to the image edges. They do not describe the original camera pixel size or angular resolution. The master rows show the original PSF widths used to select the reference. Channel-wise brightness matching can slightly change an RGB master's combined-intensity PSF; the FWHM tooltip also gives those brightness-matched widths when applicable. Quality weights use the brightness-matched images.
Output measurements are reported after integration and do not change the weights. RGB PSF and quality values describe combined linear intensity and stay fixed when you change the channel selector.
Both sources need reliable quality measurements to calculate weights. If an output diagnostic is unavailable, the created image remains usable; hover over the affected value for the reason.
The output is a 32-bit floating-point image. If the integrated values fall below 0 or above 1, one common brightness transformation brings all channels into that range. The formula label indicates when this is needed. The result remains linear, and reported Sigma is converted back to the reference image's brightness scale.
[hide]
Use the zoom buttons or mouse wheel to inspect the Output preview. Drag to pan. Auto stretch preview affects only the display; the output remains linear.
Choose Master 1 or Master 2 in Blink with. Play alternates between the output and that source every 0.75 seconds. While blinking, the Play button becomes a black square Stop button. Stop returns to the output. Step-forward switches once and pauses playback. Zoom and position stay fixed. Changing the comparison source or opening the measurements tab stops blinking.
Comparisons use a common display scale and stretch. Source values outside the display range can be clipped in the preview only. The coordinate bar shows the linear pixel value under the pointer, or separate R, G and B values. Output values use the created image's scale; source values use the reference image's brightness scale. Display stretching does not change this readout.
[hide]
[hide]
Insufficient stars or a failed brightness fit: check alignment, crop registration borders and use images with enough isolated, unsaturated stars. Different filters or strong processing can make stellar fluxes incompatible.
Noise or quality measurement fails: inspect borders, gradients and processed data. Try Allow k-sigma fallback when appropriate. The script requires reliable source measurements rather than guessing weights.
Inspect stars, halos and faint structures by blinking the output with both sources. FWHM describes stellar sharpness, not depth or every type of detail. A high quality score does not guarantee that different telescope or filter data should be mixed.
Large images require time and memory. Use the console Abort control to cancel processing. Source images remain unchanged.
The script does not align images or remove gradients. The output does not inherit source astrometry, exposure metadata or custom color settings; restore these separately if needed.
If help is missing or unformatted, update the script and documentation through PixInsight's standard update system.
[hide]
The script and guide are distributed under the MIT license in LICENSE.txt. Bundled documentation resources and fonts retain their own licenses.
This product is based on software from the PixInsight project, developed by Pleiades Astrophoto and its contributors (https://pixinsight.com/).