resiz[ly]A PictureEditor.com tool

A product photo pipeline

A shop needs the same photograph at four sizes in two shapes, every week, from a folder that is never quite the same twice. That is a rule set, and it should be written once.

What a catalogue asks for

The sizes are the easy part. What makes catalogue work different from every other bulk job is that two of the outputs have to be the same shape as each other across products that were not photographed the same way. A grid of tiles where one is taller than the rest is the thing a customer notices before they notice the products.

OutputRoughlyFitWhy that fit
Grid tile400 × 400cover, centreEvery tile identical. A ragged grid reads as a broken page.
Listing image800 × 800cover, centreSame square, enough detail for a hover or a tap.
Zoom view1600 on the long edgecontainHere the whole object matters more than the shape.
Cart thumbnail120 × 120cover, centreSmall enough that the crop is invisible and the bytes are free.

Three of the four are squares filled by cropping, and one is the picture untouched but smaller. That split is the whole design: cropping where consistency matters, containing where completeness matters, and never arguing about it per product.

The rule stack, in order

Rules run in order and every rule a file matches writes a file, so one photograph leaves this stack as four. Written out as the card headers print them:

1  Cart thumb    all files   box 120x120    cover c   webp q70  {parent}/thumb.webp
2  Grid tile     all files   box 400x400    cover c   webp q78  {parent}/grid.webp
3  Listing       all files   box 800x800    cover c   webp q82  {parent}/listing.webp
4  Zoom          all files   long edge 1600 contain   webp q86  {parent}/zoom.webp

Quality climbs with size, which is deliberate and the opposite of what people expect. A 120-pixel tile hides compression artefacts inside four pixels of product; a 1600-pixel zoom is the one image a customer looks at closely before deciding to spend money, and it is the only place the extra bytes are earned.

The order of the four is not load-bearing — every matching rule writes its file regardless — but it is the order the plan lists them in, and reading a plan sorted small to large makes a missing output obvious.

When one product needs something different

Put the exception above the general rule and give it a pattern. A matcher of **/wide/* catches anything inside a folder called wide, wherever it sits in the drop, so a handful of panoramic products can take a 3:2 tile while the rest stay square:

1  Wide tile   **/wide/*   box 600x400   cover c   webp q78  {parent}/grid.webp
2  Grid tile   all files   box 400x400   cover c   webp q78  {parent}/grid.webp

Both rules match the panoramic files, so both write, and both write to the same name — which the plan catches as a collision rather than letting the second quietly win. The fix is to narrow the general rule to everything else, or to set the collision policy so the later file wins and accept that the plan will strike the first row through. Either is fine; discovering it at write time would not have been.

Uneven sources are the actual problem

A studio folder is easy. A real catalogue folder has last season’s images at 900 pixels next to this week’s at 6000, a few shot on a phone in a format the old ones are not in, and three portraits among two hundred landscapes. Four things are worth setting before the run rather than discovering during it:

  • Small sources. Leave enlarging off. A 300-pixel legacy image in an 800 rule comes out at 300, marked in the plan, which is a visible gap in the catalogue rather than a soft picture pretending to be fine.
  • Portraits among landscapes. A square cover takes the middle band of a tall photograph, which for a standing object is usually its waist. If the products are consistently tall, the anchor belongs at the top rather than the centre.
  • Phone files. Recent iPhones shoot HEIC, which arrives through a WebAssembly codec fetched for the first one and reused after that. It decodes on the main thread, a picture at a time, so budget extra minutes for a catalogue drop with phone shots mixed into it.
  • Sources that are already square. They pass through cover untouched, which is the right outcome and also the reason a stack like this is safe to re-run over a folder you have already processed once.

Names the storefront can find

A catalogue import is matched on filename, so the naming template is not cosmetic — it is the integration. The useful shape puts the product code in the path and the role in the name, which is what {parent}/listing.webp above is doing: one folder per product, four predictably named files inside it, and no numeric suffixes anywhere.

TemplateWritesGood for
{parent}/listing.webpSKU-4471/listing.webpAn importer that walks a folder per product.
{parent}-{rule}.{ext}SKU-4471-listing.webpA flat bucket or CDN prefix.
{name}-{w}.{ext}SKU-4471-01-800.webpSources already named by product and shot number.

The first two only work if the folder the photographs arrive in is named after the product, which is the one piece of discipline this whole pipeline depends on. If the camera dumped everything into one folder, {parent} is empty and all two hundred products collide on the same four filenames — the plan will say so loudly, and the fix is in the file manager rather than here.

Saving it as a recipe

Four rules with their qualities, anchors, formats and templates is ten minutes of typing and the whole value of it is not typing them again next Tuesday. A recipe stores the rule stack under a name in this browser’s own storage: rules only, no filenames, no record that a run happened.

The consequence is the honest one. It is on that device, in that browser. A colleague cannot load it, a private window starts with none, and clearing site data forgets it. For a stack this specific, the durable copy is the screenshot of the rule cards in your own documentation.

Consistent sizes are not consistent photographs

Everything here is geometry. It will make two hundred files the same shape and the same weight, and it will do nothing at all about one of them being two stops darker than the rest, shot against a grey wall rather than white, or lying at an angle. Those differences survive resizing perfectly and are far more visible in a grid than any crop decision. They belong to the photography, or to a tool that edits pixels rather than counting them.

Running it

Drop the parent folder, load the recipe, read the plan — four rows per product, named and measured — and run. Two hundred products is eight hundred files, which a laptop writes in a couple of minutes and a phone should not be asked to attempt. What the machine can take is the third guide, and the token list behind those templates is on the naming reference.