Trim Image — Remove White Space Automatically
Detects the uniform border around your picture and crops it away by itself — white space, transparent padding, or any colour you pick. Tolerance handles JPEG noise, per-edge switches keep the sides you want, and padding gives back a clean margin. Runs entirely in your browser.
Drop images here
or click to browse · or paste with Ctrl+V
JPG · PNG · WebP · GIF · BMP · AVIF
What counts as border
0 = exact match. Raise it for photographed or JPEG borders.
Edges to trim
Your images are never uploaded. Detection and cropping both happen in this browser tab.
People also use
Everything this tool does
Finds the border for you
The four corners are sampled, the majority colour becomes the reference, and the scan walks inward until real content appears. No dragging, no guessing.
Transparent padding mode
Ignores colour entirely and trims by alpha instead, which is exactly what an over-sized PNG logo export needs.
Trim a colour you choose
Pick any shade and it becomes the border definition. Useful for coloured mattes, blue-screen plates and branded backgrounds.
Tolerance for noisy edges
A photographed white wall is never one value. Tolerance decides how much variation still counts as border, so JPEG grain does not block the trim.
Per-edge switches
Turn any of the four edges off. Keep a header, protect a signature line, or leave a scanner shadow alone while trimming the other three sides.
Padding you keep
Add a fixed margin back after detection, so the result hugs the content and then breathes. Never exceeds the original bounds.
Square output option
Expands the shorter side around the centre of the content, which is what most marketplace listing rules require.
Live detection preview
The detected rectangle is highlighted over a dimmed image before you commit, and the new pixel dimensions update as you move the sliders.
Batch with per-file detection
Every image is measured on its own, so a folder with wildly different amounts of white space still comes out correctly cropped. One ZIP for the lot.
Nothing is uploaded
The scan reads pixels from a canvas in your own tab. No server, no queue, nothing to delete afterwards.
Which tolerance for which image
Tolerance is the one setting that decides whether a trim succeeds or does nothing at all. This table maps common sources to the value that usually works, and to the failure you will see if you go too far.
| Source image | Mode | Tolerance | Why |
|---|---|---|---|
| PNG logo from Figma or Illustrator | Transparent | 0 | The padding is genuinely empty, so an exact alpha match is correct. |
| Screenshot with a flat background | Auto | 0 to 2 | Screen captures are pixel-exact; anything above 2 risks eating flat UI panels. |
| JPEG product photo on white | Auto | 3 to 8 | Compression scatters the white between roughly 246 and 255. |
| Photo of a document on a desk | Colour, pick paper white | 10 to 20 | Uneven lighting means the paper is a gradient, not one value. |
| Scan with a shadow on one edge | Auto, that edge off | 3 to 6 | Cheaper and safer than raising tolerance high enough to swallow the shadow. |
| Artwork with a deliberate white frame | Auto | 0, then check | The tool cannot tell an intentional frame from padding — review the preview. |
| Sprite sheet on a magenta key colour | Colour, pick the key | 5 to 12 | Key colours are usually flat but often lightly compressed. |
4
edges, independent
3
detection modes
0
files uploaded
1 px
detection precision
ZIP
batch download
Free
no account needed
FlipMyFormat vs other trim tools
| Capability | FlipMyFormat | Typical free tool |
|---|---|---|
| Files stay in your browser | ||
| Adjustable tolerance | ||
| Trim individual edges only | ||
| Keep a padding margin | ||
| Live preview of the detected box | ||
| Batch ZIP download without paying | ||
| No watermark on the output |
How to trim white space from an image
The whole job comes down to one question the tool cannot answer for you: where does the border stop being border and start being part of the picture. For a graphic exported from design software the answer is unambiguous, because the padding is mathematically identical everywhere, and tolerance zero will find the artwork edge to the exact pixel. For anything that has been through a camera or a JPEG encoder the answer is fuzzy, because what looks like flat white is really a cloud of values scattered by sensor noise and 8×8 compression blocks; there tolerance zero will find nothing at all, and you need to give the scan permission to treat near-white as white. The failure people run into most is the opposite one — pushing tolerance up until the trim finally works, only to discover it has also eaten the soft drop shadow under the product or the pale sky at the top of a landscape, because those tones now fall inside the tolerance band too. The reliable method is to start at zero, raise the slider a few points at a time, and watch the highlighted rectangle in the preview rather than the number: stop at the first value where the box snaps tight to the content. If one edge is the problem — a scanner shadow, a page fold, a caption you want to keep — switch that edge off instead of compensating with a tolerance high enough to damage the other three. And if you want a margin, do not under-trim to fake one; trim tight and add padding back, because then the margin is an exact number of pixels on every file in the batch instead of whatever each original happened to have.
- 1
Add your images
Drag, click to browse, or paste with Ctrl+V. Add a whole folder at once if you like.
- 2
Watch the detected box
Pick a mode, nudge tolerance until the highlighted rectangle hugs your content, then set edges and padding.
- 3
Trim and download
Press Trim, then save each file or take the whole batch as one ZIP. Change anything and press Re-trim.
How the detection works
Row and column scanning
The scan starts at the top row and asks whether every pixel in it matches the reference colour within tolerance. If yes, the row is border and it moves to the next one. The first row containing anything else stops the walk, and that row becomes the top of the content box. The same happens from the bottom up, the left in, and the right in. Because a single non-matching pixel ends the walk, the result is conservative by design: it will never crop into your content, but a stray dot in the margin will stop it short. That is why the preview shows the box before anything is saved.
Picking the reference colour
In auto mode all four corners are read and the value that appears most often wins. Using the majority rather than a single corner means one rounded corner, one watermark or one bit of content that reaches the edge does not derail the whole detection. In transparent mode colour is ignored and only the alpha channel matters. In colour mode you supply the value yourself, which is the right choice when the border is a deliberate matte or key colour that the corners do not represent — a framed photo, for example, where the corners are the frame rather than the background you want gone.
What people use it for
Tightening product photos
Shop listings look sharper and load faster when the product fills the frame instead of floating in white space.
Cleaning up logo exports
Design tools often export a logo on a huge transparent canvas. One pass gives you the artwork bounds exactly.
Cropping scanned documents
Remove the blank margin a flatbed adds around an A4 page so the text fills the page in your PDF.
Trimming screenshots
Cut the empty desktop or browser chrome from a capture without lining up a crop box by hand.
Preparing sprites and icons
Game and UI assets need tight bounds so they pack efficiently into an atlas. Alpha trimming does that automatically.
Marketplace square images
Trim tight, then use the square option to meet listing rules without stretching or distorting anything.
Batch-normalising a photo set
Trim tight and add the same padding to every file so a gallery has consistent spacing across mixed originals.
Shrinking email attachments
Removing empty border pixels genuinely reduces file size, which helps when an attachment is just over a limit.
Six tips worth knowing
Trim tight first, then add padding. A measured 20 px margin on every file beats leaving whatever margin each original happened to have.
If a batch behaves inconsistently, the originals probably differ in background. Switch from auto to a specific colour so every file uses the same reference.
Drop shadows are the classic casualty. If your product has one, keep tolerance low and add padding rather than pushing the slider up.
For sprite sheets and UI assets, transparent mode at tolerance 0 gives the exact bounds a texture packer expects.
Export to PNG when the source was a design file. Re-encoding a flat graphic as JPG adds ringing around every hard edge for no size benefit.
The square option centres on the detected content, so trim before squaring — squaring an untrimmed image just gives you a bigger box of white space.
Troubleshooting
Nothing was trimmed at all
Raise tolerance a few points. One stray pixel in the outer row is enough to stop the walk, and JPEG noise guarantees a few.
It cropped into my picture
Tolerance is too high, so pale content is being read as border. Lower it, or switch to colour mode and name the exact border shade.
Only three sides were trimmed
That fourth edge has something in it — a shadow, a fold, a watermark. Either switch that edge off deliberately or raise tolerance just for it.
The result has a white background
You exported to JPG, which has no alpha channel. Choose PNG or WebP to keep transparency.
Frequently asked questions
What does trimming an image actually do?
It looks at the outer rows and columns of pixels, works out what the border colour is, and walks inwards from every edge for as long as each row or column is still that same colour. The moment real content appears the walk stops, and the picture is cropped to the rectangle that remains. Nothing inside that rectangle is touched, so this is a lossless crop rather than a resize.
How is this different from a normal crop tool?
A crop tool asks you to drag a box. This one measures the image and finds the box for you, per file. If you drop thirty product photos that all have different amounts of white space, each one is trimmed to its own content — a manual crop would need thirty separate drags and would still be less precise than a pixel-level scan.
Can it remove transparent padding from a PNG?
Yes, and that is what Transparent mode is for. It ignores colour completely and treats any pixel whose alpha is at or below the tolerance as border. A logo exported from a design tool with a huge transparent canvas around it gets tightened to the artwork in one pass.
What is the tolerance slider for?
Photographed and JPEG-compressed borders are never perfectly uniform — a white background is really thousands of values between about 248 and 255. Tolerance sets how far a pixel may differ from the reference colour and still count as border. Zero means an exact match, which is right for flat exports from design tools. Around 3 to 8 handles JPEG noise. Above about 20 you risk eating into soft shadows.
Nothing was trimmed. Why?
Almost always tolerance. If the very first row contains one stray pixel that differs from the corner colour by more than the tolerance, the row is not uniform and the walk stops immediately. Raise tolerance a few points at a time and watch the detected box in the preview. A visible watermark, a thin frame line or a scanner shadow along one edge will also block it — switch off that edge and trim the other three.
Too much was trimmed. How do I get some border back?
Use the padding control. It adds a fixed number of pixels back on each trimmed edge after detection, so you can hug the content precisely and then breathe a clean 20 px margin around it. Padding never goes beyond the original image bounds.
Can I trim only one or two edges?
Yes. Each of the four edges has its own switch. This is genuinely useful for scans with a shadow along the binding, screenshots that need the top bar kept, or receipts where you only want the trailing white space gone.
What does the square output option do?
After detection it expands the shorter side of the box so the result is a perfect square centred on the content, which is what marketplaces like Amazon, Etsy and most catalogue systems expect. The extra area is taken from the original image where it exists, so you keep real background rather than a synthetic fill.
Does trimming reduce the file size?
Usually a lot. You are removing pixels, and empty border pixels are cheap but not free. A product photo on a big white canvas often drops 30 to 60% in size once the white space is gone, which is a real win for page speed on a shop listing.
Is the image re-compressed when I trim it?
The pixels that survive are copied unchanged, but the file has to be encoded again to be saved. If you output PNG or WebP lossless there is no quality loss at all. If you output JPG, one generation of JPEG compression is applied, so use the quality slider and prefer PNG when the source was a design export.
Are my images uploaded anywhere?
No. Detection and cropping both run in your browser using the canvas API. Nothing is sent to a server, which is why there is no progress bar for uploading and why the tool keeps working if your connection drops.
Can I trim a batch of images at once?
Yes. Add as many files as you like. Each one is measured independently with the same settings, so different amounts of white space are handled correctly, and you can download everything as one ZIP.
Which formats are supported?
Any image your browser can decode — JPG, PNG, WebP, GIF (first frame), BMP, and AVIF or HEIC on browsers that support them. You can keep the original format or convert the trimmed output to PNG, JPG or WebP.
Why did my transparent PNG come out with a white background?
You exported to JPG, which cannot store transparency. Choose PNG or WebP to keep the alpha channel, or pick the fill colour you want if JPG is required.
Does it work on a scanned document with a grey edge?
Often, but the scanner shadow is the usual obstacle. Set the mode to a specific colour, pick white, and raise the tolerance until the shadow falls inside it. If only one edge has the shadow, switching that edge off is faster and safer than pushing tolerance high enough to swallow it.
Will it remove a white border that is part of the photo itself?
Yes, and that is a real risk with instant-camera style frames or artwork mounted on white. The tool cannot tell an intentional white frame from unwanted padding — it only sees uniform pixels. Check the detected box in the preview before you commit.
Is there a size limit?
No limit from us. The practical ceiling is device memory, because the image is decoded into a full pixel buffer for scanning. Detection is fast even on large photos because it stops as soon as a row or column contains content.
Does it add a watermark or need an account?
No to both. There is no sign-up, no daily cap, no watermark and no email wall. The output is your image with the border removed and nothing added.