Skip to content

Instantly share code, notes, and snippets.

@Zemke
Last active August 2, 2022 19:03
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 Zemke/04bae45d29ab97372ebbd6ce48ef47d6 to your computer and use it in GitHub Desktop.
Save Zemke/04bae45d29ab97372ebbd6ce48ef47d6 to your computer and use it in GitHub Desktop.
image grid with numpy
# unordered
# c = color channel if available
np.concatenate(np.reshape(img, (img_rows,-1,img_width,c), axis=1)
# ordered
# n = number of tiled images that should make up a row in the grid
np.vstack([np.concatenate(img[i:i+n], axis=1) for i in range(0, len(img), n)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment