Remove the empty white, solid-color or transparent border around a picture automatically. The tool finds the edges of the actual content, lets you set a tolerance for slightly off-white or noisy borders and an optional margin to keep, and trims a whole batch of images at once.
Last updated:
Advertisement
Advertisement
How to use the Trim Image Whitespace
Add your images by dropping them in, choosing files or pasting. A sample with a white border is shown first.
Check the border type: Auto reads it from the corners; switch to White, Transparent or a custom color if needed.
Raise the tolerance if specks or a slightly gray border are left, or lower it if part of your content is cut.
Add a margin to keep a few pixels of space, and untick any sides you do not want trimmed.
Download the trimmed image, or all images as a ZIP.
How automatic trimming works
The tool first decides what the border looks like. In Auto mode it reads the four corner pixels: if at least two are transparent, the border is transparent; otherwise it uses the color shared by most corners. It then scans inward from each edge, row by row and column by column, and stops at the first pixel that counts as content:
Color border: a pixel is content when any of its red, green or blue values differs from the border color by more than the tolerance (tolerance % × 255).
Transparent border: a pixel is content when its alpha (opacity) is higher than the tolerance, so nearly invisible fringe pixels can be removed while soft edges are kept.
The smallest box that contains all content is the trim box. Any margin you set is added back on the trimmed sides.
Recommended settings
Image
Border
Tolerance
Margin
Screenshot or exported chart
Auto or White
0-3%
0-10 px
Logo or icon with transparent padding
Transparent
0-5%
0 px, or a few px for breathing room
JPG photo of a product on white
White
8-15%
10-40 px
Scanned document or signature
White
12-25%
10-20 px
Image with a black frame or letterbox bars
Auto or Custom (black)
5-12%
0 px
Tips
Look at the orange area in the preview: everything shaded will be removed. Switch to Show result to see the final image.
Specks and dust on scans stop the trim early. Raise the tolerance a little, or crop the worst part first with the Image Cropper.
Keep the layout of a batch consistent by using the same margin for all images, for example when preparing product photos or icons for a grid.
Untick a side to keep it as it is, for example to trim only the empty space at the bottom of a long screenshot.
Frequently asked questions
How do I remove the white border around an image?
Add the image and keep Border set to Auto or White. The tool scans inward from each edge until it meets a pixel that differs from the border color by more than the tolerance, then crops to that box. Click Download to save the trimmed image.
What does tolerance do?
Tolerance is how different a pixel may be from the border color and still count as border, measured as a percentage of the full 0-255 range per color channel. 0% only removes pixels that match exactly; around 5-15% handles JPEG noise, scanner gray and soft shadows. Too high a value can start trimming pale parts of the content.
Can it trim transparent space around a PNG?
Yes. Choose Transparent, or leave Auto on for an image with transparent corners. Pixels whose opacity is below the tolerance are treated as empty, so faint anti-aliased edges and soft shadows are kept at low tolerance values.
How do I keep a little space around the content?
Enter a margin in pixels. The trim box is expanded by that amount on every trimmed side. If the margin is larger than the border that was there, the extra space is filled with the border color, or left transparent for transparent borders.
Why was nothing trimmed?
Either the image has no uniform border, or a few stray pixels at the edges (a thin frame line, dust from a scan, a watermark) count as content. Increase the tolerance slightly, or check whether the corners really have the same color as the border.
Does trimming reduce quality?
No pixels inside the trim box are changed. With Same as original format, PNG files are saved as lossless PNG and JPG files are re-saved as high-quality JPG, because a browser cannot cut a JPG without re-encoding it.
Are my images uploaded?
No. The images are analysed and cropped in your browser and saved directly to your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.