I built a batch image resizing automation with Claude Code last month for a Vancouver e-commerce client who runs weekly product drops. Their marketing coordinator was spending 4-6 hours every Thursday preparing images for Instagram, Facebook ads, email newsletters, and their Shopify store. Same products, five different platform specs, 40-80 images per drop. It was pure repetition.
The script I built cut that 4-6 hour block down to about 10 minutes. Drop the source images into a folder, run the script, get back five organized subfolders with platform-ready files. No Photoshop. No manual exports. No forgetting which dimension goes where.
This post walks through how I built it, why batch image resizing with Claude Code makes sense for marketing teams, and how you can set up something similar if you're tired of doing this work manually.
Why Marketing Teams Need Batch Image Resizing Automation
Every social platform has different image size requirements. Instagram wants 1080×1080 for feed posts and 1080×1920 for Stories. Facebook ads perform better at 1200×628. LinkedIn prefers 1200×627 for link previews. Email clients display best around 600px wide. Shopify product images need to be at least 2048px on the longest edge for zoom functionality.
If you're running coordinated campaigns across these channels — which most of my Vancouver clients are — you need the same image in five or six different sizes. Doing that manually in Photoshop means opening each file, resizing, saving with the right compression settings, renaming to match your file structure, and repeating 50 times. It's skilled work that doesn't require skill.
The problem gets worse when you're working with a designer who delivers high-res source files at 4000×3000px. You can't just upload those directly — file sizes are too big, dimensions don't match platform specs, and you'll get cropping or quality issues. Someone has to prep them, and that someone is usually a junior marketer or coordinator whose time would be better spent on strategy.
That's the gap Claude Code fills. You define the rules once — platform dimensions, output format, compression quality, naming convention — and the script applies them to every image in the batch. It's repeatable, consistent, and fast.
How the Claude Code Batch Image Resizing Script Works
The script I built uses Python with the Pillow library for image processing. Claude Code wrote the initial version in about 20 minutes after I described what I needed. I spent another hour testing it with real campaign images and tweaking the output quality settings.
Here's the basic workflow:
- Drop source images (JPEG or PNG, any resolution) into an input folder
- Run the script from the command line
- Script reads a config file with platform specs (dimensions, format, quality)
- For each source image, generate resized versions for each platform
- Save outputs to platform-specific subfolders with systematic filenames
- Generate a summary report showing what was processed
The config file is just a JSON object that looks like this:
{
"platforms": {
"instagram_feed": { "width": 1080, "height": 1080, "format": "JPEG", "quality": 90 },
"instagram_story": { "width": 1080, "height": 1920, "format": "JPEG", "quality": 88 },
"facebook_ad": { "width": 1200, "height": 628, "format": "JPEG", "quality": 85 },
"email": { "width": 600, "height": null, "format": "JPEG", "quality": 82 },
"shopify": { "width": 2048, "height": null, "format": "PNG", "quality": 95 }
}
}
When the height is null, the script maintains aspect ratio based on the width. This is useful for email images where you want a consistent width but varying heights depending on the original image proportions.
The script handles portrait and landscape source images intelligently. For square outputs like Instagram feed posts, it crops to the center. For fixed-ratio outputs like Facebook ads, it resizes to fit and adds background fill if needed (configurable color). You can also set it to reject images that don't meet minimum resolution thresholds — helpful if your designer sometimes sends you low-res comps by mistake.
Real Results from a Vancouver E-Commerce Campaign
The first production run was for a product launch with 68 images. The marketing coordinator had been budgeting six hours to prep them all. With the script: nine minutes to process, another 15 minutes to spot-check the outputs and upload to the respective platforms.
She ran the same workflow the next week for a different product line. Eight minutes. The week after that: seven minutes, because she'd gotten faster at organizing the source files in the input folder.
Over a quarter, that's roughly 70 hours saved. At her hourly rate, the ROI on building the script paid back in the first month. And the time savings compound — she's now handling two product drops per week instead of one, which directly increased the client's launch velocity.
The other benefit that wasn't obvious upfront: consistency. Before the script, there were occasional mistakes — an Instagram Story posted at feed dimensions, an email image that was too large and got auto-compressed by the ESP. With the script, every output matches spec every time. Fewer revision cycles, fewer "oops we need to re-export that" moments.
Common Challenges and How I Solved Them
The first version of the script had a problem with images that had embedded color profiles. Some of the designer's export files were in Adobe RGB, and when Pillow resized them without handling the color profile properly, the outputs looked washed out. Fixed by adding explicit color space conversion to sRGB before resize.
Another issue: file naming. The original script just appended the platform name to the source filename, which led to messy names like product-hero-final-v3-instagram_feed.jpg. I updated it to use a cleaner naming convention based on a SKU or product ID pulled from the filename, so outputs look like SKU-12345-instagram-feed.jpg. Much easier to manage when you're uploading to a DAM or Shopify.
The script also now skips files that have already been processed (checks the output folder for matching filenames) so you can add new images to the input folder and re-run without re-processing everything. Useful for ongoing campaigns where images trickle in over a few days.
How to Set This Up for Your Team
If you want to build something similar, here's the simplest path:
- List out every platform you publish images to and their exact dimension requirements
- Decide on output formats (JPEG for most cases, PNG if you need transparency)
- Set quality thresholds — 85-90 for web use is usually the sweet spot between file size and visual quality
- Define your file naming convention (include SKU, product name, platform, version number, etc.)
- Write these specs into a plain-text document and hand it to Claude Code with the prompt: "Build a Python script that batch resizes images according to these rules"
The first version will work but probably need tweaking. Test it with 5-10 real campaign images and check for quality issues, incorrect crops, or files that fail to process. Refine the prompt and re-run. You'll have a working version in an hour or two.
If you're not comfortable running Python scripts locally, you can also deploy this as a simple web tool — drag-and-drop interface, same script running server-side, download a ZIP of the outputs. I've built that version for a couple of clients who didn't want to deal with command-line tools. Takes about half a day to set up with a basic Flask or FastAPI backend.
For teams that want this but don't have the in-house capacity to build it, I offer this as a standalone automation project. Typical build time is 1-2 days depending on complexity, and it includes the script, config file, documentation, and a walkthrough session for whoever will be running it.
When Batch Resizing Isn't Enough
This script handles resizing and format conversion, but it doesn't do creative edits. If you need text overlays, logo placement, or background removal, you'll still need a human designer or a more advanced tool like Figma's bulk generation features.
It also doesn't integrate directly with your social schedulers or ad platforms — it just gives you platform-ready files that you upload manually. If you want to go a step further and automate the upload, that's possible (I've done it with the Meta API for Facebook and Instagram), but it adds complexity and ongoing API maintenance. For most teams, having the files ready and uploading them manually is already a huge win.
And if your brand guidelines require manual quality checks on every image before it goes live, this doesn't replace that step. It just makes sure the files are already at the right size and quality when they get to the reviewer.
Next Steps
If you're spending more than two hours a week resizing images for campaigns, this is worth building. It's one of those automations that feels too simple to be valuable until you run it the first time and realize you just got three hours back.
The script I built for the Vancouver e-commerce client is now handling 300+ images a month with zero maintenance. It's saved enough coordinator time that they've reassigned her to campaign strategy work, which has a much higher impact on revenue than Photoshop batch exports.
If you want to see how this could work for your team's specific image workflow, check the FAQ for common questions, or if you want me to build a custom version for your platform mix and file structure, reach out and we'll scope it. Most of these projects are straightforward enough that we can get you up and running in a week.
The tools are here. The question is just whether you want to keep doing this manually or get the time back.