compare_images
Compare two local images pixel by pixel, identifying differences and generating a diff image with detailed statistics.
Instructions
Compare two local image files pixel by pixel. Supports PNG and JPEG formats. Returns the number of different pixels, percentage difference, and generates a diff image showing the differences.
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": {
"image1_path": "<image1_path>",
"image2_path": "<image2_path>"
},
"name": "compare_images"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeAA | No | Optional: If true, include anti-aliased pixels in the diff. Default: false | |
| threshold | No | Optional: Matching threshold (0-1). Lower values are more sensitive. Default: 0.1 | |
| image1_path | Yes | Absolute or relative path to the first image file | |
| image2_path | Yes | Absolute or relative path to the second image file | |
| diff_output_path | No | Optional: Path where the diff image will be saved. If not provided, a timestamped file will be created in the current directory. |