Skip to content

Instantly share code, notes, and snippets.

@vane90
Created May 29, 2013 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vane90/5670235 to your computer and use it in GitHub Desktop.
Save vane90/5670235 to your computer and use it in GitHub Desktop.
def conversion_array(image):
matriz = numpy.fromstring(image.tostring(), numpy.uint8)
matriz.shape = (image.size[1], image.size[0], len(image.getbands()))
return matriz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment