Open a FITS astronomy image or table, stretch it, and save it as PNG
Drop a .fits, .fit, .fts or .fz file from an astro camera, a capture program or a telescope archive. See every header card, the image stretched so faint detail shows, in colour when it is a one-shot-colour raw frame, the value of any pixel, and tables as rows you can save as CSV.
The file is read by this tab on your device. Nothing is uploaded, so a night's frames stay yours.
What it shows
- Every HDU in the file. A FITS file is a chain of header-and-data units: the primary one, then any number of extensions. Each is listed with its type (image, compressed image, ASCII table, binary table), its EXTNAME, its size such as
6248 × 4176, 16-bit integeror1,024 rows × 12 columns. A Hubble file with SCI, ERR and DQ extensions shows all three. - The header, searchable. Every card as keyword, value and comment, with long strings joined across CONTINUE cards and HIERARCH keywords read whole. Type
temporgainin the search box to find the card. Above the table, the facts people look for first when they are present: OBJECT, DATE-OBS, EXPTIME, IMAGETYP, FILTER, INSTRUME, TELESCOP, GAIN, OFFSET, CCD-TEMP, binning, BAYERPAT, RA and Dec. - The image, stretched. A raw frame drawn with a linear scale looks black, because a few stars use the top of the range and the sky sits near the bottom. So it opens with an asinh stretch between the 0.5 % and 99.5 % points of the pixel values. Switch to log or linear, to the full min–max range, or type the black and white points yourself. The histogram (log counts, 256 bins) shows where the values sit.
- Colour from one-shot-colour cameras. When the header has
BAYERPAT(orCOLORTYP) set to RGGB, BGGR, GRBG or GBRG, the raw mosaic is debayered with bilinear interpolation, honouringXBAYROFF/YBAYROFF, and each colour is stretched on its own so an unbalanced raw frame is not all green. You can also pick the pattern by hand when the header says nothing. - Cubes, plane by plane. A 3-D image (NAXIS3 > 1) gets a plane picker; a cube of exactly three planes, as Siril and PixInsight save colour images, opens as red, green and blue.
- The value of any pixel. Point at the image, or tap it on a phone, to read x and y (counted from 1, as in DS9 and Siril) and the physical value with BZERO and BSCALE applied: an unsigned 16-bit camera frame stored as BITPIX 16 with BZERO 32768 reads 0 to 65,535, not −32,768 to 32,767.
- Tables. TABLE (ASCII) and BINTABLE extensions as a paged table, 100 rows at a time, with each column's unit. Scaled columns (TSCALn, TZEROn), unsigned integers, null values (TNULLn), bit and logical columns, vectors and variable-length arrays from the heap are all read.
Saving
- Save as PNG writes the view you are looking at: the stretch, limits, colour and plane you chose, at full resolution, 8 bits per channel, blank (NaN) pixels transparent. It is a picture for sharing or a quick look, not data: the original values do not survive an 8-bit stretch, so keep the FITS file for processing.
- Save as CSV writes a whole table, not only the rows on screen, with a header row of column names. Numbers are written in the shortest form that reads back to the same value (a 32-bit float column gives
0.03, not0.029999999329447746). A vector column of up to 64 values is spread overNAME_1,NAME_2…; longer vectors and variable-length arrays go in one field, values separated by spaces.
The formats, and what this reads in each
- Images (primary HDU and IMAGE extensions)
- BITPIX 8 (unsigned bytes), 16, 32 and 64 (signed integers) and −32, −64 (IEEE floats), big-endian as the standard requires, with BZERO, BSCALE and BLANK. One-dimensional data (a spectrum) is drawn as a strip and saved as a CSV of index and value.
- Tile-compressed images (.fz)
- What
fpack, astropy and many archives write: the image cut into tiles (usually one row each), each compressed and stored in a binary table. RICE_1 (the default, typically 2 to 3 times smaller for 16-bit camera frames) is decoded by viewhack's own Rice decoder; GZIP_1 and GZIP_2 with the bundled fflate library. Floating-point images quantised with ZSCALE and ZZERO, including SUBTRACTIVE_DITHER_1 and _2, are restored as the convention describes. HCOMPRESS_1 and PLIO_1 are recognised and named; this page cannot draw them yet. - Gzipped files (.fits.gz)
- A whole FITS file compressed with gzip, the way SDSS, Pan-STARRS and many survey archives serve them, is unpacked in the tab first.
- Random groups
- The old radio-interferometry layout (GROUPS = T) is recognised and its header shown; the groups are not unpacked.
Which way is up
The FITS standard counts rows from the bottom, so this page draws row 1 at the bottom, as SAOImage DS9 does. Many capture programs write rows top-first instead and say so with ROWORDER = 'TOP-DOWN'; such frames are drawn top-first. Untick the box under the controls to flip any image. The Bayer pattern is applied to the pixels in the order they are stored, which is what NINA, SharpCap and ASIAIR mean by it; if a frame comes out with red and blue swapped, choose the pattern one row down (RGGB and GBRG, or BGGR and GRBG).
What this cannot do
- Show sky coordinates. The WCS keywords (CRVAL, CRPIX, CD, CTYPE) are shown in the header, but there is no RA/Dec under the cursor, no grid and no plate solving.
- Stack, calibrate or process. No darks, flats or bias subtraction, no registration, stacking, colour calibration or noise reduction. For that, Siril is free and runs on Windows, macOS and Linux.
- Edit or write FITS. It reads and exports PNG and CSV; it does not change headers or save a FITS file back.
- Draw HCOMPRESS_1 or PLIO_1 tiles. Run
funpack file.fits.fzto get a plain FITS file this page opens. - Very large files on a phone. The whole file is read into the tab's memory. A 26-megapixel 16-bit frame (50 MB) opens on a laptop in a second or two; a phone may run out of memory on files of a few hundred MB. Images over 16 million pixels are shown and saved binned 2 × 2 (or more), the most a phone browser's canvas can hold; the pixel readout still gives exact values.
A .fit from a sports watch?
Garmin, Wahoo, COROS and other watches and bike computers also save files named .fit, in an unrelated format called Flexible and Interoperable Data Transfer. viewhack tells them apart by their first bytes: a watch file opens in the GPS track viewer, an astronomy file here.