LRGBDeconvolutionMatch


Prepare registered linear luminance and RGB images by comparing stellar halos and widths. [more]

Keywords: deconvolution, BlurXTerminator, LRGB, FWHM, halos, reference, blink

Contents

[hide]

1 Description

[hide]

LRGB Deconvolution Match helps prepare linear Luminance and RGB images for LRGB composition, particularly when the data were acquired with different telescope setups that may have had different pixel scales. The inputs must already be registered to a common pixel grid. Choose the sharper image as the reference and set its BlurXTerminator sharpening. Inspect the reference before and after deconvolution, then let the script adjust the other image to match the measured halo profiles while checking stellar widths independently.

The script estimates Sharpen Stars for the other image from the measured reference sharpening and holds that value fixed. Only Adjust Star Halos is varied, minimizing differences in the measured outer stellar profiles. FWHM agreement is checked separately. Sharpen Nonstellar is a value you choose for both images, and Automatic PSF stays enabled. The reference result stays fixed during matching.

After reviewing the results, choose either to create new linear image windows or to apply the results directly to both input images with Undo support. Calculating and blinking previews leave the inputs unchanged. Stretching and LRGB combination are separate steps that you perform afterward.

2 Opening the script

[hide]

With the script installed in the TGScripts folder through the standard PixInsight script installation, choose Script > TG Scripts > LRGB Deconvolution Match. Click the document symbol at the bottom right to open this manual.

Version 1.14.3 requires PixInsight 1.9.5 or later and an installed, licensed BlurXTerminator with its AI model. Open a grayscale luminance image and a three-channel RGB image before starting.

If BlurXTerminator is unavailable, the script shows an explanatory message and closes without changing any images.

The Images, Deconvolution settings and BlurXTerminator report sections can be collapsed independently by clicking their headers or arrow buttons. All three start expanded. Deconvolution settings contains the Reference deconvolution, Other image: halo optimization and Shared deconvolution groups. Collapsing a section preserves its settings and calculated results; expand it again to view or edit its contents. The preview tabs and bottom action buttons remain available. Section toggles are unavailable while processing.

Drag the triangle at the bottom-right corner to resize the dialog. The image previews start with a compact preferred size and can shrink further; the minimum dialog size is determined by the visible controls. Collapse sections to allow a smaller window. Section toggles preserve your chosen window size when the controls fit, and expanding a section enlarges the window only when necessary to avoid overlap. In a small window, use the scroll bars in FWHM comparison to reach the complete plot, legend and explanatory text.

The contents of Images and Deconvolution settings retain their initial width and stay aligned to the left when the dialog is widened. Additional space appears to their right. The collapsible section headers, previews and report expand with the window. The FWHM comparison scroll bars adapt to the space needed by the plot and wrapped text as the window is resized. Hover over the Other image group or either halo limit field for an explanation of its estimated sharpening and halo matching.

3 Preparing the input images

[hide]

Both inputs must be linear, in floating-point format, without alpha channels. A display STF is fine. Register and crop the images to the same pixel grid and dimensions, removing empty registration borders. Each image must be at least 64 by 64 pixels and contain at least 20 reliable common stars.

Images from different telescopes may have different original pixel scales. Complete any required resampling and registration before using this script. Choose the reference according to the effective star resolution in the registered images.

Accurate registration is essential for a meaningful comparison. The script does not align, resample or crop images, and cannot confirm that they are linear from their appearance alone.

4 Images

[hide]

Luminance: select the open grayscale image.

RGB: select the open color image.

Sharper reference: select L or RGB, or choose Auto to use the image with the smaller measured median star FWHM. A tie selects L. You can select the reference explicitly when your knowledge of the data gives a better basis for the choice.

Both image selectors start empty. A saved process instance restores the image selections and settings that you saved.

5 Reference deconvolution

[hide]

Sharpen Stars: the stellar sharpening applied to the reference. The default is 0.50; the available range is 0 to 0.70.

Adjust Star Halos: the halo adjustment applied to the reference, from -0.50 to +0.50. The default is 0.00.

These values are applied once to the reference. Inspect the Reference before/after tab before matching the other image. If the reference shows ringing, dark halos or excessive sharpening, revise these settings and calculate its preview again.

