from PIL import Image, ImageOps
# Load your cake image
img = Image.open("IMG_8181.jpeg")
# Create a white A4 background (A4 at 300 DPI: 2480 x 3508 pixels)
a4_bg = Image.new("RGB", (2480, 3508), "white")
# Resize the cake image to fit nicely on the A4
img.thumbnail((2000, 2000))
# Paste the image roughly in the center
img_w, img_h = img.size
a4_bg.paste(img, ((2480 - img_w)//2, 100))
# Save the final A4 sheet
a4_bg.save("saja_boys_A4_sheet.png")
print("A4 sheet created successfully!")