Last active
April 8, 2018 18:51
-
-
Save jessstringham/1fab85175358650242c57d99817ed413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image = mpimg.imread(IMAGE_LOCATION) | |
# pasta the first image | |
h, w, c = image.shape | |
image = image.reshape(h // 2, 2, w, c) | |
image = image.transpose(1, 0, 2, 3) | |
image = np.hstack(image) | |
# rotate the image | |
image = image.transpose(1, 0, 2) | |
# pasta the double image | |
h, w, c = image.shape | |
image = image.reshape(h // 2, 2, w, c) | |
# move the 2 image into the first dimension, and rotate the four images | |
image = image.transpose(1, 2, 0, 3) | |
image = np.hstack(image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment