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 | |
import random | |
# Load the input image and convert it to RGBA mode | |
input_image = Image.open("input_image.png").convert("RGBA") | |
# Calculate the size of each grid cell based on the input image size | |
cell_width = 200 | |
cell_height = 200 |