Skip to content

Instantly share code, notes, and snippets.

@loon3
loon3 / 12x12-random.py
Created March 7, 2023 18:31
twelvefold-python
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