Categories

Image Trim Whitespace

Remove whitespace and empty margins from images by detecting and trimming blank areas

Click to upload file or drag and drop file here

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

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

128 210 255

Brightness threshold for whitespace (128-255). Higher = more pixels considered whitespace

Analyze pixel brightness to detect white/light areas as whitespace

Treat fully or partially transparent pixels as whitespace

Analyze the image to find whitespace boundaries without creating a trimmed file

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, range, checkbox, select, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The Image Trim Whitespace tool automatically detects and removes empty margins or blank areas from your images, ensuring your visuals are perfectly framed and ready for professional use.

When to Use

  • Removing excess padding from screenshots or web captures.
  • Cleaning up scanned documents or illustrations with large empty borders.
  • Standardizing image dimensions by eliminating unnecessary transparent or white backgrounds.

How It Works

  • Upload your image file (JPEG, PNG, WebP, etc.) to the tool.
  • Adjust the sensitivity and detection settings to define what constitutes 'whitespace' based on brightness or transparency.
  • Select your preferred output format and quality settings.
  • Process the image to automatically crop the boundaries and download your trimmed file.

Use Cases

Preparing product photos for e-commerce by removing distracting white borders.
Optimizing UI design assets by cropping out empty canvas space around icons.
Refining scanned text documents for better readability and layout consistency.

Examples

1. Optimizing Product Icons

UI Designer
Background
A set of icons was exported with inconsistent padding, making them look misaligned in the app interface.
Problem
Manual cropping of dozens of icons is tedious and prone to alignment errors.
How to Use
Upload the icon, enable 'Check Transparency', and set the output format to PNG.
Outcome
The tool automatically removes the transparent padding, resulting in perfectly centered icons ready for the design system.

2. Cleaning Scanned Documents

Administrative Assistant
Background
Scanned receipts often contain large, unnecessary white margins that waste space in digital archives.
Problem
Large margins make the document content appear small and difficult to read.
How to Use
Upload the scanned image, adjust 'Whitespace Sensitivity' to 220 to ensure light gray paper textures aren't trimmed, and process.
Outcome
The document is tightly cropped to the text area, significantly improving readability and reducing file size.

Try with Samples

image, png, jpg

Related Hubs

FAQ

Which image formats are supported?

The tool supports JPEG, PNG, WebP, GIF, BMP, and TIFF files.

How does the sensitivity setting work?

Sensitivity determines the brightness threshold (128-255) for detecting whitespace; higher values treat more pixels as blank.

Can I remove transparent backgrounds?

Yes, by enabling the 'Check Transparency' option, the tool will treat transparent pixels as whitespace to be trimmed.

Does this tool change the image file format?

You can choose to keep the original format or convert the output to JPEG, PNG, or WebP.

What is the 'Analyze Only' mode?

This mode detects the whitespace boundaries without generating a new file, which is useful for previewing the crop area.

API Documentation

Request Endpoint

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

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes Upload any image file (JPEG, PNG, WebP, GIF, BMP, TIFF) for whitespace trimming
sensitivity range No Brightness threshold for whitespace (128-255). Higher = more pixels considered whitespace
checkColor checkbox No Analyze pixel brightness to detect white/light areas as whitespace
checkTransparency checkbox No Treat fully or partially transparent pixels as whitespace
analyzeOnly checkbox No Analyze the image to find whitespace boundaries without creating a trimmed file
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-whitespace 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-whitespace": {
      "name": "image-trim-whitespace",
      "description": "Remove whitespace and empty margins from images by detecting and trimming blank areas",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-trim-whitespace",
      "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]