diff --git a/create-og-image.py b/create-og-image.py new file mode 100644 index 0000000..89970a2 --- /dev/null +++ b/create-og-image.py @@ -0,0 +1,67 @@ +"""Generate OG image and favicon for Batida landing page.""" +from PIL import Image, ImageDraw, ImageFont + +# OG Image (1200x630) +W, H = 1200, 630 +img = Image.new("RGB", (W, H), "#0C0C0F") +draw = ImageDraw.Draw(img) + +# Orange accent bar at top +draw.rectangle([0, 0, W, 6], fill="#F97316") + +# Logo square (orange B) +logo_size = 120 +logo_x, logo_y = 80, 180 +draw.rounded_rectangle([logo_x, logo_y, logo_x + logo_size, logo_y + logo_size], radius=24, fill="#F97316") +try: + font_bold = ImageFont.truetype("/System/Library/Fonts/Helvetica.ttc", 72) + font_title = ImageFont.truetype("/System/Library/Fonts/Helvetica.ttc", 64) + font_sub = ImageFont.truetype("/System/Library/Fonts/Helvetica.ttc", 28) + font_tag = ImageFont.truetype("/System/Library/Fonts/Helvetica.ttc", 22) +except Exception: + font_bold = ImageFont.load_default() + font_title = ImageFont.load_default() + font_sub = ImageFont.load_default() + font_tag = ImageFont.load_default() + +# B letter in logo +bbox = draw.textbbox((0, 0), "B", font=font_bold) +bw, bh = bbox[2] - bbox[0], bbox[3] - bbox[1] +draw.text((logo_x + (logo_size - bw) / 2, logo_y + (logo_size - bh) / 2 - 8), "B", fill="white", font=font_bold) + +# Title +draw.text((240, 185), "Batida", fill="#FAFAFA", font=font_title) + +# Tagline +draw.text((240, 270), "Manage Incidents. Keep Your Cool.", fill="#6B6B80", font=font_sub) + +# Bottom tagline +draw.text((80, 460), "Intelligent incident management for DevOps teams.", fill="#4A4A5A", font=font_tag) +draw.text((80, 495), "pagerduty alternative • open core • self-hosted or cloud", fill="#3A3A4A", font=font_tag) + +# CTA button +btn_x, btn_y, btn_w, btn_h = 80, 550, 200, 44 +draw.rounded_rectangle([btn_x, btn_y, btn_x + btn_w, btn_y + btn_h], radius=8, fill="#F97316") +bbox = draw.textbbox((0, 0), "Get Started", font=font_tag) +tw = bbox[2] - bbox[0] +draw.text((btn_x + (btn_w - tw) / 2, btn_y + 10), "Get Started", fill="white", font=font_tag) + +# URL +draw.text((960, 580), "batida.io", fill="#3A3A4A", font=font_tag) + +img.save("/Users/kakarotto/codes/personal/batida/batida-landing/og-image.png", "PNG") +print("OG image created: og-image.png") + +# Favicon PNG (32x32) +fav = Image.new("RGBA", (32, 32), (0, 0, 0, 0)) +fav_draw = ImageDraw.Draw(fav) +fav_draw.rounded_rectangle([0, 0, 32, 32], radius=8, fill="#F97316") +try: + fav_font = ImageFont.truetype("/System/Library/Fonts/Helvetica.ttc", 20) +except Exception: + fav_font = ImageFont.load_default() +bbox = fav_draw.textbbox((0, 0), "B", font=fav_font) +bw, bh = bbox[2] - bbox[0], bbox[3] - bbox[1] +fav_draw.text(((32 - bw) / 2, (32 - bh) / 2 - 2), "B", fill="white", font=fav_font) +fav.save("/Users/kakarotto/codes/personal/batida/batida-landing/favicon.png", "PNG") +print("Favicon created: favicon.png")