Edit image
image_editEdit images: resize, compress, convert, strip metadata, or remove background. Returns real output dimensions and byte size.
Instructions
Resize, compress, convert (jpeg, png, webp), strip metadata (EXIF, GPS, XMP) or remove the background from an image. strip_metadata never re-encodes pixels. remove_background downloads a 4.4MB model once per machine and always writes PNG. Returns the real output dimensions and byte size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| out | No | ||
| path | Yes | Absolute path of the source image. Relative paths are refused | |
| width | No | resize: give width or height alone to keep the aspect ratio | |
| format | No | convert: target format. Others: default keeps the source format | |
| height | No | ||
| quality | No | compress, convert, resize: 1-100. Default 85 (compress 75) | |
| background | No | remove_background: fill colour behind the subject, for example #ffffff. Default transparent |