Amazon White-Background Main Image Skill
Turn a product photo into an Amazon main image on pure white, then check background, product coverage and size with a script. Inputs, example, permissions and limits.
- Author
- xianyu110
- License
- MIT
- Verification
- Source reviewed
- Last verified
- 2026-10-13
What it does
amazon-white-background is one of twelve image Skills in xianyu110's ecommerce-image-skills pack. It turns a phone snapshot or supplier photo into a square main image on a pure white background, then measures the result with a bundled Python script.
Two things separate it from a prompt collection. It starts by writing a product identity lock: shape, colour, logo text, included parts, and what must not appear. That block is pasted into every prompt so the generated product stays the one you sell. Then check_main_image.py reports three numbers: how white the border is, how much of the frame the product fills, and the longest side in pixels.
When to use
Use it when you have a real product photo and need a main image that meets the marketplace's white-background rule. It is the wrong starting point when you have no photo: the Skill allows text-only generation but tells the agent to label that result a concept, not the real product. For planning a whole image set rather than producing one image, see Amazon Listing Images.
Inputs
At least one product photo, front view at minimum; more angles and a logo close-up help. Any fact the photo does not show (size, capacity, material) has to come from you. The source tells the agent to ask or leave it out, never to invent specs or certifications.
Outputs
A 1:1 image and the check report. The script passes an image when at least 98% of the outer 2% border is within a small tolerance of #FFFFFF, the product spans at least 85% of the frame on its longest side, and the longest image side is at least 1000 px. It also reports how much of the background is exactly 255,255,255. An optional --fix snaps near-white pixels to pure white and re-crops so the product covers about 87%.
Example workflow
Demonstration only; not run. These values are invented to show how the report reads. No image was generated.
input_photo: phone-snapshot.jpg
identity_lock:
shape: tall cylinder, rounded shoulders
colour: matte sage green body, bamboo lid
logo: white wordmark centred on the upper body
must_not_appear: accessories not in the box, extra logos
check_main_image:
width: 1600
height: 1600
white_background: 0.994
coverage: 0.81
result: coverage below 0.85Here the background passes and the size is fine, but the product fills 81% of the frame, under the 85% threshold. The next step would be the script's --fix option, or a new generation with the product larger in frame. A pass on these checks covers background, coverage and size only. It says nothing about whether the product in the image still matches the real one.
Supported agents and setup
The source names Claude Code, Codex, Cursor, and any agent that loads SKILL.md. Evidence reviewed on 2026-10-13 at commit f4566fd: the pinned SKILL.md, scripts/check_main_image.py, scripts/generate.py, scripts/online_link.py, the plugin manifest, and the MIT LICENSE. The other eleven Skills in the pack were not read in full. This page is source-reviewed, not install-tested, and shows no install command.
Account, API, and permission requirements
The Skill offers three ways to produce the image, and they send your data to different places:
- The agent's own image tool. Nothing beyond what your agent already does.
- An API key.
generate.pyreadsGPTIMAGE_API_KEYand posts the prompt and your product photos toGPTIMAGE_BASE_URL. The default ishttps://api.openai.com. The source recommends a third-party gateway instead; if you set that, your photos and key go to that gateway. - A browser link.
online_link.pybuilds a URL to the author's own image site with your full prompt in the query string, plus campaign tags. Opening it sends the prompt text to that site.
The check script runs locally and needs pillow and numpy. No key from this site is involved.
Limits and human review boundary
The repository promotes the author's own services throughout, so decide which route you use before the agent picks one. Image models can redraw a logo or change a proportion while still producing a clean white background; compare the result with the real product before uploading. The rule values in the Skill are the author's summary of marketplace requirements as of the reviewed commit. Check the current category rules yourself, since apparel and some other categories differ. We have not generated an image with this Skill.
Pair with Ecommerce Data API
The identity lock needs facts, and a listing already live is a source for them. amazon.products.details returns a product's title, brand, feature bullets, dimensions and main image URL, which you can check against your photo before writing the lock. amazon.products.competitors returns similar products for an ASIN, so you can see how the main images you will sit beside are framed. See the product details docs and competitor docs, then create an Ecommerce Data API key if you want that context. The data describes public listings. It does not generate or judge images, and the Skill works without it.