From 7f50abd0e075ed3157a59384171acb64ea67a6f2 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 12 Sep 2024 08:50:05 -0700 Subject: [PATCH] Add script for converting sample images into a preview grid --- utilities/tile_example_images.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utilities/tile_example_images.py diff --git a/utilities/tile_example_images.py b/utilities/tile_example_images.py new file mode 100644 index 0000000..85e4489 --- /dev/null +++ b/utilities/tile_example_images.py @@ -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() \ No newline at end of file