6 Other image: estimated sharpening and halo optimization

[hide]

Sharpen Stars is calculated after the reference preview using this empirical estimate:

S_other = S_reference * (1 - F_reference_after / F_other_before) / (1 - F_reference_after / F_reference_before).

S denotes Sharpen Stars. F denotes the median combined stellar FWHM. All three median widths use the same reference-qualified star selection. If Luminance is the reference, F_other_before is measured in the original extracted linear RGB luminance. If RGB is the reference, the estimate is calculated for Luminance instead.

The estimate assumes approximately proportional fractional sharpening and similar responses in both images. It is not an exact conversion supplied by BlurXTerminator. The estimate appears below the preview tabs and stays fixed in every trial of the other image.

The script does not cap or clip this estimate. BlurXTerminator validates the value against its own supported parameter range. If the installed process rejects it, matching stops before running the other image, reports the original estimate and process error, and keeps the reference preview available. The script cannot extend a parameter range enforced by the installed process.

Calibration requires a positive reference Sharpen Stars value and a measurable reduction in reference FWHM. It cannot produce a positive sharpening estimate if the other image is already narrower than the reference result. An invalid calibration is reported; no substitute sharpening value is chosen.

Minimum Adjust Star Halos and Maximum Adjust Star Halos: defaults -0.50 and +0.50. Only this parameter is optimized. Narrow the interval to limit halo changes, or set both limits to the same value to hold it fixed. The initial halo setting follows the installed BlurXTerminator default, limited to this interval.

The search follows measured outer-profile differences using Newton approximation. It can stop when both the halo-profile and Luminance versus extracted RGB luminance FWHM criteria are met, or when no further improvement is found within the search bounds and run budget. Every trial starts from the original image. The selected trial is retained without another BlurXTerminator run.

FWHM uses fixed limits: 5 percent for the median absolute paired mismatch, and 10 percent for the 90th-percentile mismatch and supported regions' median mismatches. The final result also checks each RGB channel against Luminance using these limits. The halo profile limits are described below. No tolerance setting is required.

The halo limits apply only to the other image. The reference retains its own settings. The final values actually used for each image appear below the preview tabs. A result satisfying both profile and width criteria is preferred. Otherwise, the script retains the usable trial with the closest outer profiles, preferring results without detected dark rings, and reports REVIEW. It does not enlarge halos solely to improve FWHM agreement. With Sharpen Stars fixed, matching the halo and core simultaneously may be impossible.

7 Halo profile comparison

[hide]

Halos are measured directly from image pixels around the same isolated, unsaturated stars in Luminance and extracted linear RGB luminance. An analytic PSF FWHM alone does not describe these outer wings. Halo measurements use a reliable subset of the common stars, so the halo count can differ from the FWHM count.

For each star, a circular aperture and a separate outer background annulus fit inside its isolated measurement area. The background is estimated locally and subtracted. Flux inside the circular aperture normalizes that star's measurements, allowing images with different exposure times and stellar brightnesses to be compared. This normalization affects measurements only.

Six annuli sample the outer profile from a radius equal to the reference star's combined FWHM to the flux-aperture radius. Both images use the same radii in registered-image pixels, held fixed for every trial. Each profile follows its measured stellar center. Annular flux is expressed as a fraction of the flux in the full aperture. The measurement therefore responds to both the amount and radial distribution of light in the wings.

The halo mismatch for a star is the sum of absolute differences between its six normalized annular fluxes, divided by the average of the two profiles' summed absolute annular fluxes. Zero means identical profiles. The halo criteria require a median mismatch of no more than 10 percent and a 90th-percentile mismatch of no more than 25 percent. These are practical acceptance limits, not statistical confidence intervals.

Profile selection requires adequate total stellar and outer-wing signal, room for the background annulus, and reliable measurements in both source images and the deconvolved reference. At least 20 profiles are required. This selection stays fixed during matching; a trial must retain at least 20 profiles and 80 percent of that selection. Failed measurements incur a penalty and cannot improve the search by disappearing.

Negative background-subtracted annular flux is preserved. Two adjacent annuli significantly below the local background, with a combined negative signal exceeding 0.3 percent of aperture flux, flag a possible dark ring. A full PASS requires no such flags in the accepted trial or measured reference profiles. This is a check for detectable rings, not a guarantee that every artifact has been found.

