Flexibile Image Transport System (FITS) files used for astronomy should be managed with astropy or pyfits.Īs a simple starting example, suppose you have an image that was taken with the camera turned so that "up" is to the side when the image is displayed.
![pyfits getdata pyfits getdata](http://capd.sourceforge.net/capdRedHom/docs/html/RedHom.png)
PYFITS GETDATA FULL
Once an image has been read into a numpy array, the full power of Python is available to process it, and we can turn to Pillow again to save a processed image in png or jpg or another format. Most import for us, Pillow has routines to read and write conventional image formats. Pillow uses the same "namespace" as PIL and older code should work, perhaps with a few modifications to allow for recent developments. with functions that are documented by the developers in a handbook describing the methods and giving some examples. Pillow includes the basics of image processing. Pillow will probably be on any packaged distribution of Python 3, or it may be installed with (note the capital "P") It continues to improve, and the features described here are tested with "Pillow 5.1" and Python 3.6 as of April 2018. With the coming of age of Python 3.x, a fork of the older version has evolved that is more suited for the new technologies and is in a package called "Pillow".
![pyfits getdata pyfits getdata](https://docplayer.net/docs-images/43/11391364/images/page_10.jpg)
The Python Imaging Library (PIL) was developed for Python 2.x and provided functions to manipulate images, including reading, modifying and saving in various standard image formats in a package called "PIL".