localize_image
Localize an image in place by replacing its on-image text with translations.
Keeps every non-text element (layout, colours, graphics) intact and
re-renders the original text with the provided translations. Pair with
`extract_image_text` (to get the source strings) and `translate` (to
translate them with TM and brand voice) for a full image localization flow.
The localized image is saved to disk and the file path is returned — the
raw image bytes are not sent back to the model. Hosted mode returns a
download URL instead of writing to a local path.
Args:
image_path: Public HTTPS URL (hosted) or local path (stdio) to a PNG, JPEG, or WebP image to localize.
replacements: JSON array of {"original": "...", "translated": "..."} pairs,
e.g. '[{"original": "Buy now", "translated": "Achetez maintenant"}]'.
target_language_code: Target language code (e.g. "fr-FR"), used for labelling output.
output_path: Optional path to write the localized image to. Defaults to
"<input>.<lang>.<format>" next to the source image.
num_images: Number of variants to generate (1-5, default 1).
output_format: Output format — png, jpeg, or webp (default png).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image_path": "<image_path>",
"replacements": "<replacements>",
"target_language_code": "<target_language_code>"
},
"name": "localize_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image_path | Yes | Public HTTPS URL (hosted) or local path (stdio) to a PNG, JPEG, or WebP image to localize. | |
| num_images | No | Number of variants to generate (1-5, default 1). | |
| output_path | No | Optional path to write the localized image to. Defaults to "<input>.<lang>.<format>" next to the source image. | |
| replacements | Yes | JSON array of {"original": "...", "translated": "..."} pairs, e.g. '[{"original": "Buy now", "translated": "Achetez maintenant"}]'. | |
| output_format | No | Output format — png, jpeg, or webp (default png). | png |
| target_language_code | Yes | Target language code (e.g. "fr-FR"), used for labelling output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |