Saqqa Academy

How to make a white-background product photo with AI (and check it is really pure white)

Turn a phone photo of your product into a clean white-background shot with AI, then check the white is exactly 255, 255, 255 with a free tested script.

Saqqa Academy team

29-Nov-2026 · 7 min read

In this article

To make a white-background product photo with AI, start from a real photo of your product, ask the image tool to replace only the background with pure white (#FFFFFF) and a soft shadow, and tell it to keep the product's shape, colours and label exactly the same. Then check the result before you upload it: most AI images look white but are really off-white (for example 252 instead of 255), and marketplaces such as Amazon ask for pure white, RGB 255, 255, 255, on the main image. The free script in this post checks that in seconds, and one ffmpeg command fixes a background that is only slightly off.

White-background shots are the most requested product images there are: shop listings, catalogues, WhatsApp catalogues, websites and ads all use them. Doing them with AI is fast, but there are three traps: the AI quietly changes the product, the white is not really white, and the product is too small in the frame. This guide covers all three. The scripts were tested on Windows with ffmpeg 6.1 and Node.js on 29 November 2026.

Step 1: Start from a real photo, not a text prompt

A text-only prompt invents a product that looks like yours. A customer who receives something different will return it, and marketplaces don't allow images that misrepresent the product. So always give the AI a real photo as the reference.

The photo doesn't need a studio. A phone photo near a window, on a plain table, with the whole product in frame and in focus, is enough. Clean the product first; AI tools tend to keep dust and fingerprints, or replace them with something odd.

If you haven't used a product photo as a reference before, our guide on turning one product photo into an AI ad image without changing the product explains how image-to-image editing keeps the product the same.

Step 2: Ask for the background change, and protect the product

Keep the prompt short and specific. Say what changes (the background and the light) and, just as clearly, what must not change:

Replace the background with pure white (#FFFFFF).
Keep the product exactly as it is in the photo: same shape, same colours,
same label text and logo, same size and proportions.
Soft, even studio light from the front. A small, soft natural shadow
directly under the product. Product centred and fully in frame.
No props, no text, no other objects.

Two tips that save time:

  • Name the white. "White background" often gives a light grey or a cream studio sweep. "Pure white (#FFFFFF)" is clearer.
  • Describe the light, not just the background. Hard light makes harsh shadows that spread onto the white. Our post on describing lighting in AI product image prompts has wording for soft, even light.
Workflow for an AI white-background product photo: start from a real phone photo, ask the AI to replace only the background with pure white and keep the product the same, compare the product with the original, check the edges are 255 white, check the product fills the frame, then upload.
The AI step is only one of five. The checks after it are what make the image usable.

Step 3: Compare the product with the original

Put the original photo and the AI version side by side and zoom in. AI image tools are good at backgrounds and less reliable with small details. Check:

  • Label and logo text. Letters are the first thing to break. If they did, our guide on fixing misspelled text in AI product images shows how to repair it.
  • Colour. Is the red still the same red? A colour shift is a common cause of "item not as described" returns.
  • Shape and proportions. Lids, handles, corners and the number of items in a pack.
  • Edges. Look for a faint halo, a grey outline, or bits of the old background around the product.

If the product changed, don't try to fix it with more prompts on the same image. Go back to the original photo and try again with a stricter "keep the product exactly the same" line.

Step 4: Check the white is really 255, 255, 255

This is the step most people skip. Amazon's product image guide (checked 29 November 2026, US marketplace) says the main image must have a pure white background with RGB values 255, 255, 255. An off-white background of 250 or 252 looks white to your eye on a phone, but it is not the same number.

The script below reads a 10-pixel strip on every edge of your image with ffmpeg (free, from ffmpeg.org) and counts how many of those pixels are not pure white. It needs Node.js and ffmpeg installed. Save it as check-white.mjs:

js
// Usage: node check-white.mjs product.jpg
// Reads a 10-pixel strip on every edge of the image (with ffmpeg)
// and counts how many pixels are not pure white (255, 255, 255).
import { execFileSync } from "node:child_process";

const file = process.argv[2];
if (!file) {
  console.log("Usage: node check-white.mjs <image>");
  process.exit(1);
}

const size = execFileSync("ffprobe", [
  "-v", "error", "-select_streams", "v:0",
  "-show_entries", "stream=width,height", "-of", "csv=p=0", file,
]).toString().trim();
const [w, h] = size.split(",").map(Number);
const band = 10;
const strips = [
  ["top", `crop=${w}:${band}:0:0`],
  ["bottom", `crop=${w}:${band}:0:${h - band}`],
  ["left", `crop=${band}:${h}:0:0`],
  ["right", `crop=${band}:${h}:${w - band}:0`],
];

console.log(`${file}: ${w} x ${h} pixels`);
for (const [name, crop] of strips) {
  const raw = execFileSync("ffmpeg", [
    "-v", "error", "-i", file, "-vf", crop,
    "-frames:v", "1", "-f", "rawvideo", "-pix_fmt", "rgb24", "-",
  ]);
  let notWhite = 0;
  let darkest = 255;
  for (let i = 0; i < raw.length; i += 3) {
    const low = Math.min(raw[i], raw[i + 1], raw[i + 2]);
    if (low < 255) notWhite++;
    if (low < darkest) darkest = low;
  }
  const total = raw.length / 3;
  const pct = ((notWhite / total) * 100).toFixed(1);
  console.log(`${name.padEnd(6)} ${pct}% not pure white (darkest value ${darkest})`);
}

Run it with node check-white.mjs product.jpg. On our off-white test image it printed:

offwhite.jpg: 1200 x 1200 pixels
top    100.0% not pure white (darkest value 252)
bottom 100.0% not pure white (darkest value 252)
left   100.0% not pure white (darkest value 252)
right  100.0% not pure white (darkest value 252)

A good image shows 0.0% and darkest value 255 on all four edges. If the product itself touches an edge, that edge will show a low number, which is fine to ignore, but it also means the product may be cut off (see step 5).

Fix a background that is almost white

If the darkest value is close to 255 (say 245 or higher), this ffmpeg command pushes every value from 245 up to pure white:

bash
ffmpeg -i product.jpg -vf "lutrgb=r='if(gte(val,245),255,val)':g='if(gte(val,245),255,val)':b='if(gte(val,245),255,val)'" -q:v 2 product-white.jpg

After this command our test image passed the check with 0.0% on every edge, as both JPEG and PNG.

Be careful: it changes every very light pixel, including those on the product. A white bottle, a white label or bright highlights can lose detail and blend into the background. Compare the result with the original. For white or very light products, a proper cut-out (background removal) followed by placing the product on a pure white canvas works better than this shortcut.

If the darkest value is much lower (a grey sweep, a visible gradient, or a shadow that spreads to the edges), don't force it with a higher threshold. Ask the AI again for a smaller, softer shadow, or remove the background and place the product on white.

Before and after: an off-white background with value 252 fails the pure white check even though it looks white, while the corrected background with value 255 passes.
Off-white and pure white look the same on a phone. The numbers are different.

Step 5: Check the size and framing

The same Amazon guide lists a few more rules for the main image (checked 29 November 2026): the product should fill 85% of the image, the whole product must be in frame and not cut off, it is shown only once, and there should be no props, text, logos or badges added. Images must be at least 500 pixels on the longest side, and 1,000 pixels or more enables zoom. JPEG is recommended.

Other shops and marketplaces have their own rules, so check the current guide for the one you sell on. As a habit, though, these are good rules for any clean product shot:

  • Fill the frame. Leave a small, even margin. A tiny product in a big white square looks unprofessional in search results.
  • Square is the safe default. It fits most shop grids and catalogue layouts.
  • Export at a decent size. If your AI tool gives a small image, read our guide on upscaling an AI image without making it look fake before you enlarge it.

Photos with AI-generated people

If your product image shows a photorealistic person made entirely by AI (for example a model wearing a watch), Amazon's guide asks sellers to tag the image file with the keyword contains-synthetic-performer in its metadata, so a disclosure can be shown where required. This does not apply to plain product shots with no people. Other platforms have their own labelling rules; our post on labelling AI content on Instagram, TikTok and YouTube covers the social side.

From one white shot to a full set

A clean white-background image is the base for everything else: lifestyle scenes, ad images and short product videos all start from a good, accurate picture of the product. Building that full set for a real product, and turning it into a video ad, is one of the projects in our AI Content Creator Program.

Frequently asked questions

Can I just ask the AI for a pure white background and skip the check?

You can ask, but you can't trust it. Image models generate pixels that look right; they don't guarantee exact colour values. In our test an image that looked white had a value of 252 on every edge. The check takes seconds, so run it on every image you upload to a marketplace.

Why does my white background turn grey after I save it?

Usually it was never pure white, or the file was saved with heavy compression or a colour profile that shifts the values. Save in RGB, use high-quality JPEG or PNG, and run the check again on the final file, not the one before export.

Is it allowed to sell with AI-edited product photos?

Editing the background of a real product photo is normal product photography work. What matters is that the image accurately shows the real product: its colour, size, quantity and what is included. Each marketplace has its own image rules, so read the current guide for the one you use. Amazon's is linked above.

What if my product is white?

Use a background-removal cut-out and place it on pure white, and keep a very soft shadow under the product so its edges stay visible. Avoid the "push light values to 255" command above, because it will also whiten the product.

  • #ai product photo
  • #white background
  • #product photography
  • #amazon main image
  • #ecommerce
  • #ffmpeg

Share this guide

Want to learn AI video properly?

The AI Content Creator Program takes you from your first prompt to a portfolio you can show: 27 short, focused lessons in easy Urdu, with a weekly live session and tasks our team reviews.

Enroll now

Keep learning