A night in Texas produces a few dozen exposures; a finished target often has several hundred, sometimes more than a thousand for a mosaic. Processing them in PixInsight means a long series of nearly identical operations: calibrate, align, stack, combine colours, remove noise, stretch. For a few weeks now, that series has been handed to a chain of scripts, launched and monitored by an artificial intelligence agent (Claude Code). The Texas equipment mostly belongs to Renaud Venne-Landry; I take care of acquisition and automation.

How it is wired
PixInsight runs on a Mac; the agent works on a small Linux server at home. The two machines share a network folder: scripts, settings files, logs and JPEG previews go through it. The large files (calibrated and aligned frames, masters, intermediate images) stay on the Mac's disk and never cross the network.
The scripts are written in PixInsight's scripting language (PJSR, a form of JavaScript). They call the usual processes directly — ImageCalibration, StarAlignment, ImageIntegration, BlurXTerminator, NoiseXTerminator, StarXTerminator — without opening any dialog. To launch a script, the agent types a run command in the PixInsight console, then follows the log from the server. The original raw frames and masters are never modified, and the scripts only close the windows they opened: PixInsight remains usable at the same time.
Five steps
| Script | Duration | Role |
|---|---|---|
| Preprocessing | 15 min to 1 h | Missing calibration masters, calibration, alignment, local normalization, stacking, plate solving |
| Panels | a few seconds | Colour combination, BlurXTerminator in correct-only mode, gradient correction, colour calibration, common crop |
| Mosaic | 1 to 2 min | Assembling the panels by their astrometry, matching sky backgrounds |
| Linear | about 1 min | Deconvolution, noise reduction, separation of stars and nebulae |
| Non-linear | about 30 s | Continuum-free Ha, stretch, curves, dark structures, stars added back, export |
Each image is described by a small settings file: the raw frame folders, the palette (LRGB, SHO, HOO), the chosen calibration masters and the rendering parameters. A planner prepares it from the image headers: for each batch (filter, exposure time, temperature), it looks for the matching dark and flat in the master library, or plans to build them. That plan is reviewed before preprocessing starts: choosing flats remains an astrophotographer's decision.
The chart below details the whole workflow, from the first question to delivery.
Looking, not just reading logs
A script can finish without error on a failed image. After each step, the agent therefore opens the previews and looks at them. That is how, for example, these were caught:
- on the Crescent mosaic, a hole of 1 × 11 pixels that were exactly zero at the junction of two panels, which became a black spot after deconvolution; the mosaic script now fills such pixels;
- around galaxies, an artificial dark halo created by the dark-structure enhancement; it is turned off for galaxies;
- burnt-out galaxy cores: two successive passes of HDRMultiscaleTransform, followed by a saturation boost limited to bright areas, give much better results than a single one.

The rendering is then tuned by iteration: each version carries a tag (v1, v2…), and a new pass of the last step takes about twenty seconds. Two or three tries are usually enough. The default finish — two passes of DarkStructureEnhance, a rather bright sky background, a little more contrast — comes from preferences expressed along the way.
Colour
Two colour calibration methods were compared. SPCC (spectrophotometric calibration, based on a star catalogue and the filter curves) gave images that were too orange; on M31, the galaxy's red/blue ratio went from 1.21 to 1.48. The default method is therefore the simplest one: background neutralization, then white taken from the stars in the field. It has its limits: in a very dusty field such as Rho Ophiuchi, the stars are reddened by dust, their average is no longer white and the whole image turns blue. SPCC is then the right choice.
Mosaics and batches
To assemble the panels, the scripts invent nothing: they drive, without their window, the engines of the registration scripts that ship with PixInsight. Each panel is reprojected according to its own astrometric solution, normalized on the stars they share, and sky backgrounds are matched in the overlap areas. On the Pleiades as on the Heart and Soul, no seam is visible.
Several targets can also run one after another from a single launch: eight targets, from raw frames to final image, in about two hours. A trap appeared with the first batch: the calibrated and aligned frames weigh about a hundred gigabytes per target, and the disk filled up. They are now deleted as soon as the masters are done.
An image redone: the Pleiades
The Pleiades mosaic was the first one assembled by the script chain. Its first version showed the cluster and its reflection nebulae well, but the large dust cloud filling the field was barely visible, drowned in a greenish background; a later version kept a teal cast and a large-scale colour gradient.

Two changes transformed it. First, gradients are now removed on each panel, still linear, before colour calibration and before assembly. The tool is MultiscaleGradientCorrection, which compares the sky background of the image with MARS, an all-sky photometric survey, and removes only what does not belong to the sky. It requires a prior flux calibration (SpectrophotometricFluxCalibration), done with the curves of the Antlia filters and of the sensor. An attempt on the already assembled mosaic did not succeed: it really has to be done panel by panel. Second, a final histogram transformation, equivalent to PixInsight's automatic display stretch (ScreenTransferFunction), is applied to the finished image: it brings out the faint structures.
A last revision came from PixInsight's own documentation: tutorials, examples, the starter guide, the process reference pages and the team's posts on the forum. The recommended order is clear: first BlurXTerminator in correct-only mode, which restores clean star shapes and makes the flux calibration more accurate; then gradient correction on each panel, with a scale chosen by PixInsight's rule (4096 pixels here instead of 1024, so as not to erase large structures); then a second pass on the assembled mosaic, with edge correction. This is the current version: a more neutral background without the grey-green veil, and finer stars.

The whole gallery redone
The lessons learned on the Pleiades were then applied to every image on the site, reprocessed in one evening through chained batches. Three changes apply throughout. Gradient correction is now done on each filter, including Ha and OIII, which the MARS database also covers; SII, which the database lacks, goes through GradientCorrection, and a field outside MARS coverage automatically switches to that tool. The Ha of colour images is no longer blended into the red as is: the continuum light, measured in the red channel, is subtracted first, as recommended by the M31 example published by PixInsight. The HII regions of the galaxies then stand out as small, sharp pink spots, and tiny jets from newborn stars, the Herbig-Haro objects, appear in NGC 1333. Finally, the galaxies are calibrated with SPCC.

The rendering of the galaxies went through a series of trials: eight variants of core compression (HDRMultiscaleTransform) and saturation, compared on full-resolution crops. The one kept preserves the detail of M81's core while warming up the colours, which were too beige before.
This reprocessing also revealed two automation traps. A script had left in PixInsight's memory a function named like a system function; every following script used it unknowingly, and plate solving failed with incomprehensible errors. The scripts now run in the V8 JavaScript engine, which starts from a clean environment on every run. The second trap affected mosaics: gradient correction filled the empty areas around the panels, which the crop no longer recognized, and a black rectangle remained in the image.
What is still done by hand
Automation replaces hours of clicking, not judgement. Choosing the targets, the calibration masters and the palette, assessing a rendering, and the final touch-ups of some images are still done by hand. The images published in the gallery are sometimes those touched-up versions.