
Bachelor Thesis: Skypixie
A configurable desktop application for calibrating, registering, stacking, and processing astronomical image sequences.
Technologies
Technical summary
Thesis context
My ZHAW School of Engineering Bachelor thesis was titled Konfigurierbare Bildverarbeitungspipeline für astronomische Aufnahmen. It was a Computer Science thesis co-authored with Nicole Schmid and supervised by Prof. Dr. Markus Thaler.
The result was Skypixie, a desktop application for processing astronomical image sequences. The name combines “sky” with “pixie”; in the thesis we also used it as a compact reference to picture/image enhancement.
The project grew out of a practical problem in amateur astrophotography. A usable deep-sky image is rarely produced from one exposure. It usually requires calibration frames, alignment of multiple light frames, averaging or stacking, removal of light-pollution gradients, contrast stretching, sharpening, denoising, and final color adjustment. Existing workflows often split these steps across several tools such as DeepSkyStacker, Photoshop plugins, PixInsight, or manual image editors. That makes the process slow, expensive, and difficult for beginners.
Skypixie was built to reduce that friction: one application, a mostly automated default path, and an expert mode when the image characteristics require manual choices.

Scope and workflow
The application separates the workflow into four stages:
- Preprocessing: load light, dark, and flat frames; create master calibration frames; correct sensor noise and uneven illumination.
- Image registration: detect stars, match corresponding points across exposures, transform each image into the reference frame, and average the aligned images into a master light.
- Main processing: apply white balance, histogram correction, gradient removal, sharpening, and denoising.
- Post-processing: expose manual RGB and HSV adjustments so the user can tune the final visual result.
This split was intentional. Several parameters are easier to choose after a first corrected preview is available, and not every decision should be fully automated. In the thesis we treated color aesthetics as subjective, so post-processing remained interactive rather than assuming that one fixed result is always correct.
Application architecture
Skypixie was structured as a modular desktop application rather than a single processing script. The interface, file handling, shared image state, and processing pipeline were separated so each stage could evolve independently.
This made the processing code easier to test and compare step by step. It also allowed the same application to offer a simple mode with few inputs and an expert mode with algorithm and parameter choices.
Preprocessing and calibration
Astronomical images are affected by sensor noise, hot pixels, vignetting, and uneven illumination. Skypixie therefore supports optional calibration with dark frames and flat frames.
Dark frames are captured with the optics closed and model the sensor behavior without astronomical signal. Skypixie can combine them into a master dark either by averaging all dark frames or by taking the median per pixel. Averaging is faster and is used as the default; the median option remains available in expert mode.
Flat frames are combined into a master flat by averaging. They are used to compensate for uneven illumination and vignetting.
Each light frame is then corrected with the master calibration frames.
This first stage reduces static sensor artifacts and corrects the illumination profile before any alignment or enhancement is attempted.
Star detection
Image registration depends on reliable control points. In astronomical images, stars are the natural choice. Skypixie therefore detects stars and uses their centers as points for matching.
The detector combines grayscale conversion, smoothing, background estimation, local contrast enhancement, and foreground segmentation. The goal was not just to find bright pixels, but to produce reliable star centers in noisy images with uneven backgrounds.
Some real images contained reflections or extended bright regions such as the Milky Way. Those regions could dominate the mask and leave too few usable stars for matching. Skypixie therefore included a stricter fallback path for difficult frames, making detection more reliable without asking the user to tune thresholds in common cases.
Centroid estimation
After segmentation, Skypixie computes star centers at subpixel precision. The thesis compared geometric and intensity-based center estimates, then selected an intensity-weighted method as the best accuracy/runtime compromise for the application.
Feature matching and image registration
The registration problem is harder than simply finding stars. Different exposures can be translated, rotated, slightly scaled, cropped differently, or affected by tracking error.
Skypixie used a fast matcher for common cases and a more robust triangle-based fallback for difficult images. Once enough star correspondences were available, the application estimated the image transformation, warped the frames into a shared coordinate system, cropped invalid borders, and averaged the aligned frames into a master light.
Synthetic validation showed that the approach could recover controlled transformations with subpixel accuracy in the tested cases.
Main processing
The master light then goes through the main enhancement pipeline.
White balance is applied before contrast enhancement so incorrect color intensities are not amplified by later steps.
Histogram correction was evaluated with several methods:
- logarithmic transfer function,
- gamma-logarithmic transfer function,
- contrast-limited adaptive histogram equalization (CLAHE),
- contrast stretching,
- histogram specification with Gaussian and exponential target distributions.
CLAHE became the default because it brought out nebulae and stars without overexposing bright cores as aggressively as other methods. The gamma-logarithmic function also performed well, but it tended to brighten galaxy centers more strongly and lose some structure.
Gradient removal addresses light pollution, moonlight, and uneven sky background. Skypixie masks stars and astronomical objects, models the remaining background, and subtracts the estimated gradient. Expert mode keeps the model configurable because some images contain simple linear gradients while others need a more flexible correction.
The thesis measured this step against synthetic gradients where the original image was known. The results confirmed that simple models work well for mostly linear gradients, while more flexible models improve difficult radial or uneven backgrounds.
Sharpening defaults to unsharp masking. The thesis also implemented local adaptive sharpening and optimized the slower parts of that operation. The adaptive method produced a stronger, more artistic look and was therefore kept as an expert option rather than the default.
Noise reduction was evaluated with modified median filtering, ordinary median filtering, and wavelet denoising. The median approaches removed noise but also risked removing stars or weakening nebula contours. Wavelet denoising, using the BayesShrink method exposed by scikit-image, preserved astronomical structure better and was selected for the pipeline.
User interface
Skypixie was built as a PyQt desktop application. The interface was designed for a short default path:
- choose the light-frame folder,
- optionally choose dark and flat folders,
- run preprocessing,
- inspect the preview,
- start the main processing pipeline,
- adjust color in post-processing,
- save the result.
The preview updates after processing steps so the user can see what is happening. The UI also includes a histogram and a before/after switch between the result and an input frame. The expert mode exposes algorithm choices and parameters, such as the gradient order or histogram correction method.
User feedback during the thesis led to concrete UI changes: clearer labels for pipeline steps, help for selecting image folders, a reset option for folder paths, and a status text under the progress bar showing the current pipeline step. Performance feedback also led to replacing a slower RGB-to-HSV conversion with OpenCV’s implementation.
Validation and comparisons
The thesis validated Skypixie on synthetic and real astronomical images. Synthetic images were used to verify detection, matching, transformation, and controlled distortions. Real images were used to evaluate robustness and visual quality.
For registration, Skypixie was compared with DeepSkyStacker and PixInsight. Dedicated tools were faster in the tested workflow, but Skypixie required less manual setup and still produced visually correct star alignment on the test set.
For gradient removal, Skypixie was compared with GradientXTerminator. In the documented example, Skypixie removed the gradient more completely because it fitted a function to the global background values instead of processing a segmented grid. That avoided treating object regions as part of the gradient.
For final visual output, Skypixie was compared with manual processing. The thesis concluded that Skypixie came close to manually processed results while saving substantial time. Differences remained in color and brightness choices, which is why post-processing controls stayed available.
Runtime profiling showed that registration was the main performance bottleneck. Future improvements proposed in the thesis included parallelizing registration, using GPU acceleration for vectorized operations, moving selected code paths to native implementations, reducing memory pressure by processing frames incrementally, and eventually supporting live stacking.
Memory usage was another practical constraint. Larger image sequences quickly become expensive if every full-resolution intermediate is kept in memory, so future versions would need incremental processing, caching, or a streaming design.
Limits and lessons
The pipeline works best when the input sequence contains enough common stars, sufficient overlap, and calibration frames where needed. Missing flats, dust, reflections, strong non-linear gradients, or extreme transformations can still produce suboptimal results. The application handles several of those cases with expert settings and fallback algorithms, but the thesis is explicit that no universal configuration produces the best result for every astronomical image.
That is the main lesson of the project: automation is useful only when it respects the data. Skypixie automated the repetitive engineering work while still keeping the processing path configurable and inspectable.
Result
The Andromeda example captures the intended output. The raw image contains the galaxy but has low contrast and an uneven background. After the pipeline, the background is darker, dust lanes and galaxy structure are easier to inspect, and the star field remains visible.
