Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- img1 = Image.open(img_1_path).convert('RGBA')
- img2 = Image.open(img_2_path).convert('RGBA')
- arr1 = np.array(img1)
- arr2 = np.array(img2)
- # record the original shape
- shape1 = arr1.shape
- shape2 = arr2.shape
- # make a 1-dimensional view of arr
- flat_arr1 = arr1.ravel()
- flat_arr2 = arr2.ravel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement