Replace an image
replace_imageReplace an existing image in Google Slides with a new one from URL or local file, keeping its frame, position, and effects. Choose center_inside or center_crop to fit or fill the frame.
Instructions
Swaps the bitmap of an existing image element while keeping its frame, position and effects (batchUpdate replaceImage). The new picture comes from image_url or image_path with exactly the same validation/upload/cleanup rules as create_image. replace_method: center_inside (default — scales to fit inside the frame, keeping aspect) or center_crop (fills the frame, cropping the overflow).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image_url | No | Public https URL of the new PNG/JPEG/GIF (exactly one of image_url / image_path). | |
| image_path | No | Absolute local path of the new image (exactly one of image_url / image_path). | |
| replace_method | No | How the new image fills the old frame (default center_inside). | |
| image_object_id | Yes | The existing image element's object id (type "image" in list_slides). | |
| presentation_id | Yes | The presentation id — the long id from the URL (docs.google.com/presentation/d/<presentationId>/edit) or from create_presentation output. |