| 1 | initial version |
Since PIL is included within Sage, you can do:
from PIL import Image
img = Image.open("your_file.png")
Then, you can do : list(img.getdata())
See img.<TAB> to see avbailable commands. If you prefer to deal with numpy arrays:
from numpy import array
arr = array(img)
| 2 | No.2 Revision |
Since PIL is included within Sage, you can do:
from PIL import Image
img = Image.open("your_file.png")
Then, you can do : do:
list(img.getdata())
See img.<TAB> to see avbailable commands. If you prefer to deal with numpy arrays:
from numpy import array
arr = array(img)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.