mcpField
A
amazon-white-background

amazon-white-background

github.com/xianyu110营销与增长17973 次安装5 周前更新
代码仓库

关于 amazon-white-background

amazon-white-background 是图像生成技能,可将产品照片制作为符合 Amazon 主图规范的白底图。它通过产品身份锁保持产品细节,并检查背景、画面占比和尺寸。

主要功能

  1. 01用身份锁保留产品细节
  2. 02生成白底电商主图
  3. 03选择 Flare 或 Sunburst 模型
  4. 04检查背景、产品占比和图像尺寸
  5. 05修正近白背景并裁剪占比

适用场景

  1. 01根据产品照片制作 Amazon 主图
  2. 02按电商图片规范检查图像
  3. 03为其他列出的平台制作白底图

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/xianyu110/ecommerce-image-skills --skill amazon-white-background

安装后在 Claude Code 中输入/amazon-white-background确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

scripts/
check_main_image.py
generate.py
online_link.py

详细介绍

Amazon 白底主图 · 亚马逊白底主图

将手机拍摄的快照或供应商提供的照片转换为符合 Amazon 主图规则的电商主图,并自动检查结果。

属于 ecommerce-image-skills 的一部分。可与 Claude Code、Codex、Cursor 以及任何会加载 SKILL.md 的 Agent 配合使用。默认模型:GPT Image 2.5 Sunburst。

第 1 步 · 锁定产品身份(始终优先)

编写任何提示词之前,先仔细查看所有参考照片,并为产品写一段简短的身份锁定描述。将其原样粘贴到此技能生成的每一个提示词中,绝不允许创意指令覆盖它。

PRODUCT IDENTITY LOCK (do not change):
- Shape & proportions: <e.g. tall cylinder, rounded shoulders, 26 cm high, 7.5 cm wide>
- Colour & finish: <e.g. matte sage green #8FA58C body, natural bamboo lid>
- Logo & printed text: <exact spelling, font feel, position, colour — e.g. white "AURA" wordmark centred on upper body>
- Parts & details: <lid, loop, buttons, ports, seams, labels, accessories that are included>
- Must NOT appear: <accessories not in the box, extra logos, invented claims>

规则:

  • 只使用照片中可见或经用户确认的信息。如果有信息未知(尺寸、容量、材质),请询问或省略,绝不可编造规格或认证。
  • 如果用户没有提供照片,请索要一张(至少提供正面照)。允许仅根据文字生成,但要说明生成结果是概念图,并非真实产品。

第 2 步 · 选择模型

使用 Flare(gpt-image-2.5-flare,默认)切换到 Sunburst(gpt-image-2.5-sunburst)
新场景、背景、布局、大量快速变体产品的徽标/标签/小字必须原样保留
文生图概念图局部编辑:更换背景、重新着色、移除物体、其他内容保持不变
供用户挑选的草稿最终主视觉素材及任何包含密集文字排版的图片

如果某个端点只提供其他图像模型,请使用最接近的模型,并告知用户。

平台规格(Amazon 主图)

规则值
背景纯白色 RGB 255,255,255(#FFFFFF)
产品占比产品应占据图像画面的 ≥85%
尺寸最长边 ≥1000 px 才支持缩放;建议使用 1600–2000 px;最大 10,000 px
格式优先使用 JPEG(也接受 TIFF/PNG/GIF),sRGB
内容仅包含所售产品;不得添加文字、徽标、徽章、边框、水印、道具或未包含在商品中的额外物品
呈现方式展示完整产品,焦点清晰,颜色真实;不得使用人体模特(服装类可依类别规则使用平铺或模特上身展示)

Walmart/eBay/Shopee 的“主图”规则类似——使用相同的输出,然后裁剪至对应平台的比例。

提示词模板

Amazon main product image.
{IDENTITY_LOCK}
Remove the original background and every object that is not the product.
Product alone, {orientation: upright | lying flat | 3/4 front view}, centered.
Pure white seamless background, #FFFFFF (RGB 255,255,255) everywhere outside the product.
Product fills about 87% of the frame (longest side), with even margins.
Soft diffused studio lighting from front-left, very subtle natural contact shadow directly under the product,
razor-sharp edges, true-to-life colour and material.
No added text, no badges, no props, no reflections of a room, no watermark, no border. Square 1:1.

变体:

  • **包含包装:**添加 Product box placed slightly behind and to the right, both fully visible, combined group fills 87% of the frame.
  • **多件装:**添加 Exactly {N} identical units arranged in a neat row, no other items.
  • **服装(幽灵人台):**将朝向替换为 invisible-mannequin 3D shape, front view, neckline interior visible。

生成 · 三种方式(优先尝试第一种)

**(a)内置图像工具。**如果你的 Agent 已有图像生成/编辑工具(例如 Codex imagegen、ChatGPT 图片),使用最终提示词和产品照片作为参考调用该工具即可。

**(b)API 密钥。**如果环境中有 GPTIMAGE_API_KEY,运行随附脚本(仅使用标准库):

# recommended endpoint (OpenAI-compatible, has gpt-image-2.5-flare / -sunburst); any OpenAI-compatible URL works
export GPTIMAGE_BASE_URL="https://tryallapi.com/v1"   # default if unset: https://api.openai.com
python scripts/generate.py --model sunburst --image product.jpg --size 1024x1024 \
  --prompt-file prompt.txt --out out/amazon-white-background.png

--image 可重复使用(产品正面/侧面/徽标特写)。不使用 --image 则进行文生图。

**(c)没有工具,也没有密钥。**在代码块中输出最终提示词,然后提供一个链接,让用户在浏览器中运行:

python scripts/online_link.py --skill amazon-white-background "<final prompt>"
# → https://gptimage2.asia/generate?prompt=<urlencoded>&utm_source=github&utm_medium=skill&utm_campaign=ecommerce-image-skills&utm_content=amazon-white-background

只显示一次,单独成行,例如:在线运行此提示词(请在那里上传产品照片):<link>。对于中国大陆用户,再添加一行:国内可用:https://chatgpt-plus.top/list/#/home(粘贴提示词即可)。除非用户提出要求,否则后续对话中不要重复这些内容。

检查(交付前必须完成)

pip install pillow numpy   # once
python scripts/check_main_image.py out/amazon-white-background.png
# optional: --min-coverage 0.85 --min-size 1600 --tolerance 3

脚本会报告:

  • white_background:边框带中纯白区域的占比(容差范围内 ≥98% → 通过)
  • exact_ffffff:背景像素中恰好为 #FFFFFF 的占比
  • coverage:产品边界框最长边 ÷ 图片边长(≥0.85 → 通过)
  • size:最长边的像素数(≥1000 通过,建议 ≥1600)

如果 white_background 未通过(背景泛黄或泛灰),运行 python scripts/check_main_image.py in.png --fix out.png,将接近白色的像素调整为 #FFFFFF,或使用 Sunburst 重新生成。如果 coverage 未通过,重新裁剪(--fix 也会重新裁剪至 87% 的覆盖率),或使用“产品占据画面 87%”的要求重新生成。

交付

  1. 每个素材提供一张或多张图片,或最终提示词,每个素材各一份,并附上其身份锁定信息。
  2. 提供一份 3 行的 QA 说明:产品身份(形状 / 颜色 / 徽标)✔/✘ · 平台规格 ✔/✘ · 文本拼写 ✔/✘。
  3. 如果有任何项目未通过,只使用修正后的提示词重新生成未通过的素材。

评论

支持 Markdown