Premium apps Part of Lumina

FITS Header & Image Inspector

Read a FITS header, check BITPIX, scaling and Bayer keywords, and preview the image.

Try an example: Synthetic 16-bit light frame · Synthetic raw RGGB frame

More about this tool

How it works

Open an astronomical FITS file (also .fits.gz) to list every header card, see the data type, BZERO/BSCALE scaling, row order and Bayer pattern, measure per-plane statistics and download a stretched preview PNG. Reads the primary image or the first image extension; tile-compressed files are explained, not guessed. Lumina Astro Lab uses the same reader on your device.

  • The header is parsed card by card (80 characters, keyword = value / comment) until END, following FITS Standard 4.0: strings with doubled quotes, logical T/F, integers and reals including D exponents. COMMENT and HISTORY cards are listed as text.
  • Data are read big-endian for BITPIX 8, 16, 32, 64, −32 and −64 and converted to physical values with BZERO + BSCALE × stored value; BLANK integers become empty pixels. Two-dimensional images and cubes with three planes are supported. An empty primary array leads to the first IMAGE extension; tile-compressed (ZIMAGE) data and tables are rejected with an explanation.
  • FITS stores the bottom row first; the preview is flipped to the usual orientation unless ROWORDER = TOP-DOWN. Statistics: min, max and mean over every pixel; median and MAD-based σ from up to one million evenly spaced samples. The preview is box-averaged to at most 1024 pixels per side and stretched for display only.

Sources

Part of Lumina

  • Lumina Photo editor & image toolkit

    Bring out what you saw. A free photo studio, right in your browser.

    Open Lumina

Related tools

How to use the FITS Header & Image Inspector

Read every FITS header card, check BITPIX, BZERO/BSCALE, row order and Bayer keywords, and preview the image before you calibrate or stack.

What it is for

FITS is the file format of astronomy. Cameras controlled by N.I.N.A., SharpCap, KStars/Ekos or ASIAIR write it, and so do observatories. Unlike a PNG, a FITS file carries its own description in plain-text header cards: the data type, the scaling of the stored numbers, the exposure time, the frame type and, for colour cameras, the Bayer pattern. When a stacker rejects a file, shows a black image or gets the colours wrong, the answer is almost always in that header.

Upload a .fits, .fit, .fts or gzip-compressed .fits.gz file up to 16 MB. The inspector lists every card, reports width, height, number of planes, BITPIX, BZERO and BSCALE, measures statistics per plane and returns a stretched preview PNG. It reads the primary image, or the first image extension when the primary array is empty. Tile-compressed files (.fz) and tables are explained, not guessed: decompress .fz files with funpack first.

Worked example

The first example is a synthetic 16-bit light frame generated by Lumina's astro engine (it is not a real observation). The tool reported:

  • 128 × 96 pixel FITS image, BITPIX 16, 13 header cards
  • BZERO 32768, BSCALE 1 — the usual way to store unsigned 0–65535 camera values in signed 16-bit integers
  • Statistics: minimum 774, maximum 8897, mean 968.69, median 906, robust σ 35.58

The median of 906 is the sky background, and σ ≈ 36 is its noise. The maximum of 8897 belongs to the brightest star. The mean sits above the median because stars pull it up — that is why astronomers prefer the median for background levels.

The second example is a 64 × 48 raw colour frame. Besides the statistics (median 1286), the tool warns that the header declares the Bayer pattern RGGB and that the preview shows the raw mosaic. That checkerboard look is expected: the colours only appear after debayering, which Lumina Astro Lab and the star detector do for you.

How to read the result

  • Metrics show the geometry and the scaling. Every statistic uses physical values, BZERO + BSCALE × stored value.
  • Statistics per plane give minimum, maximum, mean, median, a robust σ from the median absolute deviation, and the number of empty pixels (NaN or BLANK). Colour cubes get one row per R, G and B plane.
  • Header cards list keyword, value and comment in file order, including COMMENT and HISTORY lines. Download the JSON to compare headers between frames.
  • The preview PNG is box-averaged to at most 1024 pixels and stretched for display only. It never changes your data.

Tips and common mistakes

  • Compare EXPTIME and the sensor temperature of your darks with your lights. Darks that do not match leave hot pixels and amp glow behind.
  • A median far below the maximum is normal for raw astro data. The image only looks black because it is linear.
  • rowOrder tells you whether the file is stored bottom-up (the FITS default) or TOP-DOWN. The preview always shows the image the right way up.
  • If bayerPattern is empty for a colour camera, the capture software did not write BAYERPAT; choose the pattern by hand when stacking.
  • Statistics are physical values, so a BSCALE other than 1 changes them compared with the stored integers.

FAQ

Why does my FITS file look black in normal viewers?

The data are linear: the sky sits at a few percent of the full range. The inspector's preview applies an automatic midtones stretch so you can see stars and nebulae.

Can it open .fz or compressed tables?

No. Tile-compressed images are rejected with a message. Run funpack first; gzip-compressed .fits.gz files are decompressed automatically.

Does it support data cubes?

Two-dimensional images and cubes with exactly three planes (R, G, B) are supported. Spectral cubes with more planes are not.

Is my file stored?

The file is processed on the server for this request and the preview link expires after about two hours. Lumina Astro Lab reads FITS files entirely on your device.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://luminafitsinspector.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://luminafitsinspector.usefulweb.site/mcp · tool name lumina_fits_inspector
Example request
curl -s -X POST https://luminafitsinspector.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{…see OpenAPI examples…}'
Feedback · ideas & bug reports welcome