Batch Image Trim

Trim multiple images simultaneously using various trimming methods with batch processing and ZIP output

Click to upload files or drag and drop files here

Maximum file size: 50MB Maximum files: 20
Supported formats: image/jpeg, image/jpg, image/png, image/webp, image/tiff

Background color to trim for color-based method

Auto-detect background color for color/tolerance methods

0 40 100

Tolerance for border detection (0-100)

128 240 255

Sensitivity for whitespace detection (128-255)

Key Facts

Category
Images, Audio & Video
Input Types
file, select, color, checkbox, range, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Batch Image Trim allows you to upload up to 20 images in JPEG, PNG, WebP, or TIFF formats and automatically crop out unwanted borders, solid background colors, or excess whitespace. With flexible trimming methods like auto-detection, color-based trimming, and tolerance adjustments, you can clean up product photos or scanned documents in bulk and download the results in a single ZIP archive.

When to Use

  • When you need to remove solid white or transparent borders from a batch of product images for an e-commerce catalog.
  • When cleaning up scanned documents or digital sketches by stripping away excess outer whitespace.
  • When preparing a gallery of graphics where consistent framing is required by trimming custom background colors to the edge of the subject.

How It Works

  • Upload up to 20 images (JPEG, PNG, WebP, or TIFF) into the file selector.
  • Select your preferred trimming method, such as auto-detecting borders, removing whitespace, or targeting a specific background color.
  • Adjust parameters like trim tolerance, whitespace sensitivity, output format, and quality settings.
  • Process the images and download the trimmed results as a packaged ZIP archive or individual files.

Use Cases

E-commerce product photo optimization by stripping empty margins to maximize product visibility.
Preparing scanned comic book pages or sketches by removing uneven paper borders.
Cleaning up UI screenshots by trimming solid background colors around application windows.

Examples

1. Trimming White Borders from E-commerce Product Photos

E-commerce Store Manager
Background
A batch of 15 product photos has inconsistent white margins, making the products look small and misaligned on the website.
Problem
Quickly remove the excess white borders from all 15 PNG images without manual cropping.
How to Use
Upload the 15 PNG files, select 'Remove Whitespace' as the Trim Method, set the Whitespace Sensitivity to 245, choose PNG as the output format, and click process.
Example Config
Trim Method: Remove Whitespace, Sensitivity: 245, Output Format: PNG, Create ZIP Archive: Enabled
Outcome
All 15 images are cropped tightly to the product boundaries and downloaded in a single ZIP file, ready for upload.

2. Batch Cleaning Scanned Document Margins

Digital Archivist
Background
A set of scanned historical documents has dark, uneven borders from the scanner bed.
Problem
Remove the dark borders automatically across 10 TIFF scans to make the text clean and readable.
How to Use
Upload the TIFF files, select 'Tolerance-based Trim', enable 'Auto-detect Background', set the Trim Tolerance to 50, and set the output format to JPEG with 90% quality.
Example Config
Trim Method: Tolerance-based Trim, Auto-detect Background: True, Trim Tolerance: 50, Output Format: JPEG, Quality: 90
Outcome
The dark scanner borders are automatically detected and trimmed, resulting in clean, cropped JPEG documents.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What image formats are supported for batch trimming?

You can upload JPEG, JPG, PNG, WebP, and TIFF images up to 50MB in total size.

How does the tolerance-based trimming method work?

It detects and removes background pixels that are similar to the border color within a specified sensitivity range from 0 to 100.

Can I preserve the original metadata of my images?

Yes, check the 'Preserve Metadata' option to keep EXIF and other metadata in the output files.

What is the difference between auto-detect and color-based trimming?

Auto-detect automatically identifies the outer border color, while color-based trimming lets you specify a precise background color to remove.

Do I have to download the trimmed images one by one?

No, by default the tool packages all processed images into a single ZIP archive for easy downloading.

API Documentation

Request Endpoint

POST /en/api/tools/batch-image-trim

Request Parameters

Parameter Name Type Required Description
imageFiles file (Upload required) Yes -
trimMethod select Yes -
backgroundColor color No Background color to trim for color-based method
autoDetectBackground checkbox No Auto-detect background color for color/tolerance methods
tolerance range No Tolerance for border detection (0-100)
sensitivity range No Sensitivity for whitespace detection (128-255)
format select No -
quality number No -
preserveMetadata checkbox No -
outputAsZip checkbox No -
keepOriginalNames checkbox No -

File type parameters need to be uploaded first via POST /upload/batch-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-batch-image-trim": {
      "name": "batch-image-trim",
      "description": "Trim multiple images simultaneously using various trimming methods with batch processing and ZIP output",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=batch-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]