Add script for converting sample images into a preview grid
This commit is contained in:
parent
023ee993be
commit
7f50abd0e0
20
utilities/tile_example_images.py
Normal file
20
utilities/tile_example_images.py
Normal file
@ -0,0 +1,20 @@
|
||||
from PIL import Image
|
||||
|
||||
image1 = Image.open('examples\\death-metal-album-cover-art\\1.png')
|
||||
image2 = Image.open('examples\\death-metal-album-cover-art\\2.png')
|
||||
image3 = Image.open('examples\\death-metal-album-cover-art\\3.png')
|
||||
image4 = Image.open('examples\\death-metal-album-cover-art\\4.png')
|
||||
|
||||
# Assuming all images are the same size.
|
||||
width, height = image1.size
|
||||
|
||||
grid_image = Image.new('RGB', (width * 2, height * 2))
|
||||
|
||||
# Place the images into the 2x2 grid.
|
||||
grid_image.paste(image1, (0, 0))
|
||||
grid_image.paste(image2, (width, 0))
|
||||
grid_image.paste(image3, (0, height))
|
||||
grid_image.paste(image4, (width, height))
|
||||
|
||||
grid_image.save("examples\\death-metal-album-cover-art\\grid.png")
|
||||
grid_image.show()
|
Loading…
Reference in New Issue
Block a user