Using python to inspect pixel values

install PIL if you don’t have it installed already
>>> import Image
>>> filename = ‘test.png’
>>> im = Image.open(filename)
>>> print im.format, im.size, im.mode
PNG (256, 256) RGBA
>>> im.getpixel((247,160))
(229, 224, 219, 239)

This entry was posted in Software. Bookmark the permalink.

Leave a comment