compress_image
Reduce image file size by compressing and optionally resizing images to specified dimensions. Supports JPEG, WebP, and PNG formats for optimized storage and faster loading.
Instructions
Compress an image to reduce file size.
Optionally resize to max dimensions while compressing. Works best with JPEG and WebP. PNG files will be converted to optimized PNG.
Args: path: Absolute path to the image file. quality: Compression quality (1-100, lower = smaller file). Default 60. max_width: Optional maximum width. Image will be downscaled if wider. max_height: Optional maximum height. Image will be downscaled if taller. output_path: Where to save. Defaults to _compressed..
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| quality | No | ||
| max_width | No | ||
| max_height | No | ||
| output_path | No |