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

Key Facts

Category
Design
Input Types
file, select, color, range, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Image Trim is a professional utility designed to automatically detect and remove unwanted borders, margins, or empty space from your images, ensuring your visual content is perfectly framed.

When to Use

  • Removing excess white space from scanned documents or screenshots.
  • Cleaning up transparent backgrounds around product photography.
  • Standardizing image dimensions by stripping away inconsistent border widths.

How It Works

  • Upload your image file (JPEG, PNG, WebP, or TIFF) to the tool.
  • Select a trim mode, such as Auto-detect, Transparent, or specific color-based removal.
  • Adjust the sensitivity threshold if necessary to fine-tune border detection.
  • Download your perfectly cropped image in your preferred format and quality.

Use Cases

Preparing e-commerce product images by removing distracting white margins.
Cropping screenshots to focus only on the relevant application window.
Batch-processing scanned documents to remove empty page borders.

Examples

1. Clean Product Photography

E-commerce Manager
Background
A collection of product photos features inconsistent white margins, making the catalog look unprofessional.
Problem
Manually cropping dozens of images is inefficient and prone to alignment errors.
How to Use
Upload the product image, select 'White borders' mode, and set the output format to PNG.
Example Config
trimMode: white, format: png
Outcome
The tool automatically strips the white margins, leaving only the product centered with a transparent background.

2. Screenshot Cleanup

Technical Writer
Background
Screenshots taken for documentation include large areas of desktop wallpaper or empty browser space.
Problem
The images contain too much noise, distracting the reader from the UI elements.
How to Use
Upload the screenshot, use 'Auto-detect' mode, and adjust the threshold to 30 for precise edge detection.
Example Config
trimMode: auto, threshold: 30
Outcome
The tool removes the excess desktop space, providing a clean, focused image for the documentation.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What file formats are supported?

You can upload JPEG, PNG, WebP, and TIFF files for processing.

How does the 'Auto-detect' mode work?

The tool analyzes the pixel data at the edges of your image to identify and crop out uniform background areas.

Can I remove custom-colored borders?

Yes, select the 'Custom color' mode and use the color picker to define the specific background shade you wish to remove.

What does the 'Trim Threshold' setting do?

It controls the sensitivity of the detection. A lower value is more sensitive, helping to detect subtle variations in background colors.

Will I lose image quality during the process?

If you choose to keep the original format, the image remains unchanged. If you convert to a lossy format like JPEG or WebP, you can adjust the quality slider to balance file size and visual clarity.

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]