NINA.Image is the image-processing and file-format library. It turns exposures and files into N.I.N.A.'s internal image model, computes statistics and star analysis, and reads or writes supported image formats. It is the central place for image-file ingestion and persistence, so higher layers should not invent parallel FITS/XISF/TIFF/RAW loading or saving code.
Build shape from NINA.Image.csproj:
- Target framework:
net10.0-windows - Output type:
Library - WPF enabled
- Windows Forms enabled
ImageData/Core image model and factories:BaseImageData,ImageDataFactory,ExposureDataFactory,RenderedImage,ImageStatistics,ImageMetaData,StarDetectionAnalysisImageAnalysis/Processing and analysis algorithms:StarDetection,StarAnnotator,BahtinovAnalysis,ContrastDetection, histogram and image utility helpersFileFormat/File readers/writers forFITSandXISF, plusFileSaveInfoRawConverter/RAW conversion backend (LibRawConverter) andRawConverterFactoryInterfaces/Image abstractions such asIImageData,IRenderedImage,IExposureData,IRawConverter
The data flow is explicit in the code:
- Exposure data is produced or loaded into an
IExposureDataimplementation. ExposureDataFactoryandImageDataFactoryconvert that data intoIImageData.RenderedImageturnsIImageDatainto aBitmapSourceand can re-render, stretch, debayer, annotate, and generate thumbnails.StarDetectionand related analysis classes updateStarDetectionAnalysisand image statistics.BaseImageData.FromFileandSaveToDiskAsyncroute supported on-disk formats through the shared image pipeline instead of having each feature parse files on its own.
ImageData/RenderedImage.csThe main rendered-image wrapper used by higher layers. It bridges raw image data, WPF bitmap output, star detection, star annotation, stretching, and thumbnail generation.ImageData/ExposureData.csContains theBaseExposureDatahierarchy andExposureDataFactory.ImageData/BaseImageData.csHosts the internal image representation andImageDataFactory, and contains the central file load/save path for FITS, XISF, TIFF, RAW, and WIC-backed bitmap formats such as GIF/JPEG/PNG.ImageAnalysis/StarDetection.csThe built-in star detection implementation used throughout imaging, focusing, and sequence workflows.FileFormat/FITS/FITS.csFITS loader/writer built around the native CFITSIO wrapper.FileFormat/XISF/XISF.csXISF loader/writer with checksum, compression, and attachment handling.RawConverter/RawConverterFactory.csCreates the LibRaw converter. Legacy profile settings are retained only for migration compatibility.
The project is responsible for the code that understands supported image formats, but not for shipping every native dependency. The current code path in BaseImageData handles:
- FITS (
.fit,.fits,.fts,.fz) - XISF (
.xisf) - TIFF (
.tif,.tiff) - common WIC-backed bitmap formats such as GIF, JPEG, and PNG
- supported RAW DSLR formats through LibRaw (
.cr2,.cr3,.nef,.raf,.raw,.pef,.dng,.arw,.orf,.rw2)
The executable project ships the runtime files such as:
- CFITSIO native DLLs used by FITS loading
libraw_0_22_1.dll
The boundary is:
- parsing, conversion, and in-memory image handling live here
- runtime deployment of supporting binaries is handled by
NINA - callers should reuse this project's file-format support instead of inventing custom readers/writers elsewhere in the solution
Project references:
NINA.CoreNINA.AstrometryNINA.ProfileAccord.Imaging (NETStandard)
NINA.Image is used by the equipment layer, plate solving, WPF/UI layers, the main app, and tests. That makes it a shared computational library rather than a feature module.
- Keep new image algorithms and format parsers here instead of duplicating them in equipment or UI code.
- If a feature needs to load or save FITS, XISF, TIFF, RAW, or other already-supported image files, route it through
NINA.Imageinstead of inventing feature-local file parsing or persistence code. - Prefer working against
IImageData,IExposureData, andIRenderedImage; those are the stable seams the rest of the application already uses. - If a change requires an extra native binary or helper executable, update the consuming runtime project as well; code changes here alone will not ship the dependency.
- Be careful with changes to image statistics or star detection, because those results are consumed in autofocus, plate solving, image history, and sequencing flows.