Media
Extend image canvas with solid color background, perfect for product photos, social media content, and standardizing image dimensions
Call this tool from your code in three languages.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/image-extend-background' \
-F 'file=@/path/to/imageFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/en/api/tools/image-extend-background' \
-F 'imageFile=/path/to/file.ext' \
-F 'extendMode=uniform' \
-F 'backgroundColor=#ffffff' \
-F 'uniformPadding=50' \
-F 'topPadding=0' \
-F 'rightPadding=0' \
-F 'bottomPadding=0' \
-F 'leftPadding=0' \
-F 'format=original' \
-F 'quality=90'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/image-extend-background| Name | Type | Required | Description |
|---|---|---|---|
| imageFile | fileupload required | Yes | Upload any image file (JPEG, PNG, WebP, TIFF, GIF, BMP) |
| extendMode | select | Yes | Choose how to extend the image canvas |
| backgroundColor | color | No | Background color for the extended area (default: white) |
| uniformPadding | number | No | Padding to add on all sides when using uniform mode |
| topPadding | number | No | Padding to add to the top edge |
| rightPadding | number | No | Padding to add to the right edge |
| bottomPadding | number | No | Padding to add to the bottom edge |
| leftPadding | number | No | Padding to add to the left edge |
| 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 result
{
"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)"
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-image-extend-background": {
"name": "image-extend-background",
"description": "Extend image canvas with solid color background, perfect for product photos, social media content, and standardizing image dimensions",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=image-extend-background",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "image-extend-background",
"arguments": {
"imageFile": "https://example.com/file.ext",
"extendMode": "uniform",
"backgroundColor": "#ffffff",
"uniformPadding": 50,
"topPadding": 0,
"rightPadding": 0,
"bottomPadding": 0,
"leftPadding": 0,
"format": "original",
"quality": 90
}
}
}Questions or issues? Contact [email protected]