Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. img1 = Image.open(img_1_path).convert('RGBA')
  2. img2 = Image.open(img_2_path).convert('RGBA')
  3. arr1 = np.array(img1)
  4. arr2 = np.array(img2)
  5. # record the original shape
  6. shape1 = arr1.shape
  7. shape2 = arr2.shape
  8. # make a 1-dimensional view of arr
  9. flat_arr1 = arr1.ravel()
  10. flat_arr2 = arr2.ravel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement