If you have been using Siril for a while, you have probably noticed that your preprocessing steps are the same every night. Convert your raw frames, stack them, stretch them. Clicking through the same sequence night after night is not just tedious, it also invites mistakes at two in the morning. Siril has a built in answer: its scripting language. In this tutorial we will turn a normal processing session into a repeatable script you can run with a single command.
Why Script Your Processing
Consistency is the real payoff. When every image goes through the same preprocessing chain, your results become comparable across nights and seasons. If you discover that a slightly different background extraction setting works better, you change one line in the script and rerun it. Compare that with trying to remember exactly which buttons you clicked three weeks ago.
Scripts also protect you against fatigue. The most common processing errors, forgetting a calibration step or stacking the wrong frames, disappear when the sequence is written down once and executed the same way every time.
Where Scripts Live
Siril scripts are plain text files with one command per line, usually saved with a .ses extension. Anything you can do from the graphical interface has a matching command. The easiest way to learn the syntax is to open the Siril command line tab and process one session manually while noting the commands echoed in the log. That log is essentially a draft of your script.
A Complete Preprocessing Script
Here is a working example for a one shot color session with light, dark, flat, and bias frames in separate subdirectories.
cd ~/astrophotography/session1
convert light -out=./light
convert dark -out=./dark
convert flat -out=./flat
convert offset -out=./bias
preprocess light -dark=dark -flat=flat -bias=bias -cc=dark -equalize_cfa
stack light/redux_light_ -rej 3 3 -norm addscale
stack bias/redux_bias_
stack dark/redux_dark_ -sum
stack flat/redux_flat_ -norm mul
preprocess flat -bias=bias
load light/stacked_light.fit
bg_extraction -samples=20 -type=1 -degree=2
photometric_color_calibration
asinh -stretch 0.1 0.02
save result
Every line is a command you could type interactively. The script version just runs them in order without waiting for you.
Batch Mode
The real power arrives with the command line. From a terminal you can run a script against a directory like this.
siril-cli -s pipeline.ses -d ~/astrophotography/session1
Now imagine three folders from three nights. A small shell loop runs the same pipeline over all of them while you are at work. That is batch processing: not one image automated, but the whole backlog.
Tips That Save Headaches
Always test a new script on a single session before pointing it at your entire archive. Check that the stacking rejection settings suit your frame counts, because a threshold tuned for twenty frames will throw away good data on two hundred. Keep scripts versioned alongside your images, and when a script produces a noticeably better result than your old manual workflow, promote it to your default template.
Note that command names and options shift slightly between Siril versions, so if a script from an older release complains, check the release notes for renamed options rather than assuming your data is the problem.
From Here
Start small. Script just the conversion and stacking steps first, then add background extraction and calibration once you trust the pipeline. Before long you will find yourself copying a template script into every new session folder as a matter of habit, and your evenings will be spent on the creative parts of processing rather than the repetitive ones. If you missed our earlier guides on background extraction, color calibration, and deconvolution, they pair well with this one.