Skip to content

How-ToGPU

How to Remove Gradients and Noise from Astrophotos with GraXpert's Free AI

GraXpert is a free, open-source program that removes light-pollution gradients from astrophotos with an AI model that needs no sample points, and can denoise linear images too. Using GraXpert's README, website and release notes, we explain how to install it, run AI background extraction and denoising, use the command line and fix GPU errors.

By , Systems & Technical Editor

5 min read

How to Remove Gradients and Noise from Astrophotos with GraXpert's Free AI

Light pollution, missing flats and vignetting leave stacked deep-sky images with uneven, often colour-tinted backgrounds. GraXpert is a free, open-source program built to remove those gradients, and its AI method does the job without you placing a single sample point. Since version 3 it can also remove noise from linear images with a second AI model. This guide is based on GraXpert's own README, website and release notes.

What GraXpert does and why gradients matter

The GraXpert developers describe gradients as gradual changes in brightness that aren't part of the astrophoto but come from outside interference. They list light pollution, incorrect or missing flat correction, the natural brightness gradient of the night sky and quirks of your optics, such as vignetting, as typical causes. Removing them makes the image look better and makes later processing simpler, and it can also remove colour casts. The developers go as far as calling gradient removal very useful, if not mandatory.

GraXpert is a standalone program, not a plug-in for other software. It offers traditional interpolation methods (Radial Basis Functions, Splines and Kriging) that need you to select sample points in the background, plus an AI method that needs no user input. That AI method is what most people will want to start with.

What you need

  • A Windows, macOS or Linux PC. GraXpert's website offers Windows AMD64, macOS ARM64, macOS AMD64 and Linux AMD64 builds.

  • A stacked image, ideally still linear (unstretched). GraXpert's denoising model is designed for linear images. The examples in GraXpert's README use FITS files.

  • A graphics card is optional. GraXpert's release notes say that on Windows it uses DirectML for GPU acceleration, which needs a DirectX 12 compatible graphics card. On Linux it relies on CUDA 12, and on macOS on CoreML. If you're unsure how these Windows AI back ends differ, see our DirectML vs Windows ML explainer.

A mid-range card such as the ASUS RTX 5060 8GB Dual OC or ASUS RX 9060 XT 16GB Dual meets the DirectX 12 requirement, but GraXpert doesn't publish a minimum GPU, and it can run on the CPU.

Step 1: Download and install GraXpert

Get the latest official release from GraXpert's GitHub releases page. At the time of writing the latest stable version is 3.0.2, released in May 2024, and it's offered for Windows as an .msi installer, with .dmg files for Intel and Apple silicon Macs and a zip for Linux. On Linux, the README says you need to make the program executable with chmod u+x ./GraXpert-linux before starting it. On macOS, drag GraXpert into Applications.

There are also 3.1 release candidates on GitHub, marked as pre-releases. Release candidate 1 added an AI model for object deconvolution (sharpening structures in nebulae or galaxies), and release candidate 2 added a model for stellar deconvolution. The developers list a known issue in both where opening .png files fails, so stick with 3.0.2 unless you specifically want to try deconvolution.

Step 2: Load your image and run AI background extraction

Open GraXpert and load your stacked image. Choose the AI method for background extraction rather than one of the interpolation methods, so there's no need to place sample points. GraXpert will build a model of the background and remove it.

You'll need to choose how the background is removed. GraXpert offers two correction types: Subtraction, which is the default, and Division. You can also set a smoothing strength from 0 (no smoothing) to 1 (maximum smoothing). Save the result. On the command line, the -bg option also saves the background model, so you can see exactly what was removed.

If the AI result isn't right for an image, you can fall back to the manual interpolation methods and place sample points in empty background areas yourself.

Step 3: Denoise the image

GraXpert 3.0 added an AI model for denoising linear images, and the denoising strength runs from 0 (minimum) to 1 (maximum), with a default of 0.5. Because the model is built for linear data, it makes sense to denoise before you stretch the image. Version 3.0.2 added a cancel button for denoising.

