GraXpert Script

Gradient removal can be sometimes a challenging and time-consuming task. GraXpert AI tries to make this task more easy. The underlying AI model is realized as a neural network which has been trained using images provided by the community and will become better over time with more training data.

You can download this script separately from the toolbox and can use Feature Scripts to install it. You can find all sources on gitlab:


How does the script work?

Does GraXpert not meet your expectations?

The script will save your selected image to your temp folder on your machine, then  it will call GraXpert and adds your image and your settings as parameters. GraXpert will now always use  the AI mode and always uses the latest AI model to calculate the background model of your image. If you changed the Smoothing Factor, GraXpert will add a gaussian blur to this background model. Finally, it will subtract the background from your image and saves it as a new image back into the temp folder. 

If you also selected „Show background model“ GraXpert will also save the calculated background image to the temp folder. GraXpert also normalizes the resulting image to achieve best results. For this reason the GraXpert generated background image is required to be stored in order to show it in PixInsight, because the resulting image is not just the original image subtracted by the background model.

The script recognizes when GraXpert finished its job and will now load the processed image. Your image content will be replaced with the content of the processed image unless you uncheck „Replace the target view“. Otherwise your original image will be cloned by the script and the cloned image content will be replaced. Only the pixel content will be replaced, so any Metadata in the FITS/XSIF header will be still available, including the astrometric solution. 

If you also checked „Show background model“ the script will also load the background model image from the temp folder. Finally, the script will apply a new ScreenTransferFunction unlinked stretch to your image, so you can immediately see the result. Gradient removal should always be the first processing step (after cropping the image, if not done in WBPP), so the image is not color calibrated and for this reason an unlinked stretch should be what you want. In case you prefer a linked stretch for any reason, you can still do this using the ScreenTransferFunction process in PixInsight.   

The GraXpert AI model was trained using a lot of images from our dark matters discord community. But an AI model is only as good as it was trained. If you dislike the result you can either blame us or help us, but blaming will not help you! Please consider providing us your image for training purposes! 

Please follow these instructions and fill out this form: 

GraXpert-AI Contributor Agreement.

Finally, please upload your data together with the above document here: 


For the best user experience you should keep GraXpert up-to-date. Please install the latest version for your operating system from After installation you should run GraXpert at least once to avoid any problems. Sometimes new requested features require both a new script version and a new Graxpert version in order to work. So please ensure you are running the latest versions for both the script and GraXpert!

GraXpert will automatically update the AI model for you, when a new AI model is available. This way you will always benefit from the latest improvements!

Frequently asked questions 

< PixInsight Toolbox

Copyright 2023 by Jürgen Terpe