Trim Whitespace from Image
Automatically crop white, black, transparent or custom-coloured borders from an image, with a tolerance slider for JPEG edges and optional padding.
What is the Trim Whitespace from Image?
Screenshots, scans and exported logos almost always come with a border of dead space around them. This tool finds the real content: it works out the background colour, scans in from every edge for the first pixel that differs from it by more than your tolerance, and crops to that bounding box.
- Background auto-detected from the four corner pixels
- White, black, transparent and custom-colour trim modes
- Tolerance slider from 0% to 100% for compressed edges
- Optional padding added back, with or without a background fill
- Reports original size, trimmed size, crop origin and pixels removed
- Full-resolution PNG export, processed entirely in your browser
How to use the Trim Whitespace from Image
- 1
Drop an image with unwanted borders into the upload area.
- 2
Leave the background on auto-detect, or choose white, black, transparent or a custom colour.
- 3
Raise the tolerance if a JPEG border is near-white rather than a clean flat colour.
- 4
Add padding back if the content needs breathing room, and choose whether to fill it.
- 5
Check the reported dimensions, then click Download PNG to save the trimmed image.
About the Trim Whitespace from Image
Screenshots, scans and exported logos almost always come with a border of dead space around them. This tool finds the real content: it works out the background colour, scans in from every edge for the first pixel that differs from it by more than your tolerance, and crops to that bounding box.
By default the background is inferred from the four corner pixels, which handles white scans and transparent PNGs with no setup at all, and you can override it with white, black, transparent or a colour of your own. The tolerance slider is what makes the tool work on JPEGs, where a white margin is really a spread of near-white values rather than one flat colour.
Before and after dimensions, the crop origin and the number of pixels removed are all reported so you can confirm the crop is what you expected, and you can add uniform padding back with the option to fill it with the background colour. Scanning and cropping run in your browser — 100% local, never uploaded.
Frequently asked questions
How do I remove white space around an image?
Drop the image in and leave the background mode on auto-detect. The tool reads the four corner pixels, works out that the border is white, scans inward until it finds real content and crops to that box. Download PNG then saves the trimmed version.
Why is nothing being trimmed from my JPEG?
JPEG compression means a border that looks white is actually a scatter of values like 251, 253 and 255, so an exact match finds no background at all. Raise the tolerance slider to around 5% to 15% and those near-white pixels will be recognised as border.
Can it crop transparent edges from a PNG?
Yes. Choose the transparent mode, or leave auto-detect on and the tool will pick it automatically when the corners are clear. It then crops to the bounding box of every pixel with meaningful alpha, which is the standard way to tighten an exported logo.
What does the padding option do?
Padding adds a uniform margin back around the cropped content, which is useful when a design needs breathing room after a tight crop. You can fill that padding with the detected background colour, or leave it transparent when trimming a PNG.
Is my image uploaded when it is trimmed?
No. The pixel scan and the crop both happen on a canvas inside your browser, and no data is sent to a server. Documents, screenshots and client artwork all stay on your own device.
Related tools
Image Resizer
Resize images to exact pixel dimensions or by percentage with aspect-ratio lock. Free online image resizer that works privately in your browser.
Add Background to Transparent PNG
Add a solid colour, gradient or checkerboard background to a transparent PNG and export it as an opaque PNG or JPG, entirely inside your browser.
Alpha Channel Extractor
Extract the alpha channel of a PNG as a grayscale mask, see how much of the image is transparent, and invert or threshold the matte before downloading.
Sticker Outline Maker
Add a die-cut sticker outline to any transparent PNG, with adjustable width and colour, a second offset border and a full drop shadow. Free in-browser.
Image Compressor
Compress JPG, PNG and WebP images in your browser with an adjustable quality slider. See before/after file size and download the smaller image free.