Nebulift is an adaptive stretching program for deep-sky astrophotography. It uses max-tree source detection (MTObjects) to classify sources as compact (stars) or diffuse (nebulae, galaxies) and applies an independent stretch function to each class, revealing faint structure without saturating stars, and without explicit layer separation.
| Global asinh stretch | Nebulift adaptive stretch |
|---|---|
![]() |
![]() |
For the same region of the Horsehead nebula: a global stretch saturates the star, Nebulift preserves it while revealing the nebula.
Developed as part of a Bachelor's project in Computing Science at the University of Groningen, supervised by Dr M.H.F. Wilkinson and Dr C. Kehl.
Main window of Nebulift
The processing pipeline of Nebulift consists of the following steps:
- Data Loading: load a linear, stacked FITS image.
- Max-Tree Source Detection: MTObjects builds the max-tree and detects significant sources.
- Parameter Extraction: morphological attributes (R_fwhm, A/B, surface brightness, ...) are computed per detected object.
- Classification: sources are classified as compact, diffuse, or noise via thresholds, Gaussian Mixture Models, or Learning Vector Quantization.
- Adaptive Stretching: a class-specific stretch (asinh or linear) is applied directly on the max-tree nodes and the image is reconstructed.
- Python 3.11+ (Was developed on 3.14 and tested on 3.11)
- A C compiler for compiling the MTObjects library (GCC, Clang, etc.)
- Tested on Linux (x86-64 and Raspberry Pi 4/5, aarch64). Windows is untested, but will likely need some modifications.
To install Nebulift, follow these steps:
- Clone the repository:
git clone https://github.com/TheAefka/nebulift.git- Install the required dependencies:
python3 -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
pip install -r requirements.txt- Compile the MTObjects library:
cd src && ./recompile.sh && cd .. # Unknown if this works on Windows, might need to modify the script and/or MTOlib.To run Nebulift, use the following command:
python nebulift.pyor
cd src && python main.pyThis will launch the GUI where you can open a FITS file, pick a classifier, and adjust the per-class stretch parameters. Refer to the thesis for more details.
The test images of M81/M82, Leo Triplet, M45, and the Horsehead nebula are (c) M. H. F. Wilkinson and released under CC BY 4.0, included with permission
The Nebulift source code (excluding the mtolib directory and the data) is
licensed under the MIT License. See the LICENSE file for details.
Please do note that the MTObjects library (src/mtolib) does not have a license,
so use it at your own risk.