The report shows the halo star count, median and 90th-percentile mismatch, dark-ring count and wing flux ratio. The ratio is the median normalized wing flux of the other image divided by that of its corresponding reference star: 1 indicates equal wing flux, greater than 1 means more light in the other image's measured wings. The mismatch also accounts for the distribution among annuli, so equal total wing flux alone is not sufficient.

The comparison covers the reported finite apertures around reliable unsaturated stars. It does not measure arbitrarily large optical reflection halos or establish agreement for saturated bright stars. Background structure, noise and different spectral responses can limit the match. Inspect the blink preview across the field before accepting the images.

8 Shared deconvolution

[hide]

Sharpen Nonstellar: choose the sharpening strength for nonstellar detail, from 0 to 1. Its default follows the installed BlurXTerminator default. The selected value is used for both images and remains fixed during matching.

Automatic PSF is enabled for both images and every trial. All remaining BlurXTerminator options use their installed defaults.

10 Using the results

[hide]

Both result buttons become available after the full match, including a result marked REVIEW. Inspect the previews and the report before using either button. Neither button runs BlurXTerminator again, stretches the data, performs LRGB combination or saves files to disk.

Green checkmark: create two new image windows and leave the inputs unchanged. Their names use the input image identifiers with a _BXT suffix; an additional numeric suffix avoids a name conflict.

Blue square: replace the pixels of both selected input images with the reviewed deconvolved results. No new output windows are created. The input names, image metadata and display settings are retained. The full images are updated, irrespective of attached masks; the masks and their enabled states are retained.

Each input receives one Undo step. Close the script, activate the relevant image and use PixInsight's Undo to restore its previous pixels. Undo each image separately to restore the pair. Save the images yourself when you are satisfied.

After applying, the blue square is disabled for those results. The previews and report remain available, and the green checkmark can still create copies of the same results. Calculating again uses the current input pixels: undo the application first if you want to try different settings on the original data.

If an original input has been closed or its processing history or geometry has changed, applying is refused. Select the intended inputs and calculate a fresh preview.

11 Reference before/after preview

[hide]

This tab compares the reference before deconvolution with its initial BlurXTerminator result. An RGB reference is displayed as its extracted luminance in both frames.

Play alternates every 0.75 seconds. Step pauses blinking and switches one frame. The label above the image identifies BEFORE BXT or AFTER initial BXT. Zoom and pan are preserved while switching frames. Use the magnifier symbols above the image for zoom in, zoom out, 1:1 and fit.

Display STF uses the same display stretch for both frames, based on the original reference. Brightness is not equalized between the before and after images. Disable Display STF to view the linear data directly.

This preview remains available after matching and continues to show the same reference result. Switching tabs stops playback. Preview display settings never change the linear output pixels.

12 BlurXTerminator report

[hide]

The report below the tabs shows one table row for Luminance and one for RGB. The first column identifies the image and its role as reference, optimized image or pending image. Separate columns show the applied Sharpen Stars, Adjust Star Halos and Sharpen Nonstellar values. Hover over a table cell to read its full contents if an image identifier is too long to fit.

After the reference-only calculation, its applied settings are shown while the other image's settings remain blank, indicated by dashes. Beneath the table, read the Automatic PSF mode, number of BlurXTerminator runs, reference before/after FWHM, paired-star count and the other image's Sharpen Stars estimate.

After matching, both rows show the settings actually used for the retained results. The accompanying text shows PASS or REVIEW, Automatic PSF mode, run count, fixed sharpening estimate, halo-profile statistics and the reason the search stopped. The estimate is reported separately from the applied settings. Changing processing settings or pressing Reset clears the calculated report.

13 FWHM comparison

[hide]

This tab first shows the reference measurements after calculating its preview. After matching finishes, one plot contains three sets of paired star measurements, each with a distinct color and symbol:

Blue filled circles: Luminance before BlurXTerminator on the horizontal axis, and Luminance after BlurXTerminator on the vertical axis.

Orange outlined squares: extracted RGB luminance before BlurXTerminator on the horizontal axis, and extracted RGB luminance after BlurXTerminator on the vertical axis.

