There is no handy tool for converting FITS files on macOS and Linux. Learn how to use Python to demomosate Bayer FITS files and convert them to TIFF format that can be edited in Photoshop.
--Camera - ZWO ASI 294MC --Control software - KStars + Ekos
The Bayer pattern for the ZWO ASI 294MC is RGGB.
Use Astropy to read the FITS file and OpenCV for image processing. The package version at the time of writing is as follows.
Let's process the image of the moon (moon.fits
) taken with a telescope.
from astropy.io import fits
hdul = fits.open('moon.fits')
src = hdul[0].data
At this stage, the Bayer array remains, so it is a monochrome mosaic image.
Restore a color image by specifying a Bayer transform with the cvtColor
function.
import cv2
dst = cv2.cvtColor(src, cv2.COLOR_BayerBG2BGR)
cv2.imwrite('moon.tif', dst)
The following TIFF image was output. You can adjust the brightness and color balance with any image editing software.
Level correction, color balance adjustment, and sharpening filter applied.
Recommended Posts