Python with image in fits format
I personally use Astropy, specifically astropy.io.fits, although I'm not a seasoned user of FITS files and I don't really know their layout.  As an example snippet of code, I often load data from FITS files using

from astropy.io import fits
data = fits.open('data_file.fits')[0].data


You'll find more information in the documentation on the FITS module.