compress_local_image
Reduce image file size by compressing local images while maintaining quality. Specify input and output paths, choose format, and optionally preserve metadata.
Instructions
Compress a local image file
Input Schema
Name | Required | Description | Default |
---|---|---|---|
imagePath | Yes | The ABSOLUTE path to the image file to compress | |
outputFormat | No | The format to save the compressed image file | |
outputPath | No | The ABSOLUTE path to save the compressed image file | |
preserveMetadata | No | The metadata to preserve in the image file |
Input Schema (JSON Schema)
{
"properties": {
"imagePath": {
"description": "The ABSOLUTE path to the image file to compress",
"example": "/Users/user/Downloads/image.jpg",
"type": "string"
},
"outputFormat": {
"description": "The format to save the compressed image file",
"enum": [
"image/jpeg",
"image/png",
"image/webp",
"image/jpg",
"image/avif"
],
"example": "image/jpeg",
"type": "string"
},
"outputPath": {
"description": "The ABSOLUTE path to save the compressed image file",
"example": "/Users/user/Downloads/image_compressed.jpg",
"type": "string"
},
"preserveMetadata": {
"description": "The metadata to preserve in the image file",
"items": {
"enum": [
"copyright",
"creation",
"location"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"imagePath"
],
"type": "object"
}