Green outlined diamonds: final deconvolved Luminance on the horizontal axis, and final extracted RGB luminance on the vertical axis. This series directly compares the two retained output images.

The legend explicitly identifies the horizontal (x) and vertical (y) measurements for every series. Blue and orange keep their colors whichever image is the reference. The reference and optimized image are identified in the legend. The green final-image comparison is added only after matching finishes.

For each star, the fitted PSF provides widths along its major and minor axes. The combined FWHM is their geometric mean: sqrt(FWHM_x * FWHM_y), the diameter of a circle with the same area as the fitted half-maximum ellipse. All widths are measured in pixels on the registered image grid. The legend reports median combined, major-axis and minor-axis widths in horizontal / vertical order.

Each series has its own paired-star count and least-squares straight-line fit of its vertical widths against its horizontal widths, with a freely fitted slope and intercept. Its fitted line has the same color as its points and spans their measured horizontal range. Every displayed pair contributes equally to that series' fit.

Each axis automatically fits the measurements displayed in that direction, with a small margin. All three series and all measured points are included. The axes can have different ranges and do not have to start at zero. The range updates when the other image's measurements are added.

A dashed gray y = x line marks equal FWHM values. For the blue and orange before/after series, points below this line have narrower stars after deconvolution. For the green final-image comparison, points on the line have equal widths in Luminance and extracted RGB luminance; points above it have wider RGB-luminance stars. This reference line is separate from the three fitted lines. With independently scaled axes, its displayed angle need not be 45 degrees. It appears only where the displayed horizontal and vertical ranges overlap. If there is no overlap, the legend indicates that the equality line lies outside the displayed ranges.

For blue and orange, the paired count is shown relative to the initial reliable common-star selection. The reference series includes valid before/after measurements; the optimized image uses reference-qualified stars with valid measurements in its retained result. The green series counts valid pairs relative to the reference-qualified selection used during matching. A star with a rejected measurement is excluded from both sides of that comparison. Counts can differ between series.

The fitted equation uses x and y as defined in the legend. R-squared, also called the coefficient of determination, is the fraction of the variation in the vertical widths explained by that series' fitted line. A value of 1 means a perfect straight-line fit; 0 means the line explains none of that variation. For example, 0.60 means that the fit explains 60 percent of the measured variation in y. A high R-squared does not establish equal star widths: points can follow a straight line that differs from y = x. It also does not assess image quality or guarantee a good LRGB match. A short explanation appears below the scatter plot.

If horizontal widths have insufficient spread, no fitted line is shown and the reason is displayed. R-squared is undefined when all vertical widths are equal.

The reference measurements and fit stay unchanged when the additional series are added. Viewing this tab or switching display options does not run BlurXTerminator again. Changing processing settings or pressing Reset clears the plotted results.

Below the plot, the final comparison reports paired-star count, median absolute mismatch and 90th-percentile mismatch between final Luminance and extracted RGB luminance. A 90th-percentile value of 10 percent means that 90 percent of the measured pairs differ by no more than that amount. Relative mismatch is the width difference divided by the average of the two widths.

PASS means the halo-profile, dark-ring and star-width criteria are met, including separate FWHM comparisons of the red, green and blue channels against L. Halo profiles are compared between L and extracted RGB luminance. REVIEW means at least one criterion was not met. You can still create the images for inspection. The reference is not weakened to force agreement. The Process Console provides individual RGB-channel and regional results.

Similar FWHMs do not guarantee identical star profiles, halos or appearance after stretching. Inspect bright and faint stars across the field before proceeding to LRGB combination.

14 Matched L / RGB preview

[hide]

This tab blinks the final deconvolved L against the extracted luminance of the final deconvolved RGB image. The frame label identifies the image and whether it is the reference. The RGB output itself remains a color image.

Play, step, zoom and pan work as in the reference preview. Display STF uses a shared display stretch. Align preview brightness compensates for brightness differences to make star widths easier to compare. Turn it off when you want to inspect the unadjusted relative brightness.

All display adjustments affect only the preview. They do not stretch or normalize the output images.

15 Automatic star measurements

[hide]

