An AI-Assist On Image Processing Script
Cleaning up a Messy Image-Processing Workflow with an AI Coding Assistant
Some workflow problems hide in plain sight. webpCreate, an AI-assisted coding project, started with one of those.
A Disaster Recovery contracting client asked their technicians to take good photos of the work they were doing. The result was a complete mishmash of images. Some had massive file sizes. Others were in formats like HEIC that were native to one platform but awkward everywhere else. EXIF data, including something as basic as which side was up, was inconsistent. Everything got dropped willy-nilly into nested job folders. Then they tried to use those images in social posts and web content, and the whole mess fell apart.
That is more descriptive problem statement than “we have all these images cluttering up our SharePoint server.” What they actually needed was an intelligent batch image conversion workflow.
Because the real issue was not only format conversion. It was unusable images for a team that needed to show their technicians that the effort they’d taken to get the images wasn’t time wasted.
The issue was trust. If a team cannot trust that their images will be used, they stop taking them.
So the workflow had to change.
Clearly, having a skilled (and expensive) design-team opening, rotating, resizing, and exporting every image by hand, was not a great solution. So, we created a shell script (running in a MacOS terminal) that checks EXIF data, resizes to fit defined dimensions, compresses images for the web, and organizes directories with JPG, PNG, HEIC, and WEBP outputs in the right places—and it processes hundreds of images in seconds. Reports showed how many e=imges were processed and how much file space (for remote servers) would be saved by serving the web (instead of full-res whatevers).
Instead of treating orientation as a side issue, the tool treated it like a real production problem. The resulting script can:
- use detect mode to match what users actually see in Preview
- use warn mode for diagnostics
- use ignore mode when exact preservation matters more
- keep unmodified originals safe
So here is the larger lesson: AI tools and automation do not create productivity by doing more things. They create productivity by helping us build tools that can eliminate busy-work and remove second-guessing
When the ugly edge cases get handled, the whole system moves faster because people stop hovering over it.
That is what useful automation looks like:
- less babysitting
- less rework
- less double-checking
- more flow
The real enemy here was not image optimization in the abstract. If the images didn’t get used, the techs would stop taking images, and the social media push would be dead in the water.
Approaching this problem from a ‘don’t screw up the work from engaged technicians’ perspective plus AI-coding-assistance helped us get up and running quickly. The positive reinforcement of seeing their images promoting their company gave the technicians ownership and fostered interest.
Now I use this script for every client and it makes a hug difference in how fast I can help them turnaround social posting.
Creative thinking wins again.
* Footnotes go here.


