Untitled
unknown
plain_text
a year ago
1.7 kB
8
Indexable
from PIL import Image, ImageDraw, ImageFont
# Create an image with a solid background
width, height = 800, 600
background_color = (255, 255, 255) # white background
image = Image.new('RGB', (width, height), background_color)
draw = ImageDraw.Draw(image)
# Load a font
font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
font_large = ImageFont.truetype(font_path, 50)
font_medium = ImageFont.truetype(font_path, 40)
font_small = ImageFont.truetype(font_path, 30)
# Headline
headline_text = "Join the Fun!"
draw.text((width // 2 - draw.textsize(headline_text, font=font_large)[0] // 2, 30),
headline_text, fill="blue", font=font_large)
# Middle section (mock-up with simple shapes representing children playing)
# Normally, you'd use actual images, but we'll use colored shapes here for simplicity.
draw.rectangle([(100, 150), (width-100, 400)], outline="black", width=3)
draw.ellipse([(150, 200), (200, 250)], fill="red", outline="black")
draw.ellipse([(300, 250), (350, 300)], fill="green", outline="black")
draw.ellipse([(500, 200), (550, 250)], fill="yellow", outline="black")
# Bottom section text
bottom_text = "Day Activity Camp - 4th August\nOnly £50!"
draw.text((width // 2 - draw.textsize(bottom_text, font=font_medium)[0] // 2, 420),
bottom_text, fill="black", font=font_medium)
# Call-to-Action
cta_text = "Book Now!"
cta_box = [(width // 2 - 100, 500), (width // 2 + 100, 560)]
draw.rectangle(cta_box, fill="orange", outline="black")
draw.text((cta_box[0][0] + 10, cta_box[0][1] + 10),
cta_text, fill="white", font=font_small)
# Save the image
image_path = "/mnt/data/day_activity_camp_ad.png"
image.save(image_path)
image.show()
image_path
Editor is loading...
Leave a Comment