Made photo like this collage
ls -la /tmp/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /tmp/workspace/collage && curl -s -o /tmp/workspace/collage/photo.jpg "https://d361swluvexzqs.cloudfront.net/chats-attachments/58794-1786372424794-f2k8fp.jpg" && echo "Downloaded OK" && python3 -c "from PIL import Image; img = Image.open('/tmp/workspace/collage/photo.jpg'); print(img.size, img.mode)"
~/collage/make_collage.py
from PIL import Image, ImageDraw, ImageFont
import math
# Load the photo
img = Image.open('/tmp/workspace/collage/photo.jpg').convert('RGB')
W, H = img.size # 981 x 1600
# The reference collage has 3 panels stacked vertically, each a different crop:
# Panel 1 (top): medium bust shot - upper portion, slightly zoomed out
# Panel 2 (middle): extreme close-up - face only, heavily cropped/zoomed
# Panel 3 (bottom): standard portrait - mid-shot, face + shoulders
# Output width = same as source, each panel equal height
panel_w = W
panel_h = 500 # height of each panel
gap = 3 # thin separator line (white)
total_h = panel_h * 3 + gap * 2
canvas = Image.new('RGB', (panel_w, total_h), (255, 255, 255))
# --- Panel 1: Upper-body / medium shot ---
# Show from top down to about 60% of original height
crop1_y_start = int(H * 0.05)
crop1_y_end = int(H * 0.65)
panel1_src = img.crop((0, crop1_y_start, W, crop1_y_end))
panel1_src = panel1_src.resize((panel_w, panel_h), Image.LANCZOS)
# --- Panel 2: Extreme close-up - face only ---
# Zoom in: crop center 50% width, face area (approx 25%-65% height)
zoom_x_pad = int(W * 0.12)
crop2_y_start = int(H * 0.18)
crop2_y_end = int(H * 0.62)
panel2_src = img.crop((zoom_x_pad, crop2_y_start, W - zoom_x_pad, crop2_y_end))
panel2_src = panel2_src.resize((panel_w, panel_h), Image.LANCZOS)
# --- Panel 3: Standard portrait - face + upper body, looking more direct ---
# Slightly different crop - lower starting point, show more from center
crop3_y_start = int(H * 0.28)
crop3_y_end = int(H * 0.85)
panel3_src = img.crop((0, crop3_y_start, W, crop3_y_end))
panel3_src = panel3_src.resize((panel_w, panel_h), Image.LANCZOS)
# Paste panels
canvas.paste(panel1_src, (0, 0))
canvas.paste(panel2_src, (0, panel_h + gap))
canvas.paste(panel3_src, (0, panel_h * 2 + gap * 2))
# Draw thin white separator lines
draw = ImageDraw.Draw(canvas)
draw.line([(0, panel_h), (panel_w, panel_h)], fill=(255, 255, 255), width=gap)
draw.line([(0, panel_h * 2 + gap), (panel_w, panel_h * 2 + gap)], fill=(255, 255, 255), width=gap)
# Save
out_path = '/tmp/workspace/collage/collage_output.jpg'
canvas.save(out_path, 'JPEG', quality=92)
print(f"Saved: {out_path} | Size: {canvas.size}")
cd /tmp/workspace/collage && python3 make_collage.py
collage output
Image · JPG
Make my this picture like this collage