GraXpert Interface

Siril provides an interface to the external GraXpert tool. This is a third party piece of Free and Open Source software that provides sophisticated background removal and denoising routines. Although Siril's built-in background extraction uses a selected GraXpert algorithm, Siril currently does not directly support AI inferencing. This is because of the complexities of cross-platform GPU support and the fact that Siril is written in C, whereas almost all AI code uses python. Integration with GraXpert therefore provides a way to bring advanced AI astronomical image processing functionality to Siril users in a seamless manner.

In order to be used, the path to the working GraXpert installation must be set in Preferences->Miscellaneous.

Warning

If you are wondering why GraXpert doesn’t launch, please run it outside Siril first. It’s not Siril’s fault if it’s not supported by your computer or badly installed for some reason. Ensure you can correctly open GraXpert using its own GUI and that it works correctly by itself. If this is assured, then it will work when correctly configured in Siril.

Background Extraction

The GraXpert background extraction interface works in a very similar way to the built-in one. In AI mode there is not even any need to generate a background sampling grid: it is just necessary to select the AI algorithm (which is the interface default anyway) and click Apply.

dialog

GraXpert interface, showing background extraction options.

In the other modes (RBF, Kriging and Spline) it is necessary to set a background sampling grid. This works in exactly the same way as setting the grid for the built-in background extraction tool (because it uses the same code). Samples can be automatically placed by providing a density (Samples per row) and clicking on Generate. If areas of the image are brighter than the median by some factor Grid tolerance times sigma, then no sample will be placed there. Note that to achieve commonality with GraXpert's own UI the Siril interface will allow setting the grid tolerance as low as -2.0 and up to +6.0.

After generation, samples can also be added manually (left click) or removed manually (right click).

Unlike the built-in background extraction algorithm it is not possible to preview the background model, as it is calculated using external software, but there is an option Keep background which will save the background model, as computed by GraXpert, for subsequent inspection if required.

For additional details of how GraXpert background extraction works, see the website.

Deconvolution

From version 3.1 onwards, GraXpert supports deconvolution. Two modes are possible:

  • object deconvolution,

  • stellar deconvolution.

These modes can be selected using the switch at top left.

To use deconvolution, simply select Deconvolution in the upper tab. This operation has two parameters, Strength, which takes values between 0.0 (no deconvolution) and 1.0 (maximum deconvolution) and Image FWHM (in pixels), which also takes values between 0.0 (prioritises fine structure retention) and 14.0 (prioritise deconvolution ability). If you set it to zero you can see a very (too) small effect on processed image, if so set it higher.

dialog

GraXpert interface, showing deconvolution options.

Denoising

To use GraXpert for denoising, select Denoising in the tab. This operation has only one parameter, Strength, which takes values between 0.0 (no denoising) and 1.0 (maximum denoising).

dialog

GraXpert interface, showing denoising options.

General settings

  • Use GPU: This option tells GraXpert to use the GPU for AI inferencing, if one is available. It is safe to leave this set, as GraXpert will fall back to CPU if no GPU is available. Note that the background extraction AI model is much quicker to run and the AI inferencing has a significant set-up time, so for background extraction you may find that CPU inferencing is marginally quicker. The denoising algorithm is significantly slower and it is always worth using AI inferencing for this if possible

  • AI batch size: This option sets how many chunks GraXpert will attempt to run inferencing on in parallel. Note that setting this too high may cause out-of-memory errors, and may or may not provide a speed benefit dependent on your hardware.

  • Apply to Sequence: Using GraXpert via the Siril interface provides a unique option that is not even available using GraXpert stand-alone: the ability to apply GraXpert processing to sequences of images. In order to achieve this, simply select the Apply to sequence check box. The sequence will be saved with the prefix graxpert_.

Siril command line

graxpert_bg [-algo=] [-mode=] [-kernel=] [-ai_batch_size=] [-pts_per_row=] [-splineorder=] [-samplesize=] [-smoothing=] [-bgtol=] [ { -gpu | -cpu } ] [-ai_version=] [-keep_bg]
Runs the external tool GraXpert in background extraction mode.

