Every time a surgeon sends over before/after photos, someone has to size and brand them for every place we post. That someone was me. Here's the list:
- Email (1072px wide, retina)
- Website gallery (1200px)
- Instagram carousel (1080x1350, 4:5)
- Stories / Reels / TikTok (1080x1920, 9:16)
- Facebook / LinkedIn / X (1200x630)
- Google Business Profile (1200x900)
- Pinterest (1000x1500)
Seven sizes. Some need the two photos side by side, some need each photo on its own with a label. So one photo pair really means 9 files.
I was doing it in Canva, one file at a time. Each practice I work with has its own logo and its own surgeons, so every file had a few spots to get wrong. One pair took me 20-30 minutes. With new pairs coming in every week, that's most of an afternoon gone to resizing.
What I Built
Two small Python scripts. I built them with Claude Code over two sessions, about 3 hours total.
The first one handles the wide formats, the side-by-side ones. You give it a before and an after and it makes:
- Rounded panels on a dark background
- A faint logo watermark, centered at the top
- The surgeon's credit line at the bottom
- All 5 wide sizes in one run
The second one handles the tall formats for Stories and Pinterest. You give it one photo and it:
- Crops from the center to each tall size
- Adds a BEFORE or AFTER label
- Fades the bottom darker so the credit text still reads on light skin
- Makes all 4 tall sizes in one run
Both scripts read one config file that lists each brand: its logo, its name, its surgeons. I also bundled the font file (Lato) with the scripts, so the output looks the same no matter which computer runs it.
How I Use It
I drop the photos in a folder and run one command. Batch mode matches each before with its after by filename. If the filename says "tummy tuck," it picks up the procedure too, which matters for the next part.
What Broke
One brand's logo file was more than 15,000 pixels wide. Pillow, the Python library that opens the images, threw a "decompression bomb" warning and wouldn't load it. That's a safety check. A file that huge looks like it could be an attack, so Pillow stops. My first thought was to raise the limit in the code, but that felt wrong. I shrank the logo to 2,400px instead. Problem gone.
The rounded corners also clipped unevenly on some sizes in the first version. The corner size was a fixed number of pixels, so it looked fine on big files and chunky on small ones. Making it scale with the output size fixed it. Took about 3 tries.
Why It Holds Up
Adding a brand is one entry in the config: logo, name, surgeons. A new surgeon is one line. A new size is one line.
When a new surgeon starts, I add the name to the config and that's it. Every photo from that surgeon gets the right credit from then on, and I don't touch anything else.
The alt text means I'm not writing image descriptions by hand anymore. And the output folders match the ones I already use for email campaigns, so nothing gets renamed or moved around.
The Math
Before: 20-30 minutes per pair in Canva, by hand. Easy to miss a size or leave an old surgeon name on.
After: about 3 seconds per pair.
If You Want to Build Something Like This
I'm not a developer. Claude Code wrote the Python, fixed the image errors, and set up the config. My part was knowing what I needed: the sizes, the brand rules, where the files go. If you have a visual task you repeat with the same rules every time (especially across more than one brand), this works.