Created
November 28, 2023 20:41
-
-
Save HansUXdev/736edb568855b8eac61d14aeb69ddc05 to your computer and use it in GitHub Desktop.
A utility function for training GPT on creating storyboards and prototypes for
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
from PIL import Image | |
# File paths of the storyboard images | |
file_paths = [ | |
'/mnt/data/Storyboard_for_a_responsive_website_homepage_for_a.png', | |
'/mnt/data/Storyboard_for_a_responsive_About_Us_page_for_a_.png', | |
'/mnt/data/Storyboard_for_a_responsive_Residential_Informati.png', | |
'/mnt/data/Storyboard_for_a_responsive_Commercial_Spaces_pa.png', | |
'/mnt/data/Storyboard_for_a_responsive_Community_Amenities_.png', | |
'/mnt/data/Storyboard_for_a_responsive_Events_and_News_page.png', | |
'/mnt/data/Storyboard_for_a_responsive_Sustainability_Initia.png', | |
'/mnt/data/Storyboard_for_a_responsive_Resident_Portal_page.png' | |
] | |
# Load all the images | |
images = [Image.open(fp) for fp in file_paths] | |
# Determine the total width and height for the sprite image | |
total_width = max(image.width for image in images) | |
total_height = sum(image.height for image in images) | |
# Create a new image with the total width and height | |
sprite_image = Image.new('RGB', (total_width, total_height)) | |
# Paste each image into the sprite image | |
current_height = 0 | |
for image in images: | |
sprite_image.paste(image, (0, current_height)) | |
current_height += image.height | |
# Save the sprite image | |
sprite_path = '/mnt/data/responsive_website_storyboards_sprite.png' | |
sprite_image.save(sprite_path) | |
sprite_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment