New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading FITS images #4054
Comments
You will see in the docs that FITS is listed as an identify-only format - meaning that read and write functionality is not yet supported in Pillow. If you have code for reading or writing FITS files, and would like to connect your code to Pillow, then you can register a handler - from PIL import Image
from PIL import FitsStubImagePlugin
class FitsHandler:
def open(self, im):
...
def load(self, im):
...
return image
def save(self, im, fp, filename):
...
fits_handler = FitsHandler()
FitsStubImagePlugin.register_handler(fits_handler)
im = Image.open("sample.fits") |
I've created #5405 to help in a small way, reading the image headers to determine the mode and size of the image. |
I've created PR #6056 to resolve this. If that is merged, you should no longer have to worry about |
Whenever I try to run PIL.FitsStubImagePlugin.register_handler()
it gives me an error saying PIL doesn't have any FitsStubImagePlugin module.
How do I open my fits file as it says I need a handler to operate .fits file
The text was updated successfully, but these errors were encountered: