Skip to content

Instantly share code, notes, and snippets.

@joelbarmettlerUZH
Created October 5, 2019 09:13
Show Gist options
  • Save joelbarmettlerUZH/0644ea335e06a16524d15c7d403bae5b to your computer and use it in GitHub Desktop.
Save joelbarmettlerUZH/0644ea335e06a16524d15c7d403bae5b to your computer and use it in GitHub Desktop.
Load image as numpy array
import numpy as np
def load_image_into_numpy_array(image):
(im_width, im_height) = image.size
return np.array(image.getdata()).reshape(
(im_height, im_width, 3)).astype(np.uint8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment