Remove the empty space around an image
Remove the empty margin around an image so the canvas ends where the content ends. Drop a file above and the transparent area around it is detected and cut away, in your browser, without an upload.
One thing worth knowing first: transparent empty space and white empty space are completely different problems. Only one of them can be solved exactly.
Drop image here
or
PNG, WebP or JPG · up to 50 MB · you can also paste from the clipboard
Your images are processed locally in your browser.
Two kinds of empty space
“Empty” is a judgement your eye makes, not something an image file records — with one exception. An alpha channel stores precisely that: which pixels are nothing at all. A solid white background stores no such information; white is just a colour, exactly as much data as any other colour.
| Kind of margin | What the file records | Can it be detected exactly? |
|---|---|---|
| Transparent (PNG, WebP) | Alpha 0 — the pixel is explicitly nothing. | Yes. The bounding box is derived, not guessed, and the result is always right. |
| Solid white or solid colour | Ordinary colour values, identical to real white content. | No. It requires guessing which colour is background and how close counts as a match. |
| Near-white from a scan or photo | Thousands of slightly different off-white values, plus noise and vignetting. | No. Tolerance too tight leaves a border; too loose eats light parts of the subject. |
Why AutoCrop does not guess at background colour
Colour-based trimming is easy to implement and hard to get right, and the failure mode is destructive. Sample the corner pixel, treat everything within some tolerance of it as empty, and you will break on:
- A white logo on a white background — the entire image reads as empty.
- A product photo with a soft studio backdrop that has a gradient, so the corners do not match the edges.
- JPEG compression, which surrounds every hard edge with faint ringing artefacts that are neither background nor subject.
- Scanned documents with paper texture, shadow near the spine, and slightly different white on each side.
- Screenshots where the app chrome happens to be the same colour as the page behind it.
If your empty space is white
The reliable route is two steps, not one: turn the background into real transparency, then trim it exactly.
- 1
Make the background transparent
Use a background remover, or in an editor select the background by colour range and delete it. What matters is that the empty area ends up with an alpha value of 0 rather than being painted white.
- 2
Save as PNG or WebP
These are the common formats that can carry an alpha channel. Saving as JPG at this point throws the transparency away again and puts you back where you started.
- 3
Trim the transparent margin here
Drop the transparent file into the tool above. The empty area is now unambiguous, so the bounding box is exact rather than guessed.
Worth checking before you start: many files that look like they have a white background actually have a transparent one, and the white you see is your image viewer. Drop the file above — if the margin shows a checkerboard, it is already transparent and you can skip straight to trimming.
Getting the margin you actually want
Trimming to zero margin is rarely the end goal. Usually you want a predictable margin instead of an accidental one, and that is what the padding control is for: trim everything off, then add a known number of transparent pixels back on all four sides. A logo with 24 px of deliberate padding behaves consistently everywhere it is used, unlike the same logo with whatever margin its artboard happened to have.
If the trimmed result still looks like it has a margin, it is probably a soft shadow rather than empty space — the threshold measurements explain how far to push it. And if what you actually need is to cut a subject out of its background, see what “remove background” can mean.
Empty space: questions
- Can it remove white space around an image?
- Not automatically, and deliberately so. White space cannot be told apart from white content — a white logo, a white product on white, a scanned page — without guessing, and a wrong guess destroys part of your image. Transparent space is unambiguous, so that is what AutoCrop detects. Make the white background transparent first, then trim.
- How do I know whether my empty space is transparent or white?
- Drop the file in above. The preview draws a grey checkerboard wherever the image is transparent. If the margin shows a checkerboard it is transparent and will be trimmed; if it stays a solid colour, it is real pixels and AutoCrop will report that the image has no transparency.
- Why can a JPG never be trimmed automatically?
- JPEG has no alpha channel, so every pixel is opaque by definition, including the ones that look like empty background. There is nothing marked as empty for a bounding box to exclude.
- Does removing empty space change the image itself?
- No. Only margin is discarded. The remaining pixels are copied across untouched and re-encoded losslessly, so nothing is scaled, blurred or recompressed.
- Can I remove space from just one side?
- Not currently — the bounding box is applied to all four sides at once, and padding is added to all four as well. For asymmetric results, trim here and then crop the specific side in an image editor.
Related
- Remove transparent backgroundDisambiguates trimming transparent margins from cutting out a subject.
- Crop transparent PNGHow PNG alpha works, and what each PNG variant means for cropping.
- Auto crop in bulkBatch cropping for icon sets and asset exports, plus its pitfalls.
- AutoCropThe main tool: detect content bounds and trim the transparent margin.