Image Trim with Tolerance
Advanced image trimming with configurable tolerance levels for precise border removal
API Documentation
Request Endpoint
Request Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| imageFile | file (Upload required) | Yes | Upload any image file (JPEG, PNG, WebP, TIFF) for advanced tolerance trimming |
| toleranceMode | select | Yes | How to calculate color tolerance for background detection |
| toleranceValue | range | No | Tolerance for background detection. Higher = more pixels considered background |
| autoDetectBackground | checkbox | No | Analyze image edges to automatically determine the background color |
| backgroundColor | color | No | Specific background color to trim (disables auto-detection) |
| scanMethod | select | No | How to scan the image for content boundaries |
| edgeSampling | checkbox | No | Add padding proportional to tolerance to avoid cutting off edge content |
| analyzeOnly | checkbox | No | Analyze tolerance settings without trimming the image |
| format | select | No | Choose output format or keep original |
| quality | number | No | Output quality for lossy formats (JPEG, WebP). Higher = better quality but larger file size |
File type parameters need to be uploaded first via POST /upload/image-trim-tolerance to get filePath, then pass filePath to the corresponding file field.
Response Format
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}
AI MCP Documentation
Add this tool to your MCP server configuration:
{
"mcpServers": {
"elysiatools-image-trim-tolerance": {
"name": "image-trim-tolerance",
"description": "Advanced image trimming with configurable tolerance levels for precise border removal",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-trim-tolerance",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.
Supports URL file links or Base64 encoding for file parameters.
If you encounter any issues, please contact us at [email protected]