Not every catalogue is shot in a studio. Retailers receive photos from dozens of suppliers, each with its own lighting, background and resolution. Resellers and marketplaces have whatever their sellers took on a phone. Heritage brands have archives of product shots that were state of the art at 640 pixels wide. The usual fix is a retoucher, or a batch job in a desktop tool, run once over every file and then again whenever a template changes.

ZawCloud Images has four parameters that do the most common clean-up jobs on the fly, from the same untouched originals: ai_crop, ai_remove_bg, ai_upscale and ai_enhance. This article explains what each one is good for, where it is the wrong tool, and how to keep the cost predictable.

Remove the background: ai_remove_bg

The classic marketplace requirement is "product on a plain background". Supplier photos have a kitchen, a warehouse shelf or a patterned tablecloth behind the product. ai_remove_bg=true finds the salient subject and cuts everything else away into an alpha channel:

/v1/supplier/kettle-0412.jpg?w=800&h=800&fit=pad&ai_remove_bg=true

The result has a transparent background, so it sits on whatever your page uses, whether that is white, a brand colour or a dark-mode grey. Two details are worth knowing:

  • JPEG cannot carry transparency. Asking for ai_remove_bg=true&f=jpeg is refused with a 400 rather than delivering the product on a black rectangle. With the default f=auto, the edge negotiates AVIF or WebP, which keep the alpha channel, and falls back to PNG.
  • It works on the subject, not on a category. The model finds the most prominent object. A single product on a busy background is the ideal case. A flat-lay of six items, or a model holding the product, may keep more or less than you expected. Check a sample of your own catalogue before switching a whole category over.

Crop to the product: ai_crop

A square grid tile cut from the centre of a landscape photo often slices the product in half. ai_crop=true runs the same subject detection and places the crop window around it instead:

/v1/supplier/kettle-0412.jpg?w=400&h=400&fit=cover&ai_crop=true

It only applies when the image is being cropped, that is with fit=cover (or crop) and both a width and a height. Under fit=contain the whole image is delivered anyway, and choosing a region would change what the URL means. When a request uses both ai_crop and ai_remove_bg, the model runs once and feeds both. We explain why the centre is the wrong default in Smart crop: the middle is usually wrong.

Recover detail: ai_upscale

Older product shots and small supplier images look soft when a modern product page shows them at 1200 pixels on a high-density screen. ai_upscale=2x or 4x runs a super-resolution network that reconstructs edges and texture as it enlarges, instead of just stretching pixels.

It happens first in the pipeline, before any resize, so every later step works from the improved image. Be honest with yourself about what it does: an enlargement invents plausible detail. That is fine for a mug or a lamp. It is not appropriate where the detail is the product, such as fine print on a label, the weave of a fabric or the stones in a ring, because the result can look sharp and still be wrong. We wrote a whole article about that: Enlarging an image means inventing pixels.

Fix flat photos: ai_enhance

Supplier photos are often underexposed, grey or low-contrast. ai_enhance=true applies a fixed, conservative sequence: a contrast stretch, automatic gamma, a little saturation and an unsharp mask. It runs at the delivered size, after resizing, because sharpening before a downscale mostly gets thrown away and leaves halos.

Despite the prefix, this one uses no neural network, and we would rather say so. It is deliberately gentle: it improves a flat image noticeably and barely touches one that was already well graded. That matters, because it runs without anybody checking each result. An aggressive enhancement ruins exactly the photographs that were most carefully prepared, and you cannot turn it down per image.

Putting them together

The steps run in a fixed order, chosen so each one sees the best input:

orient → rotate → ai_upscale → subject detection → ai_remove_bg
  → ai_crop → resize → ai_enhance → filters, overlay, watermark → encode

So one URL can turn a small, dull supplier photo on a cluttered background into a clean, centred, transparent tile:

/v1/supplier/kettle-0412.jpg?w=600&h=600&fit=cover
    &ai_upscale=2x&ai_crop=true&ai_remove_bg=true&ai_enhance=true

In practice, use only the steps a category needs. Most catalogues need background removal on some categories, smart crop on grid tiles, and enhancement on a handful of suppliers, not everything on everything.

What it costs, and why it stays predictable

AI features are an add-on, and each operation costs credits at the rates on the pricing page:

OperationCredits
ai_crop1
ai_enhance1
ai_remove_bg5
ai_upscale=2x5
ai_upscale=4x10

A request is charged for everything it asks for as one number, so the full example above costs 12. The key point is that credits are charged for inference, not for delivery. The first request for a rendition runs the model and is charged. Every later request is served from cache and costs nothing, however many visitors see it. The credit cost of your catalogue is therefore the number of distinct renditions times their cost, not your traffic. This is also why a short, fixed list of sizes matters even more with AI parameters than without them.

Running out of credits stops new work, not delivery. Renditions already in the cache keep being served. Only a request that would need a new inference gets a 402, with the reset date in the response. You get a webhook (ai_credits.warning) and an email at 90%, so you can top up before that happens. The detailed arithmetic is in What an AI edit actually costs.

Where your images go

Background removal and upscaling always run on a model on the edge infrastructure itself, so those images are not sent to any third party. Smart cropping can also be configured against a hosted vision API, which does send the image out. If that matters for your catalogue, ask which mode applies before you turn it on.

A sensible rollout

  1. Pick one category with a clear problem, such as supplier photos with cluttered backgrounds.
  2. Build URLs for a sample of fifty products with and without the parameter, and review them side by side. Look specifically at hair, glass, transparent packaging and thin parts such as cables, which are the hard cases for any cut-out.
  3. Switch that category's templates over, keeping the plain URL available as a fallback for products that need a manual shot.
  4. Check the credits used this month on the console's AI tab during the first week. The figure should climb quickly while the cache fills and then slow down, because repeat views are free.

The originals are never modified. If a result is not right for a product, removing the parameter from that one URL gets you the original back, and a retouched replacement can be uploaded under the same path and purged.