Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created March 25, 2017 03:30
Show Gist options
  • Save KelSolaar/a3f7fd0514b27cdf0bc6d2b109080077 to your computer and use it in GitHub Desktop.
Save KelSolaar/a3f7fd0514b27cdf0bc6d2b109080077 to your computer and use it in GitHub Desktop.
Fits - Demosaicing
import numpy as np
from astropy.io import fits
import colour
import colour_demosaicing
image = its.getdata('test.fits', ext=0).astype(np.float_) / 255.0
# image = colour.orient(image, '90 CW')
colour.write_image(image, '/Users/kelsolaar/Downloads/test.exr')
colour.write_image(colour_demosaicing.demosaicing_CFA_Bayer_Malvar2004(image, pattern='GRBG'), '/Users/kelsolaar/Downloads/test_demosaiced.exr')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment