Astronomical exposure reduction (and) image stacking modus
User Manual
Copyright 2017 -18
Asterism, is a Linux based image pre-processing utility, primarily for use with consumer digital
camera (CDC) RAW images, and other image formats. Asterism makes use of freely available
image manipulation programs, common to Linux distributions.
From version (onwards), an applications menu entry and optional desktop link may be
created, replacing the former system installation. Asterism will prompt for programs or selected
functions that are not installed – quit Asterism and install the package.
Installation and running Asterism
1. The programs yad dcraw imagemagick and hugin-tools must be installed - hugin macrofusion
and enfuse are optional.
2. Download the source file and extract the Asterism folder to the user's home
directory (e.g., with an archive manager)
3. Optional - open the Asterism folder and run SETUP - create an applications menu entry and /
or desktop link / icon; or
4. Launch Asterism with RUN; alternatively if you don't want to run binaries
5. open a terminal in the Asterism folder and type 'bash -x ./asterism' Enter - without the quotes
Note: open a terminal anywhere and cd into the Asterism folder or type the path to
asterism - ~/Asterism/asterism
Note: use SETUP to remove the menu entry and / or desktop link
Asterism is open source and was developed to investigate the possibility of creating an authentic
image calibration work-flow, using existing image processing programs – in particular, dcraw
imagemagick and hugin-tools (which uses the panotools library); and, no less, Fred’s
ImageMagick scripts.
The concept is an hands-on image processing pipeline, sufficiently flexible to perform individual
tasks and end-to-end preprocessing. The user may rerun processes, particularly when creating
master frames - the quality of master frames is important to image quality.
That said, most of Asterism’s processes are independent or stand-alone and may be used in
virtually any combination. Best results are achieved by following the suggestions outlined in this
CDC image processing, benefits from a flexible approach. Image sets are often ‘unique’ and of
variable quality. The ability to experiment, compare results and adopt the best processes for
each frame type, better predicts the outcome and saves time.
CDC data can be inconsistent and data linearity may vary between image types (that is, between
bias dark, flat and light frames). The recommended methods should not truncate pixel values.
Asterism processes should be safe and predictable. To that end, Asterism selects the most
appropriate image preprocessing options, where other possibilities exist. The user may tick all
the boxes and Asterism will apply the safest process.
As rule, the best results are obtained with RAW image data, acquired at and below 0°C or (at a
stretch) +5°C, processed with Bias frames and Flat frames. For RAW image data, acquired above
+5°C (rule-of-thumb), the use of the Asterism Defect map and Flat frames is preferred. Dark
frames are optional. Defect map is a better choice, particularly where few dark frames are
Note: Flat frames must be calibrated with a master bias – Superbias is preferred.
Note: The Defect map is created from Dark frames; The “bias is in the dark”, such that, a
Defect map is effective when applied to cooled data.
Asterism noise reduction methods have been tested on a variety of image sets - the best methods
(found thus far) incorporated into Asterism’s work-flow. The QRMax, QRMin method resets
outlying pixel values to the selected quantum Range, 'QRMax' 'QRmin' selected by the user. It’s
not Windsorized Sigma clipping - but it comes close.
The ImageMagick ‘-mean-shift’ operator iterates through every pixel applying the mean value
calculated from the user selected kernel radius. An 'amount' may be applied to smear the result
across neighbouring pixels. This method is particularly useful for creating a Defect map and
reducing noise in flat frames. Otherwise, Asterism provides mean median and polynomial
weighting methods for image combination.
The Superbias, for example, is a large kernel radius, median combination, that narrows the
Gaussian distribution of pixel values, to better represent the bias signal of the image. Note: the
default ‘POLY’ (polynomial weighting) stacking option, automatically removes satellite trails
and similarly generated Artefacts and is the default stacking option.
On a final note - CDCs are (usually) one shot colour (OSC) devices – that is, the image sensor is
overlaid with a colour mosaic (Bayer matrix) or a colour (Fovean) filter. The terms CDC and
OSC are interchangeable, for the purpose of this manual.
Terminology is often used loosely among astrophotographers. For the purpose of this manual,
the following applies;
RAW – RAW data or image data - The image file or data file straight from the camera in its
RAW format (a matrix of numbers defining Red Green and Blue pixel values, the average of
which is the image luminance value) – that is, no processing has been performed on the image.
Note: RAW data is considered to be (nearly) linear; the image has not been stretched -
analogous to film, which requires a chemical process to develop the image.
Noise – unwanted signal generated by various sources.
Noise reduction – various methods of filtering or reducing unwanted signal.
Light frame – an image of the desired object – usually, multiple images, combined to
improve signal to noise ratio (SNR).
Bias frame – an image of the electronic ‘stamp’ of the camera image sensor, in operation -
fixed pattern and predictable.
Dark frame – an image of the dark current / noise, generated during sensor operation –
fixed pattern and predictable, at a given temperature, exposure time and ISO setting.
Flat frame – an image of the optical flaws (noise) obstructions, dust, hair and other
contaminants, visible between the telescope objective / lens and the image sensor.
Special note: for best results, take flat frames at every image session.
Master frame – a noise template representative of either the bias, dark or flat signal - and
referred to as, Master bias Master dark and Master flat.
Defect map – A template used to remove very bright and very dark pixels – these are usually
artefacts and detract from the appearance of the final image. In Asterism the Defect map is
produced by combining dark frames to which significant random noise reduction has been
Preprocessing – the calibration or reduction of noise in light frames by various methods,
including the application of Master frames - followed by deBayering, image alignment and
stacking (registration or combination) of the light frames.
Using Asterism – overview
Follow the installation notes.
A very basic RAW preprocessing work flow is as follows;
1. Choose or create a Project folder* – usually the folder containing the image files - but
the image files may be located anywhere.
Note: the project name is automatically assigned with the name of the project
folder which must be all one word no spaces dashes and underlines are
2. Check ‘Input format’ set to RAW (default).
3. Select the required processes and options, as individual tasks or as a complete
preprocessing run.
4. Accept all other default settings; and
5. Select ‘Process’ on the bottom tool bar.
This is a minimalist approach. The essential switches have been selected and Asterism will
perform the selected task/s and return to the main interface.
Note: By default, all calibration frames (images) are mean (average) combined (to
create Master frames). However, median combination produces better noise rejection
in the Master frames, for less noise contamination of Light frames.
That said, reiterating, use a Superbias to calibrate flat frames and the mean-shift
method to reduce noise in the master flat.
The Superbias can be used to calibrate the light frames but it may be better or
preferred to use the Defect map.
Hint: Try both different methods on a small set of light frames three will do and
compare results before committing to the full image set.
A noise reduction work flow may involve creating a Defect map (or Super-bias) and Master flat
and, if need be, the application of mean-shift noise reduction and / or setting minimum /
maximum pixel values with QRMin and QRMax to the light frames.
Note: QR = quantum range; that is, 0 - 65535 or 65536 colour values (black to white)
for a 16 bit image. Alternatively 0 1 for normalised values basically, there are
65536 values from 0 – 1.
QRMin and QRMax reassign minimum and maximum pixel values to pixels outside
the percentage range selected.
Note: Where ‘MEAN’ stack is selected, in the same processing run, the user is
prompted to reselect QRMin QRMax for light frame stacking.
Noise rejection in the light frames is further enhanced by polynomial stacking, to produce a
clean image, as free of artefacts as possible. ‘POLY’ is the preferred stacking algorithm.
Note: Dark frames will not be used if a ‘Defect map’ is loaded.
A small image set of 3 bias 3 darks (optional), 3 flats and 3 lights (or as many as considered
representative) is a convenient way to gauge the likely outcome of the full image set. Particularly
the noise reduction characteristics of the chosen process.
Asterism’s processing model
This section is provided for completion and is helpful understanding CDC / OSC RAW image
(data) reduction.
A goal of preprocessing is to produce a stacked image with a high signal to noise ratio (SNR).
As previously mentioned, the Asterism preprocessing model assumes that CDC RAW data is not
strictly linear (intended to be data safe).
A work flow suitable for cooled data is;
Signal = (Light Frames – Master Bias) / (Flat Frames – Master Bias)
Traditionally, selecting ‘Dark Frames’ or ‘Master dark’ modifies the algorithm for cameras
without cooling;
Signal = (Light Frames – Master Dark) / (Flat Frames – Master Bias)
Note: CDC Dark frames can be problematic and some astrophotographers prefer not
to use them. Similarly, modern image sensors tend to exhibit less dark current;
therefore, Dark frames remain optional.
Note: Flat frames have a significant bearing on image quality, apart from the removal
of optical artefacts. Good flats make all the difference to an image set.
Note: Bias frames are essential to Master flat creation.
Image and calibration frame acquisition
This section is provided for general reference and is not intended to be a complete discussion
about image acquisition or calibration.
Light frame acquisition is subject to a range of variables and often, quality is a matter of
experience and personal preference. Calibration frames are more predictable.
Bias frames should be taken at the camera’s lowest ISO setting and the fastest shutter speed,
with the sensor in complete darkness.
Flat frames should also be taken at the camera’s lowest ISO setting and the same aperture as the
light frames. Flat illumination is a function of shutter speed, brightness of the light source and
As a general guide, flat illumination should be approximately 50 – 70% (right side) of camera
live view histogram. 50% for dark skies and 70% for suburban skies, when using Asterism.
Note: Asterism will compensate for under and over exposed flats, as well as variations in
light frame exposure.
Darks should be taken with the sensor in complete darkness, at the same ISO, exposure time
and temperature as light frames. Regulated cooling provides an advantage and darks may be
omitted at and below 0C. There are various strategies to match dark and light frame
temperature during acquisition, where cooling is not available.
As previously mentioned, it is preferable to create a super-bias or Defect map and Master flat.
Use the noise radius and amount settings for flat creation.
The latest version of Asterism has a Develop function and produces a full resolution background
extracted auto white balanced image, as well as the linear unprocessed image.
Develop also presents a 25% preview of the final image, which may be processed and saved
using ImageMagick’s display menu. Note: The full resolution images are not changed. The
reliability of Develop depends on the quality of input images and calibration method – it’s a
The new interface
Except the ‘Process and options’ tab, all other tabs are unchanged. The new layout is easy to use.
Select individual processes with options and press ‘Process’ (bottom toolbar). Other stand-alone
functions may also be accessed from the bottom toolbar.
The old version manual has been retained separately. Many of Asterism’s functions have not
changed. However, 3 channel RGB processing has been removed from Asterism onwards
– use the deprecated version available on the homepage, if required.
Files’ manager - ‘Convert’ image format - ‘Inspect’ blink utility - ‘PMStack‘, Hugin and
Histogram are selected from the bottom toolbar.
Note: if starting with ‘Light frames’, Master frames should be selected. If not, a warning
appears with the option to ‘Return’ to the Asterism interface or to ‘Continue’ processing
without image calibration. Please refer to the bottom toolbar section for a description of
the button functions
Tabs and options
Asterism tabs
Process and options’ - the main tab from which all image processing originates.
Select camera matrix’ - apply ‘sRGB’ channel multipliers – unmodified cameras.
Add camera matrix’ - add up to 5 unique channel multiplier matrices.
Edit camera list’ - remove or modify channel multipliers.
'Project details' - record the details of the project.
'System settings' - remaining hard-drive space, memory and processing threads.
'Documentation' – links to documentation resources and version information.
Process and options tab
*’ is a reminder that an entry is required in the field – mandatory...
Project folder*’ - select or create a project folder the project name is assigned
Input format’ - RAW, OTHER (e.g., jpeg png tiff - deBayered images), OTHER
BAYER (images that are not RAW and have not been deBayered – e.g., fits tiff).
Output format’ – enter an output extension – default tif (16bit no compression)
Colour depth’ - default 16 – range 8 – 64 in 8 bit steps
Process options
Note: The indented options are selected with the main option; for example, to create a
‘Super-bias’, select ‘Bias frames’ and Super-bias’. Similarly, for median combined frames.
Map Defects’ – Create a ‘Defect map’ -Defect map’ is created from Dark frames – as many as
available (1 dark frame is OK). A single dark frame ‘Defect map’ is superior to a single dark. Use
Defect map in place of a Master dark.
Bias frames- Create a mean combined Master bias
- ‘Super-bias’ Create a (master) ‘Super-bias’ - significant random noise reduction in
the Master bias frame, results in cleaner calibration of flat and light frames.
- ‘Median’ - Create a median filtered Master bias - ‘Super-bias’ is preferred.
Dark frames’ - Create a mean combined Master dark.
- Median’ - Create a median filtered Master dark, useful for minimising noise in noisy
image sets and / or small calibration frame image sets - ‘Defect map’ is preferred.
Flat frames’ - Create a mean combined Master flat. Setting a ‘Noise - radius’ = 7 and ‘Noise -
amount’ = 0.1, creates a Master flat with similar standard deviation to a median combined
Master flat – the process is much quicker than ‘Median’.
- Median’ - Create a median filtered Master flat, useful for minimising noise in noisy
image sets and / or small calibration frame image sets – see above alternative application
of ‘Noise reduction parameters’.
Flat correction - Automatic flat correction default ‘5’ for automatic flat correction of
all light frames, regardless of variations in flat or light exposure. This process rescues
poor flats and mixed light image sets with differing exposures. The luminance of each
light image is calculated and the flat frame adjusted to ensure reliable flat reduction. Set
‘0’ to turn off on a session-by-session basis.
Note: If a Master bias is not available to the Flat frames a file selection window will pop-up select a
Master bias – Super-bias preferred.
Note: Flats are assumed to be taken at each imaging session.