-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add write support for PDS3Image #45
Comments
The syntax for this should be filename = ...
image = PDS3Image.open(filename)
image.data = image.data + 1
image.save(overwrite=True) or ...
image.save('newfilename.IMG') The following should raise an exception if the image file already exists, otherwise, write out the file image.save() |
Thoughts on an api more similar to PIL/Pillow or are you basing it on something else? |
Good suggestion @wtolson, basing it on something rather than making it up. |
We will also want to consider how to take a simple numpy array and write it out as a # ?? the constructor (__init__) doesn't support this yet
i = PDS3Image(data=np.ones((1024, 1024, 3))
i.save() or
@wtolson's suggestion of using pillow as the model is a good one. I keep forgetting that he started out with that as his model. |
This has me thinking, we might want to separate out image encoding/decoding from the Image object which would allow us to do something like:
Not sure how easy this would be for us to separate out image representation from the encoding/decoding formats but it seems to be the architecture used by PIL and scikit image. |
Definitely its own issue and a future project though. |
Separating the encoding/decoding is really great idea @wtolson. |
There may be parts we will choose to extract up into the
PlanetaryImage
class, but you can start with PDS3Image.The text was updated successfully, but these errors were encountered: