Home › Image Tools › Trim Image Whitespace

Trim Image Whitespace

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:

Trim these sides
Advertisement
Advertisement

How to use the Trim Image Whitespace

  1. Add your images by dropping them in, choosing files or pasting. A sample with a white border is shown first.
  2. Check the border type: Auto reads it from the corners; switch to White, Transparent or a custom color if needed.
  3. Raise the tolerance if specks or a slightly gray border are left, or lower it if part of your content is cut.
  4. Add a margin to keep a few pixels of space, and untick any sides you do not want trimmed.
  5. 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

ImageBorderToleranceMargin
Screenshot or exported chartAuto or White0-3%0-10 px
Logo or icon with transparent paddingTransparent0-5%0 px, or a few px for breathing room
JPG photo of a product on whiteWhite8-15%10-40 px
Scanned document or signatureWhite12-25%10-20 px
Image with a black frame or letterbox barsAuto 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.

Related tools

Image CropperCrop images, including circle crops for profile pictures.Make Image TransparentRemove a white or solid-color background and save a transparent PNG, right in your browser.Image Border AdderAdd a border, rounded corners, matte and shadow to a photo onlineStraighten ImageFix a tilted photo: rotate by any angle with a grid, auto-crop the corners or level the horizon.Image CompressorShrink images to a target size like 100 KB.Image ResizerResize images to any size without losing quality.Compress Image to 20KBShrink any photo to under 20KB (or any target size).Compress Image to 100KBShrink any photo to under 100KB automatically, with the best quality that fits.Compress JPEG to 50KBShrink photos to under 50KB for forms, passports and exams.Rotate & Flip ImageRotate images by any angle or mirror them, one or many at once.Collage MakerCombine photos into a grid collage.Aspect Ratio CalculatorCalculate image sizes for 16:9, 4:3 and any ratio.Image SplitterSplit an image into a rows × columns grid of tiles and download them one by one or as a ZIP.Image CombinerCombine images side by side, stacked or in a grid, with spacing, background color and alignment.Image UpscalerEnlarge images 2×, 3× or 4× with Lanczos-3 or bicubic resampling and optional sharpening.Image DPI ChangerChange the DPI of JPG and PNG images without re-encoding, and see the print size.Pixel Art MakerDraw pixel art on an 8 to 64 px grid with palettes, fill and mirror, then export PNG or SVG.Social Media Image ResizerResize photos for Instagram, Facebook, X, LinkedIn, YouTube, TikTok and Pinterest in one go.Image Diff CheckerCompare two images and highlight every changed pixel, with % difference and a swipe slider.Emoji to ImageTurn any emoji into a PNG image from 64 to 1024 px, transparent or on a color, in batch.Text to ImageTurn text into a PNG image with your font, size, colors, padding, alignment and wrapping.SVG OptimizerMinify SVG files: strip metadata, comments and editor junk, round numbers, compare sizes.Compress Image to 200KBShrink any photo to under 200KB automatically, with the best quality that fits.Crop GIFCrop an animated GIF with a draggable box or aspect ratio presets, keeping every frame.Crop Image into ShapeCrop a photo into a heart, star, hexagon, circle, speech bubble or custom SVG shape as a PNG.Drawing Grid MakerPut a numbered grid on a reference photo to copy it by hand. Print it or save as PNG or PDF.Resize GIFResize an animated GIF by width, height or percent, skip frames and compare file sizes.Square Image Maker (No Crop)Make any photo square, 4:5 or 9:16 without cropping, with a color, blur or gradient fill.Text Behind ImagePut text behind the subject of a photo: AI cut-out, fonts, colors, rotation and PNG export.Bulk Image ResizerResize many images at once by width, height, percent or longest side and download a ZIP.JPG to WordTurn photos and scans into an editable Word document with OCR. Batch images, 30+ languages.PNG CompressorShrink PNG files up to 80% with smart color reduction that keeps transparency. Batch + ZIP.Photo Measurement ToolMeasure distances, areas and angles on a photo using a card or ruler in the picture for scale.Pupillary Distance MeasurementMeasure your PD in mm from a webcam or photo with a card for scale, single and dual PD.Brighten ImageBrighten dark photos with auto exposure, shadows lift and highlight protection. Batch, no upload.Change Image Aspect RatioConvert photos to 1:1, 4:5, 16:9, 9:16, 3:2 or any ratio by crop, color padding or blur fill.Crop Photo for PrintCrop photos to 4x6, 5x7, 8x10, 11x14 or A4 print ratios with a DPI quality check, then export.Long Screenshot StitcherStitch scrolling screenshots into one long image with automatic overlap detection.Scanned Photo SplitterSplit several photos from one flatbed scan: auto-detect, straighten and crop each, then ZIP.Image to Minecraft Pixel ArtConvert any image into Minecraft block pixel art with block counts, stacks and a row-by-row build guide.Pixel Art UpscalerUpscale pixel art and sprites crisply with nearest neighbor, Scale2x/3x or xBR, keeping transparency.Resize Image in CM and InchesResize a photo to an exact print size in cm, mm or inches at any DPI. JPG, PNG or PDF.Online Screenshot ToolCapture your screen, a window or a tab, then crop, annotate and copy or save it as PNG.Fix Image OrientationRotate sideways photos upright for good by applying the EXIF orientation to the pixels, in batch.Image Format DetectorFind an image's real format from its magic bytes, see size and bit depth, and fix a wrong extension.Increase Image Size in KBMake a photo's file size bigger (e.g. 50 KB or more) to pass minimum upload limits, with no visible change.Megapixel CalculatorTurn width × height into megapixels, aspect ratio and max print size, or MP back to pixels.Volleyball Rotation ToolEnter 6 players and a 5-1, 6-2 or 4-2 system to see all rotations and serve receive on a court.Auto Face CropDetect faces and crop centered headshots at any ratio and padding, in batch.Content-Aware Image ResizeResize images with seam carving to keep people and objects intact; protect or remove areas.
See all 49 Resize, Crop & Compress →