Star detection and PSF fitting are automatic. No fitting parameters need to be entered. As in Linear Master Blend, the script samples isolated, unsaturated stars across the image and measures corresponding stars in both inputs. It chooses a suitable Moffat or Gaussian profile for each pair and rejects unreliable or inconsistent measurements.

Each selected star keeps the same profile family and fitting area before and after deconvolution. RGB is measured through its extracted linear luminance, using the image's RGB working-space luminance coefficients. The separate RGB channels are also checked. Display STF and preview brightness alignment do not affect measurements.

The reference must have at least 20 reliable before/after pairs. That reference-qualified star selection is held fixed while the other image's halo setting is optimized. Failed measurements in a trial are counted as missing; they are not replaced by newly detected stars.

The match requires at least 20 valid pairs and at least 80 percent of the reference-qualified stars. Both final median FWHMs must be at least 1.60 pixels. The script also checks regional agreement and each RGB channel. A region with fewer than five stars is reported as having insufficient support; it cannot establish agreement there.

The Process Console reports how many stars were accepted. The plot shows the number of pairs contributing to each comparison. If too few stars are available, check alignment, registration borders, crowding, saturation and sampling.

16 Symbol buttons

[hide]

Reference-tab magnifier: calculate the reference deconvolution and its before/after preview.

Bottom magnifier: match the other image to the prepared reference, or calculate both stages if needed. After completion, calculate a fresh pair.

Play/stop and step: blink or switch frames in the active preview tab.

Triangle: drag onto the workspace to save your selected images and settings as a process instance. Run the instance globally with those images open.

Reset: restore defaults, clear both image selections and clear the previews and estimate. Reference Sharpen Stars returns to 0.50 and Adjust Star Halos to 0.00; the other image's halo limits return to -0.50 through +0.50.

Green checkmark: create two linear output windows from the completed match. It is unavailable after the reference-only stage.

Blue square: apply the completed results to both input images with one Undo step per image. It is unavailable after the reference-only stage or after the same results have already been applied.

Red cross: close the script. Created output images and changes applied to input images are retained.

Document: open this user manual.

17 Troubleshooting

[hide]

BlurXTerminator is unavailable: install or enable the RC Astro module for your current PixInsight version. Open BlurXTerminator to check its license and AI model, then run the script again. Restart PixInsight if requested during installation. After a PixInsight upgrade, check that BlurXTerminator is available in the running application even if its module files are still present on disk.

Too few usable stars: verify registration and border cropping. Very crowded, saturated, star-poor or undersampled images may not provide a reliable comparison. Reconsider strong reference sharpening if many reference fits are rejected. Star selection and fit rejection are automatic.

Reference below the 1.60-pixel sampling requirement: inspect whether it is oversharpened or undersampled. Reconsider reference sharpening or the image pair.

Cannot estimate Sharpen Stars: the reference needs positive stellar sharpening and a measurable FWHM reduction. Check the reference choice and measurements. If the other image is already narrower than the reference result, reconsider which image should be the reference or the desired reference sharpening.

BlurXTerminator rejects the estimate: inspect the reported value and the process's supported range. The estimate is not clipped, and no other-image BlurXTerminator run is performed. The reference preview remains available. Reconsider the reference settings or image pair; a value rejected by the installed process cannot be used by the script.

Too few halo profiles: the outer wings require more space and signal than FWHM fitting. Crowding, a small isolated area, saturation, faint wings or structured background can leave fewer than 20 usable profiles. Matching stops before processing the other image, and the reference preview remains available.

Halo search reaches a limit or reports REVIEW: inspect the halo-profile report, FWHM comparison and Process Console. A good halo match can coexist with a failed FWHM check. The fixed Sharpen Stars estimate is not adjusted to force agreement. If you narrowed the halo interval, consider allowing a wider interval. Inspect the reference and reconsider its sharpening where appropriate. Dark-ring flags require visual inspection and may indicate excessive sharpening or an unreliable local background.

Preview is empty: select both images and calculate the required stage. Output images look dark: they remain linear; use a display STF to view them.

Help is unavailable: check that the TGScripts installation includes the script's documentation.

18 License

[hide]

The script and its user documentation are distributed under the accompanying MIT license.

This product is based on software from the PixInsight project, developed by Pleiades Astrophoto and its contributors (https://pixinsight.com/).