Edit image (ChatGPT)
edit_imageEdit existing images with ChatGPT's image generator to change backgrounds, colors, or objects; preserve the original file and save each result as a new file.
Instructions
Edit an existing image with ChatGPT's image generator (e.g. change background or colors, remove or add objects), through the ChatGPT/Codex app installed on this machine. The original file is never modified: the result is saved as a new file.
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": {
"prompt": "<prompt>",
"image_path": "<image_path>"
},
"name": "edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of variants to generate. | |
| prompt | Yes | What to change. Also state what must stay the same. | |
| filename | No | Base file name without extension (e.g. 'hero-banner'). Default: timestamp. | |
| image_path | Yes | Absolute path of the image to edit (png, jpg, webp). | |
| output_dir | No | Absolute directory to save files in. Default: /root/Pictures/chatgpt-images | |
| orientation | No | Image orientation. | auto |
| transparent | No | Transparent background (PNG with alpha). | |
| extra_images | No | Additional supporting images, e.g. an object or logo to insert (optional). | |
| include_preview | No | If true, also return the image so the assistant can see it. |