Add script for converting sample images into a preview grid

This commit is contained in:
moshferatu 2024-09-12 08:50:05 -07:00
parent 023ee993be
commit 7f50abd0e0

View 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()