GraXpert denoises the image in tiles, several at a time. The batch size can be set from 1 to 32 (default 4), but the developers warn that raising it can cause out-of-memory errors, so leave it at the default unless you know your graphics card has memory to spare. Our VRAM guide explains how much memory different cards have.

Step 4: Automate it from the command line

The AI methods can also run from the command line, which is handy for processing several images. On Windows the basic command is:

GraXpert-win64.exe my_image.fits -cli

That runs background extraction (the default operation) and saves the result with "_GraXpert" added to the file name. Useful options include:

  • -cmd denoising to run the denoising model instead of background extraction

  • -output name to choose the output file name

  • -correction Division and -smoothing 0.1 to change the background correction

  • -bg to save the background model as well

  • -strength 0.5 and -batch_size 4 for denoising

  • -gpu false to turn off GPU acceleration

  • -ai_version 1.1 to pick a specific AI model version (otherwise the latest is used)

You must include -cli, otherwise GraXpert opens the graphical interface with your file loaded.

Troubleshooting

GraXpert's release notes list a known issue where onnxruntime can fail on some Windows 10 systems with "ImportError: DLL load failed while importing onnxruntime_pybind11_state". The workaround is to turn off hardware acceleration in the Advanced tab on the right of the window. Since 3.0.2 you can turn hardware acceleration off for exactly this kind of driver problem, at the cost of running on the CPU.

For questions, the developers point users to the Dark Matters Discord.

Where GraXpert fits in your workflow

GraXpert handles one stage of processing. You'll still need stacking software before it, and something to stretch and finish the image afterwards. If you also want to remove stars so you can process the nebula and the stars separately, see our comparison of StarNet vs StarXTerminator, and our round-up of the best AI astrophotography software for PC. For everyday photos rather than astro images, our best AI photo denoise software guide covers tools built for general photography.

The bottom line

GraXpert is a free, open-source standalone program that removes light-pollution gradients from astrophotos with an AI model that needs no sample points, and since version 3 it can also denoise linear images. Install 3.0.2 from GitHub, run AI background extraction (Subtraction by default), then denoise before stretching. A DirectX 12 graphics card speeds things up on Windows but isn't required. Forge PC hasn't tested it, so compare the result with your original before moving on.

In this article

Sources

  1. 01GraXpert website
  2. 02GraXpert README (GitHub)
  3. 03GraXpert releases (GitHub)

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

Best GPU for Blender in 2026

Best Picks

Best GPU for Blender in 2026

Building or upgrading a PC for Blender rendering? The GPU and its VRAM matter most. We pick the RTX 5070 Ti, RTX 5090, RTX 5060 Ti 16GB, Arc B580, RX 9070 XT and Radeon AI PRO R9700 using the Blender manual, official specs and Puget Systems' credited test results.

Hannah Vance8 min

Best Free Emulators for PC in 2026

Best Picks

Best Free Emulators for PC in 2026

The best free emulators for PC in 2026: RetroArch for retro systems in one app, PCSX2 for PS2, Dolphin for GameCube and Wii, DuckStation for PS1 and PPSSPP for PSP. We compare the systems each covers, licences, BIOS needs, hardware requirements and features from each project's official site, and explain how to stay legal with your own games and BIOS dumps.

Hannah Vance6 min

DLAA vs DLSS: Which NVIDIA Setting Should You Use?

Versus

DLAA vs DLSS: Which NVIDIA Setting Should You Use?

DLAA and DLSS Super Resolution use the same NVIDIA AI model but do opposite jobs: DLSS renders at a lower resolution and upscales for more frames, while DLAA stays at native resolution and uses AI purely for anti-aliasing. Using NVIDIA's documentation, we compare image quality goals, performance, RTX support and models, and show how to enable DLAA with the NVIDIA app.

Callum Reid5 min

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

How-To

How to Set Up PCSX2 on Windows: Play Your PS2 Games on PC

PCSX2 can play much of the PlayStation 2 library on a Windows PC at higher resolutions than the original console. Using PCSX2's official documentation, we explain the hardware you need, how to install it, how to dump the BIOS from your own PS2 and your game discs, which renderer to choose, how to save safely and what to check if games run slowly.

Marcus Thorne8 min