Categories

Image Trim

Trim image borders by removing unwanted edges and margins automatically

Click to upload file or drag and drop file here

Maximum file size: 10MB Supported formats: image/jpeg, image/png, image/webp, image/tiff

Upload any image file (JPEG, PNG, WebP, TIFF) for trimming

Choose what type of borders to trim from the image

Color to treat as background (for custom trim mode)

1 40 255

Threshold for determining background pixels (1-255). Lower = more sensitive

Choose output format or keep original

Output quality for lossy formats (JPEG, WebP). Higher = better quality but larger file size

API Documentation

Request Endpoint

POST /en/api/tools/image-trim

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes Upload any image file (JPEG, PNG, WebP, TIFF) for trimming
trimMode select Yes Choose what type of borders to trim from the image
background color No Color to treat as background (for custom trim mode)
threshold range No Threshold for determining background pixels (1-255). Lower = more sensitive
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 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)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-image-trim": {
      "name": "image-trim",
      "description": "Trim image borders by removing unwanted edges and margins automatically",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-trim",
      "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]