Image Trim (Auto-Crop Transparent / Solid Borders)
Image
Screenshots, design exports, scanned pages, and rendered graphics almost always carry extra empty space around the actual content. Trimming that manually in an image editor is busywork — eyeballing the right crop rectangle, fiddling with the marquee tool, lining up edges. This tool does it in one step: it scans inward from each edge until it finds the first row/column whose pixels are NOT the background color, then crops to that bounding box. Background detection has five modes — auto (samples the four corners and uses the median), transparent (alpha-only), pure white, pure black, or any custom color. A tolerance slider (0-80) handles JPEG artifacts and near-white scans where the 'empty' area isn't perfectly uniform. Padding (0-64 px) lets you keep a clean margin around the content. Export to PNG (preserves transparency), JPEG (with chosen background color flattened in), or WebP. Everything runs in your browser — the image is never uploaded to a server.
How to use
- Drag an image onto the drop zone or click to choose a file.
- Pick the background mode — Auto works for most images (samples corners).
- Bump tolerance up if the border isn't a perfectly uniform color (JPEG noise, near-white scans).
- Add padding if you want a clean margin around the content.
- Choose export format and click Download — savings vs original area is shown alongside the trimmed preview.
Frequently asked questions
- How does Auto mode pick the background color?
- It samples the four corner pixels. If any corner is transparent (alpha ≤ 8), it switches to transparent mode. Otherwise it takes the median R, median G, and median B across the four corners as the target color. The median is robust to one weird corner — if three corners are white and the fourth happens to fall on actual content, the median still reports white. For pathological cases (content touching multiple corners), use one of the explicit modes instead.
- What does tolerance do?
- A pixel counts as background if it's within `tolerance` of the target color on every channel (max channel difference ≤ tolerance). For transparent mode, tolerance is mapped to an alpha threshold (alpha ≤ tolerance × 2.55 counts as background). At tolerance 0 only exact matches are trimmed; at 10-20 you'll trim near-white scans and JPEG-noisy borders; at 50+ you'll start eating into real content. Push it up until the trim looks right.
- Why does the result have a checkered background?
- That's the standard transparency indicator — wherever you see the checkerboard pattern, the image has alpha = 0 (fully transparent). It's only there in the preview; the actual file has true transparency. If you export as JPEG (which can't store transparency), the JPEG background color you pick fills those areas instead.
- What if the whole image is the background color?
- You'll see 'no content found' instead of an output. That happens when nothing in the image differs from the target color by more than the tolerance — usually because you picked the wrong mode (e.g. 'transparent' on a flattened JPEG, or 'black' on a light image). Switch mode or raise tolerance.
- Does padding ever exceed the original image bounds?
- No. Padding is clamped to the original image edges. If your content was already flush against one side, padding adds extra space only on the sides where there was room. The output dimensions are always inside the source dimensions — this tool only crops, it never expands the canvas. Use the Image Padding tool if you want to add canvas beyond the original.
Related tools
Image Crop (Aspect Ratio)
Crop any image to a standard aspect ratio (1:1, 16:9, 4:3, etc.) — centered automatically.
Image Rotate & Flip
Rotate an image 90° at a time or flip it horizontally / vertically, then download the result.
Image Resize
Resize an image to any dimensions and export as PNG, JPEG, or WebP — all in your browser.
Image to Base64
Convert an image to a Base64 data URL you can paste anywhere.
QR Code Generator
Create custom QR codes from any text or URL and download them.
Image Compressor
Compress and resize JPEG, PNG, and WebP images in your browser.