The following optional arguments may be provided:

-algo= sets the background removal algorithm and must be one of ai, rbf, kriging or spline;
-mode= sets the background extraction mode and must be one of sub or div;
-kernel= sets the RBF kernel and must be one of thinplate, quintic, cubic or linear;
-pts_per_row= sets the number of points per row on the background sampling grid (default = 15);
-samplesize= sets the sampling box size for each sample (default = 25);
-splineorder= sets the spline order for use with the spline algorithm (default = 3);
-bgtol= sets the background tolerance between -2.0 and 6.0 (default 2.0);
-smoothing= sets the amount of background smoothing (default = 0.5);
-keep_bg sets GraXpert to save the indicative background image;
-cpu sets GraXpert to use CPU only;
-gpu sets GraXpert to use a GPU if available (and otherwise fall back to CPU);
-ai_batch_size= sets the batch size for AI operations (denoising and the background removal AI algorithm) (default = 4: bigger batch sizes may improve performance, especially on CPU, but require more memory). The optional argument -ai_version= forces a specific version of the AI model. Note that GraXpert AI background removal is comparatively fast anyway so at present there is little need to specify an older model for speed reasons even if running in CPU-only mode. If this argument is omitted, the latest available AI model version is used

Siril command line

graxpert_denoise [-strength=] [ { -gpu | -cpu } [-ai_version=] ]
Runs the external tool GraXpert in denoising mode.

The following optional arguments may be provided:

-strength= sets the denoising strength, between 0.0 and 1.0 (default = 0.8);
-gpu sets GraXpert to use a GPU if available (and otherwise fall back to CPU);
-ai_batch_size= sets the batch size for AI operations (denoising and the background removal AI algorithm) (default = 4: bigger batch sizes may improve performance, especially on CPU, but require more memory). The optional argument -ai_version= forces a specific version of the AI model. For CPU-only usage the latest models may run very slowly, in which case an older model version such as 2.0.0 may provide a more acceptable balance between performance and runtime. If this argument is omitted, the latest available AI model version is used

Siril command line

graxpert_deconv [-strength=] [-psfsize=] [ { -gpu | -cpu } [-ai_version=] ]
Runs the external tool GraXpert in deconvolution mode.

The following optional arguments may be provided:

-strength= sets the deconvolution strength, between 0.0 and 1.0 (default = 0.5) and -psfsize= the estimate of the FWHM of the image, range between 0.0 and 14.0 pixels (default = 5.0);
-gpu sets GraXpert to use a GPU if available (and otherwise fall back to CPU);
-ai_batch_size= sets the batch size for AI operations (denoising and the background removal AI algorithm) (default = 4: bigger batch sizes may improve performance, especially on CPU, but require more memory). The optional argument -ai_version= forces a specific version of the AI model. If this argument is omitted, the latest available AI model version is used

Siril command line

seqgraxpert_bg sequencename [-algo=] [-mode=] [-kernel=] [-ai_batch_size=] [-pts_per_row=] [-splineorder=] [-samplesize=] [-smoothing=] [-bgtol=] [ { -gpu | -cpu } ] [-keep_bg]
Applies the external GraXpert program to a sequence, in background extraction mode. The first argument must be the sequence name; the remaining arguments are the same as for the GRAXPERT_BG command

Siril command line

seqgraxpert_denoise sequencename [-strength=] [ { -gpu | -cpu } ]
Applies the external GraXpert program to a sequence, in denoising mode. The first argument must be the sequence name; the remaining arguments are the same as for the GRAXPERT_DENOISE command

Siril command line

seqgraxpert_deconv sequencename [-strength=] [-psfsize=] [ { -gpu | -cpu } ]
Applies the external GraXpert program to a sequence, in deconvolution mode. The first argument must be the sequence name; the remaining arguments are the same as for the GRAXPERT_DECONV command