---
name: eggapi-listing-localize
description: Localize existing product listing images for other markets with EggAPI - translate the text on every image, adapt people and settings to the target market where wanted, and export each image at the exact pixel size each marketplace asks for. Use when the user sells cross-border and wants listing, detail-page, A+ or ad images in another language or for another marketplace (跨境、多语言商品图、图片翻译、套图本地化、亚马逊多站点).
---

# Listing image localization

Take a finished set of product images and make versions for other markets: translated text, optionally local people and settings, at each marketplace's size. The product itself never changes. Reply in the user's language. Write model prompts in English; put any text that should appear in an image in quotes, in its target language.

## EggAPI basics

This skill uses the EggAPI MCP server, usually added under the name `eggapi`: `list_models`, `generate_image`, `generate_video` and `get_task` (in Claude Code they show up as `mcp__eggapi__*`). If these tools are missing, stop and send the user to https://eggapi.ai/connect to add the server.

- **Models.** Call `list_models` once at the start. Use the model IDs this skill names when they are listed; otherwise pick the closest model with the same `generation_type`. `unit_price_usd` is the price per image, or per second of video; `unit_price_by_resolution` overrides it for a given `resolution`.
- **Local files.** The generate tools only accept public `http(s)` URLs. Upload local files first (up to 20 MB per image):

  ```bash
  curl -sS https://api.eggapi.ai/v1/uploads \
    -H "Authorization: Bearer $EGGAPI_API_KEY" \
    -F "files[]=@./photo-1.jpg" -F "files[]=@./photo-2.jpg"
  ```

  The URLs are in `data.files[].url`. If `EGGAPI_API_KEY` is empty in the shell, ask the user to export it; never ask for the key in the chat. Uploaded files can be opened by anyone who has the URL, so say so before uploading anything private.
- **Tasks are async.** `generate_image` and `generate_video` return a `task_id` at once. Submit every independent task first, then poll `get_task` for each until `done` is true: every 5-10 s for images, 10-15 s for videos (usually 1-3 min). If a generate call already returns `urls`, no polling is needed.
- **Always pass** `aspect_ratio` (the default is 16:9) and, for video, `duration` (4-15 s). Supported ratios: `1:1`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9`.
- **Edit models return one image per call.** For more variants, call again; `num_outputs` only applies to text-to-image models.
- **Output URLs work as inputs.** Pass a finished image's URL straight into the next edit or video call; no re-upload needed.
- **Save everything.** Download each output as soon as its task completes, into `eggapi-output/<project>/` under the current directory, with `curl -sSL -o <file> <url>`: some output links expire after 24 hours, and some file hosts reject other HTTP clients. Keep the extension from the URL and use descriptive file names.
- **Cost.** Show the plan with an estimated cost before generating and wait for a go-ahead, unless the user already said to go ahead. At the end, report each task's `cost` and the total.
- **Errors.** `insufficient balance`: ask the user to top up at https://eggapi.ai/dashboard. `temporarily unavailable`: switch to another model of the same type. A `failed` task: read `error`, adjust the prompt if it points at the content, and retry once.

## 1. Collect the inputs

Ask only for what is missing:

- **Source images**: a folder or a list of files or URLs. Work through the whole set.
- **Target markets**: language and marketplace for each, for example German for Amazon.de, Japanese for Rakuten, Spanish for Mercado Libre.
- **How far to localize**: text only (default), or also people and settings for lifestyle images.
- **Words that stay as they are**: brand, product name, model numbers. Ask whether measurements should be converted, for example cm to inches for the US.
- **Exact pixel sizes**, if the marketplace or the user's agency requires them.

## 2. Read the images and write the copy

If you can view images, open each one and write down every piece of text and where it sits. If you cannot, ask the user for the text.

Write a translation table: file, original text, translation for each language, notes. Write marketing copy, not a word-for-word translation, and keep it as short as the original: German and French often run 20-30% longer, so tighten them. Keep every claim exactly as strong as the original and never add one; claims on listing images are regulated in most markets.

Show the table and the plan (images x languages x image price) and wait. Users or native speakers often fix wording here.

## 3. Generate

Upload the source images. Keep each image's aspect ratio (use the closest supported ratio) and use `resolution: "2k"`.

**Text only.** `openai/gpt-image-2/edit`, which renders text well and takes one input image:

> Replace the text in this image with the following {language} text, keeping the same position, size, font style, weight and color: "{original 1}" becomes "{translation 1}"; "{original 2}" becomes "{translation 2}". Change nothing else: the product, layout, background, people and colors stay exactly the same.

If GPT Image 2 changes the product or the layout, use `google/nano-banana-pro/edit` with the same prompt.

**People and settings too.** `google/nano-banana-pro/edit` with the source image, plus the original product photos if the user has them (8 images at most):

> Keep the product exactly as in the reference images: same shape, colors, logo and label text. Replace the people with {market} people of a similar age and style, and make the setting a typical {market} {home, street, office}. Keep the composition, camera angle, lighting and the text layout. Text: "{translation}".

Never translate text printed on the product or its packaging: that is the real product the buyer receives.

## 4. Check

If you can view images, compare every output with its source: the product is unchanged, every string is present and spelled exactly as in the table, no source-language text is left, nothing overflows or is cut off. Regenerate once with the problem named. If the text is still wrong, list the file for the user to fix in a design tool.

Recommend that a native speaker reads the final images before they go live.

## 5. Export at exact sizes

Models return fixed sizes per aspect ratio, so marketplaces with pixel rules need a final resize. Ask for the sizes the user's marketplace requires today; common ones are 2000 x 2000 for Amazon listing images (zoom needs at least 1000 px), 970 x 600 for an Amazon A+ header image, and 800 x 800 for Taobao and Tmall main images.

With ImageMagick (`magick -version`):

```bash
# Fill the exact size, cropping the overflow
magick in.png -resize 2000x2000^ -gravity center -extent 2000x2000 -quality 92 out.jpg
# Fit inside the size and pad with white (main images on white)
magick in.png -resize 2000x2000 -background white -gravity center -extent 2000x2000 -quality 92 out.jpg
```

On macOS without ImageMagick, `sips` can fit and pad:

```bash
sips -Z 2000 in.png --out fit.png && sips -p 2000 2000 --padColor FFFFFF fit.png --out out.png
```

Without either tool, deliver the images at the model's size and say which ones still need resizing.

## 6. Deliver

Save to `eggapi-output/<project>/<market>/`, keeping the source file names with a market suffix, such as `main-de.jpg` or `scene-kitchen-ja.jpg`. Write `translations.csv` with the columns `file,market,language,original,translation`. List the files per market with their cost, then the total.
