Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- im = Image.open('tehinternets.jpg')
- print im.mode
- pixels = list(im.getdata())
- width, height = im.size
- print "Width: "+str(width)
- print "Height: "+str(height)
- pixels = im.load() # this is not a list, nor is it list()'able
- all_pixels = []
- for x in range(width):
- for y in range(height):
- cpixel = pixels[x, y]
- all_pixels.append(cpixel)
- print all_pixels
Advertisement
Add Comment
Please, Sign In to add comment