I handed Grok Build a folder of phone photos from a day out near Long Flat (NSW), including shots of the historic Kindee Bridge — timber towers, cables, river, and bush — and asked for one thing:
Make them ready for a website lightbox gallery, the way professionals prep images for the web, without generative AI inventing pixels that were never in the photo.
What follows is the full process in plain English, what changed on each file, and four side-by-side comparisons you can open in a lightbox (Original vs Edited). Tap either image, then use the arrows or swipe keys to flip between the pair.
What “professional” meant here
There are two very different ways people say “AI photo edit” in 2026:
Generative edit (we avoided this)
Models that invent sky, erase objects, or “improve” faces by painting new detail. Great for art; dangerous when you want the photo to stay true.
Traditional batch polish (what we did)
Same family of tools Lightroom/Photoshop use on export: straighten orientation, resize, slight contrast and colour, sharpen after downscale, compress smartly. Every pixel still comes from the original file.
The brief was explicit: enhance for the web, shrink file size, no hallucinations. So Grok Build used a small Node script with Sharp (libvips under the hood) — industry-standard image processing, not a generative image model.
The starting point
- Source: Android-style
IMG_…_HDR.jpgphone shots, roughly 4000×3000 - Size each: about 4.5–6.5 MB (fine for camera roll, heavy for a gallery page)
- Goal: long edge about 1600px (comfortable full-screen lightbox on phones and desktops without shipping multi‑megabyte originals)
- Output folder: an
edited/directory next to the originals so nothing was overwritten
Four of those pairs are shown further down so you can judge the difference yourself.
Every step in the batch pipeline
Each photo went through the same automatic steps. Nothing was hand-brushed frame by frame.
1. Read the file safely
Open the JPEG and ignore minor decoder warnings so one slightly odd file does not stop the whole batch.
2. Fix orientation from EXIF
Phones often store portrait shots as landscape pixels plus a rotation tag. The script applies that rotation so the image is upright for browsers, then clears the stale orientation flag. That is not a creative crop — it is how the photo was meant to display.
3. Resize the long edge to 1600px
Keep aspect ratio. A 4000×3000 landscape becomes 1600×1200; a portrait becomes 1200×1600. Use a high-quality resample (Lanczos3). Never enlarge a smaller image.
Why 1600? For a lightbox gallery it is a practical sweet spot: sharp enough on modern screens, small enough to load quickly, large enough that zooming in the lightbox still looks decent. Thumbnail grids can use smaller derivatives later if you need them.
4. Mild brightness lift
About +1.5% brightness. Outdoor phone HDR can look a touch heavy on screens; a tiny lift keeps shadows from feeling muddy without blowing out skies.
5. Slight saturation boost
About +6% saturation — think “vibrance” style punch for blue sky and green bush, not neon Instagram filters.
6. Gentle contrast
A simple linear contrast curve (~7% stronger around the midtones). This is classic “export for web” contrast, not HDR tone-mapping and not generative relighting.
7. Sharpen after resize
Downscaling softens edges. An unsharp mask tuned to how much each photo was reduced recovers crispness on cables, timber grain, and railings. Settings stay conservative so noise is not amplified.
8. Convert to sRGB
Web colour space, so phones, laptops, and desktop monitors show colours consistently.
9. Progressive mozjpeg export
Quality around 84, progressive scans, mozjpeg optimisations, 4:2:0 chroma (standard for photographic web JPEGs). Progressive means a rough full-frame appears first on slow connections, then refines.
10. Strip bulky metadata
Camera and GPS baggage is dropped for privacy and bytes. The picture is what remains.
11. Watermark (bottom-left)
A small © ianpiggott.com credit in the bottom-left corner of each published comparison image — white type with a soft shadow so it stays readable on light and dark areas without covering the subject.
What did not happen
- No sky replacement or object removal
- No face/body “beautify” generative models
- No upscaling inventing new detail
- A small © ianpiggott.com watermark on every published comparison image (bottom-left)
- Camera-roll originals left untouched in the parent folder
Results in numbers
On the full batch of twenty photos:
- Before: roughly 106 MB total
- After: roughly 10.5 MB total (~90% smaller)
- Per file: about 430–675 KB instead of multi‑megabyte camera originals
That is the difference between a gallery that feels snappy and one that makes visitors wait on mobile data.
Side-by-side: original vs edited
For a fair comparison on this page, the “Original” column is the phone photo with only orientation + resize + web JPEG (no polish). The “Edited” column is the full pipeline above. Click either image for the lightbox; use ← → to flip between the pair.
How to read the differences
The edits are intentionally subtle. On a phone screen in bright sun you may notice:
- Sky and greens feel a little cleaner and more “present”
- Timber texture and white railings look slightly crisper after downscale sharpening
- Overall punch is closer to a careful export from Lightroom than a filter pack
If you preferred the flatter original, that is fine — the pipeline is a starting point. The knobs (brightness, saturation, contrast, sharpen strength, quality, max edge) can be tuned once and re-run on a whole folder in seconds.
Why this is a Tech post (with photo examples)
The subject matter is a walk and Kindee Bridge, but the story is the workflow: automate boring, repeatable export work so you do not open twenty files by hand. Same idea as a good shell script or build step. The Kindee Bridge shots are the demo reel.
Related reading on this site: rebuilding ianpiggott.com with Grok and Astro — same human-guided AI approach, different problem.
Quick recipe if you want to try it
- Put originals in a folder (do not overwrite them).
- Run one script over every
.jpg/.png. - For each file: orient → resize long edge → mild colour/contrast → sharpen → sRGB → progressive JPEG → write to
edited/. - Spot-check a few on a real phone and a laptop.
- Upload the edited set to your site’s image path and wire them into a gallery with a lightbox.
Tools that fit this job well: Sharp (Node), ImageMagick, libvips, or Lightroom/Camera Raw batch export with a saved preset. Generative “AI enhance” apps are optional extras — not required for solid web photos. In this case, the whole batch was run from Grok Build.
Bottom line
Batch web prep is mostly discipline: consistent size, honest colour, sharpen after resize, compress for the network, leave the original alone. AI can run the assembly line for you; it does not need to rewrite the scenery.
