Convert or resize an image file
convert_image_fileConverts image files to PNG, JPEG, TIFF, BMP, WebP or TGA and resizes them to prepare oversized or unsupported stills for Premiere Pro import.
Instructions
Write an image file in another format and/or size: PNG, JPEG, TIFF, BMP, WebP or TGA, chosen by the extension of output_path. Give width or height to resize keeping the aspect ratio, or both together with fit. Use it to make an oversized still lighter before importing, or to convert a format Premiere does not read. Returns the new file's format, width, height and size, and the source's size. Given a video file it converts the first frame (extract_frame_from_file picks any frame). Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.
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": {
"path": "<path>",
"output_path": "<output_path>"
},
"name": "convert_image_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | Only when both width and height are given. "contain" (default): fit inside the box, aspect kept, result may be smaller in one direction. "cover": fill the box and crop the excess. "stretch": exactly width x height, aspect ignored. | |
| path | Yes | Absolute path of the source image. | |
| width | No | Target width in pixels. Alone: the height follows the aspect ratio. Omit both width and height to keep the size. | |
| height | No | Target height in pixels. Alone: the width follows the aspect ratio. Omit both width and height to keep the size. | |
| quality | No | Quality 1-100 for JPEG and WebP. Default 90. | |
| overwrite | No | Replace output_path if it already exists. Default false: an existing file makes the tool fail with FILE_EXISTS. | |
| output_path | Yes | Absolute path of the image to write (must differ from path): .png, .jpg, .jpeg, .tif, .tiff, .bmp, .webp or .tga. | |
| timeout_seconds | No | Stop ffmpeg and fail with TIMEOUT after this many seconds. Default 120. |