Home » Tutorial » How to Use FITS Images…and What are They?
Tutorial

How to Use FITS Images…and What are They?

Let’s demystify an image format that gives you fits.
Yes, that’s a bad pun; no, I don’t care.

The FITS file format is the most commonly used file format for astronomical data (astro photos!). It’s also not natively readable by the most common photo editing software suites, which seems like a problem to the beginner, and a bit annoying for advanced astrophotographers. So, let’s talk about FITS, baby. Why do we use it, and how can you convert it to something your normal image processing application can understand? I’m in a funny mood while writing this, I hope it makes a dry topic a little more entertaining.

Defining FITS

The current standard as of this article was defined and finalized in 2008, FITS version 3.0, and it’s used for all kinds of scientific data. FITS is not just an image format! Although, images are what is stored most often in these types of files, you can perceivably store anything you want in a FITS file. Data is data.

What does FITS stand for? (…other than truth and justice for all)

FFlexible: FITS is stretchy, it does whatever you want it to do.

 

IImage: It’s for images…but not just for images.

 

TTransport: It’s a container for whatever you want, like image data.

 

SSystem: I think they added a fourth letter to make it a naughty word. Or, it’s not just a file. You pick.

 

OK, cool. But what is it…

Think of FITS as a document, a very accurate written description of an image or other data. One of the really cool things about FITS files is also the fact that there is an ASCII (human-readable) file header (the first few bytes of the file) that can contain pretty much whatever you want.

Want to tell us what camera, temperature, wind speed, GPS coordinates, astronomical coordinates, height, weight, eye color, and middle name of the photographer, or virtually any other fact about the data contained there is to know? Done. FITS can handle that.

The actual image pixel data itself is stored in a 1D, 2D, or 3D multi-dimensional array, and it isn’t compressed. The files are big, but the data is very accurate.

Why do we use FITS instead of camera raw?

Guess what: camera raw files (CR2, NEF, etc.) are compressed! Booooo. But that’s not the only reason FITS files are cooler.

Versioning: it’s backward compatible

One of the reasons it was created in the first place was for archival purposes. The standard used for FITS is important, because each newer version has a mandate to support all older versions. That’s cool.

If I had a dollar for every time I was annoyed about a new “better” version of a file format required by a software update that broke backward compatibility, there wouldn’t be ads on this website and I’d own a small island with no outdoor lights allowed after 8pm within a 500km radius and you’d all want to live there.

Quality matters

In my opinion, it’s also pretty cool to use an image format that supports ANYTHING you throw at it. For example, while Photoshop will support 8-bit and 16-bit TIFF images (and maybe 32-bit now?), I’ve used astronomical image processing applications that will support FITS data up to 64-bits per pixel (BPP), and maybe even higher!

FITS can handle it because there is no real theoretical limit. It just stores a bigger chunk of data for each pixel as you increase the BPP. And if we’ve learned anything so far about why we shoot raw (ALWAYS!), we know that a higher BPP is good stuff for those faint cosmic details. Yes, the file sizes dramatically increase, but so what, space is cheap (…another bad pun).

Low constrast detail
8-bit
< 
16-bit
<
32-bit
<
64-bit
<
128-bit
< 
N-bit
High contrast detail

Some may argue that it’s silly to use any BPP higher than what the camera shoots, and while that is true for the original raw image data, it loses face as soon as we start to manipulate it with post-processing software. While there surely is a BPP limit that our weak human eyes can discern, when teasing out the faintest details with some local contrast, the more the merrier. So, bring it on and use the highest quality image format your CPU can handle without releasing the magic smoke that makes it go.

How to use FITS image files

The problem: your favorite image processing application doesn’t natively support the super-cool FITS images you’ve downloaded from [our website, your friend, Hubble, NASA, aliens].

The solution: The ESO/ESA/NASA FITS Liberator software package!

fits_liberator_colourBecause they are super nice, the folks at Hubble distribute, for free, a nice little app to help you view and convert FITS images into more “normal” readable formats, like TIFF. It works on Windows and Mac OSX, but takes a little bit of dinging around to get it installed in the newest OSX versions, it seems.

Screenshot of the ESA/ESO/NASA FITS Liberator version 3
This image shows the third — and best — version of the popular ESA/ESO/NASA FITS Liberator image processing software.

Also, thanks to Twitter follower @AstroFaris for reminding me that there is another option for Mac OSX users: FITS Preview by Cloudmakers.

However, you’re better off, if you can, using FITS images natively in applications like PixInsight, which is now also using a newer open data format called XSIF (that we aren’t going to talk about right now).

How do you know you can trust me?

You don’t!

So, if you want, read more information about FITS and its history and usage on Wikipedia and the official NASA site.

Like this article enough to buy the author a drink? (a small donation of $1-$20)

About the author

Cory Schmitz

Co-founder of PhotographingSpace.com, co-owner of several telescopes and mounts, too many cameras, and not enough hard drives, Cory is an American expat living in South Africa with his wife, Tanja Schmitz.

An avid astrophotographer for timelapse, deep-space imaging, lunar, planetary, and star trail imagery, he is an all-around jack-of-most-trades for night-sky photography.

He is also an internationally published and commissioned astrophotographer, where his photos have been used in multiple online and print publications.

11 Comments

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • How do you open fits files that don’t necessarily contain images? For example, I’m trying to read the fits files from Chandra, but they are all rejected by fits liberator (fits files from other telescopes like Hubble work fine). Do you know why fits liberator would say “file not supported” for fits files from Chandra?

  • I would like to hunt for near-earth asteroids and report them to the MPC. As far I can tell most software for that purpose only uses FITS. I’ve seen some downloads available that convert RAW formats to FITS. Would those images converted to FITS be acceptable for programs like ASTROMETRICA, etc.?

  • How to extract the pulsar contour, such as how to extract the pulse contour of pulsar,thank you, master。

  • Cool site well done. A quick question what software can I use to convert my Fuji Raw files into Fit files on my Mac? Many thanks Mick

  • Will the Fits Liberator you reference process multiple files………I something that I can process a hundred or so to be used in a stacking program for editing.

From PhotographingSpace.com:

Astrophotography Photoshop Actions!

Make your Milky Way POP and finish off your photos like a pro with our Photoshop Action Packs optimized specifically for astrophotography!