Convert FITS to QOI
Max file size 100mb.
FITS vs QOI Format Comparison
| Aspect | FITS (Source Format) | QOI (Target Format) |
|---|---|---|
| Format Overview |
FITS
Flexible Image Transport System
Scientific image format developed by NASA and the International Astronomical Union FITS Working Group (IAUFWG), first defined in 1981. Supports 8/16/32/64-bit integer and 32/64-bit floating-point pixel data with multi-extension architecture for storing multiple images and tables per file. Includes WCS (World Coordinate System) metadata for celestial coordinate mapping. The standard data format for astronomical observatories worldwide. Lossless Standard |
QOI
Quite OK Image Format
Minimalist lossless image format created by Dominic Szablewski in 2021. Achieves PNG-comparable compression with 20-50x faster encoding and 3-4x faster decoding. Uses a simple 300-line reference implementation with only 4 operations: index, diff, luma, run. Modern Format Lossless |
| Technical Specifications |
Data Types: 8/16/32/64-bit integer, 32/64-bit float
Structure: Multi-extension (images, tables, headers) Metadata: WCS celestial coordinates, extensive headers Byte Order: Big-endian (FITS standard) Extensions: .fits, .fit, .fts |
Color Depth: 24-bit RGB or 32-bit RGBA
Compression: Lossless (index, diff, luma, run) Speed: 20-50x faster encode than PNG Header: 14-byte fixed header Extensions: .qoi |
| Image Features |
|
|
| Processing & Tools |
FITS data handling with astropy and Python: from astropy.io import fits
import numpy as np
# Open FITS file with full header access
hdul = fits.open('observation.fits')
header = hdul[0].header # WCS, telescope info
data = hdul[0].data # Pixel array
# Access multi-extension data
for ext in hdul:
print(ext.name, ext.data.shape if ext.data is not None else 'No data')
|
QOI lossless image from FITS data:
from astropy.io import fits
from PIL import Image
import numpy as np
hdul = fits.open('globular.fits')
data = np.clip(hdul[0].data, 0, 255).astype('uint8')
img = Image.fromarray(data)
img.save('globular.qoi')
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 1981 (NASA/IAU FITS Working Group)
Current: FITS Standard 4.0 (2018) Status: Active, universal astronomical standard Evolution: FITS 1.0 (1981) → 2.0 (1988) → 3.0 (2008) → 4.0 (2018) |
Introduced: 2021 (Dominic Szablewski)
Specification: QOI 1.0 (stable) Status: Active, growing adoption Evolution: QOI 1.0 (2021) → stable specification |
| Software Support |
Astronomy: ds9, IRAF, PixInsight, Aladin, TOPCAT
Libraries: astropy (Python), cfitsio (C), FITSIO (IDL) Space Agencies: NASA HEASARC, ESA archives, MAST Other: ImageMagick, GIMP (via plugin), Pillow (limited) |
Libraries: Pillow 12+, qoi (Python), libqoi (C)
Viewers: IrfanView, XnView, qoiview Editors: GIMP (via plugin), limited editor support Other: 100+ implementations in various languages |
Why Convert FITS to QOI?
Converting FITS to QOI creates lossless astronomical images with the fastest possible encoding speed. QOI encodes 20-50x faster than PNG with comparable compression, making it ideal for real-time telescope preview displays and high-throughput survey data pipelines.
Modern sky surveys process thousands of FITS frames per night, generating quick-look preview images for quality monitoring. QOI's ultra-fast encoding means preview images are ready almost instantly, without the encoding bottleneck that PNG creates in high-throughput workflows.
Telescope control systems displaying real-time CCD readouts benefit from QOI's minimal encoding latency. The format's streaming encode/decode design means pixels can be processed as they arrive from the detector, enabling the lowest-latency lossless preview possible.
The conversion maps FITS data to 8-bit RGB and applies QOI's four-operation compression (index, diff, luma, run). The resulting files are slightly larger than optimized PNG but encode in a fraction of the time, which is the key advantage for latency-sensitive applications.
Key Benefits of Converting FITS to QOI:
- Ultra-Fast Encoding: 20-50x faster than PNG, enabling real-time astronomical image preview
- Lossless Guarantee: Every pixel preserved exactly for scientific data integrity
- Fast Decoding: 3-4x faster than PNG decode for responsive telescope control displays
- Streaming Design: Encode/decode pixels as they arrive from the CCD detector
- Minimal CPU: Simple algorithm suitable for embedded observatory computing systems
- Pipeline Speed: High-throughput survey pipelines benefit from near-zero encoding latency
- Simple Implementation: 300-line reference codec means easy integration into custom astronomy software
Practical Examples
Example 1: Real-Time Telescope Preview
Scenario: A telescope control system generates real-time preview images of incoming CCD frames and needs the fastest possible lossless encoding for display.
Input FITS file (live_preview.fits):
FITS astronomical data: Resolution: 2048×2048 CCD preview Data: Real-time CCD readout Instrument: Observatory CCD imager Content: Live observing field
Output QOI file (live_preview.qoi):
Converted QOI output: 20-50x faster than PNG encode Lossless quality guaranteed Minimal CPU overhead Sub-millisecond encoding
Example 2: High-Throughput Survey Pipeline
Scenario: A sky survey pipeline processing thousands of frames per night needs a fast lossless format for quick-look thumbnails without slowing the data flow.
Input FITS file (survey_frame.fits):
FITS astronomical data: Resolution: 1024×1024 thumbnail Data: Automated survey data Instrument: Wide-field survey camera Content: Survey field quick-look
Output QOI file (survey_frame.qoi):
Converted QOI output: Ultra-fast encode/decode Streaming capable Pipeline-friendly speed Lossless quality preserved
Example 3: Observatory Monitoring Dashboard
Scenario: An observatory monitoring system captures periodic snapshots of all-sky camera and telescope feeds, needing fast lossless storage for later review.
Input FITS file (monitoring_snap.fits):
FITS astronomical data: Resolution: 1280×960 monitoring frame Data: All-sky camera capture Instrument: SBIG all-sky camera Content: Night sky conditions
Output QOI file (monitoring_snap.qoi):
Converted QOI output: Rapid capture storage 3-4x faster decode than PNG Simple implementation Reliable lossless storage
Frequently Asked Questions (FAQ)
Q: What is FITS format?
A: FITS (Flexible Image Transport System) is the standard data format for astronomical observations, developed by NASA and the IAU since 1981. It stores scientific data with floating-point precision and World Coordinate System metadata.
Q: What is QOI format?
A: QOI (Quite OK Image) is a minimalist lossless format created by Dominic Szablewski in 2021. It achieves PNG-comparable compression at 20-50x faster encoding and 3-4x faster decoding using only four simple operations: index, diff, luma, and run.
Q: Why convert FITS to QOI?
A: QOI's ultra-fast encoding makes it ideal for real-time astronomical applications: telescope preview displays, high-throughput survey pipelines, and monitoring systems where encoding speed is critical and lossless quality is required.
Q: How does QOI compare to PNG for astronomical images?
A: QOI encodes 20-50x faster and decodes 3-4x faster than PNG, with files typically 10-20% larger. For astronomical images with many unique pixel values (noise, star fields), QOI may produce slightly larger files than optimized PNG.
Q: Is QOI suitable for archival storage?
A: QOI is lossless and suitable for data preservation. However, its 2021 introduction means long-term software support is less certain than PNG (1996). For archival purposes, PNG or TIFF may be safer choices with their longer track records.
Q: Does QOI support 16-bit or floating-point data?
A: No, QOI is limited to 8-bit per channel (24-bit RGB or 32-bit RGBA). FITS data must be scaled to 8-bit range during conversion. For higher bit-depth preservation, use PNG (16-bit) or TIFF (32-bit float).
Q: What software supports QOI?
A: Pillow 12+ has native QOI read/write support. Over 100 implementations exist in various programming languages. IrfanView and XnView support QOI viewing. Web browser support is currently not available.
Q: When should I choose QOI over PNG?
A: Choose QOI when encoding/decoding speed is more important than file size (real-time display, high-throughput pipelines). Choose PNG when file size matters or when broad software compatibility is essential.