Created
December 18, 2017 15:27
-
-
Save bubbobne/91d51c89751d18f82e2e95545f600abe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import csv | |
| immagine = Image.open(my_tiff_FILE) | |
| pixels = list(map(lambda i: i*2,list(immagine.getdata()))) | |
| width, height = immagine.size | |
| pixels = [pixels[i * width:(i + 1) * width] for i in range(height)] | |
| print(pixels[0]) | |
| with open("/home/daniele/Downloads/myImg2.csv", "w") as f: | |
| writer = csv.writer(f) | |
| writer.writerows(pixels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment