Trim Image Whitespace

Crop uniform borders from up to 20 images using the corner color or a color you choose.

On-device No sign-up Free to use

Trim borders controls

  1. 1 Add files
  2. 2 Arrange/Options
  3. 3 Download

Drop your images here

or choose them from your device

Up to 20 JPEG, PNG or WebP images, 64 MiB each, 128 MiB and 40 megapixels combined. Outputs include individual files and a ZIP for a batch.

    ?

    The top-left pixel is the usual background. Choose a color when the border is a paper or scanner shade.

    ?

    Used only when Border colour is set to a color you choose.

    ?

    How far a border pixel may differ from the reference and still count as border. Scanned paper usually needs a larger number than a flat background.

    Advanced
    ?

    Retains this many original pixels around the detected content, stopping at the image edges.

    Result

    Showing an example.

    A white scan or screenshot with a wide margin around the one block of content.

    scan-trimmed.png at 30 by 20 pixels. The result reports the original 60 by 40 pixels, the trimmed 30 by 20 pixels, 10 pixels removed from the left, 10 from the top, 20 from the right and 10 from the bottom, and the reference color with its tolerance.

    Loading the tool. Your result will appear here.

    https://usefreetools.net/trim-image-whitespace · 20 November 2026

    Was this helpful?

    How to use Trim Image Whitespace

    1. Choose up to 20 JPEG, PNG or WebP images, within 64 MiB per file, 128 MiB and 40 megapixels combined.
    2. Leave Border color on the top-left pixel, or set the paper or background color that your scan uses.
    3. Raise the tolerance when the border is not perfectly even, lower it if pale content is being trimmed away, and add padding when the cut needs a little breathing room.
    4. Select Trim borders, inspect the reported dimensions and download the copies. A batch includes individual files and one ZIP.

    Example: Trim Image Whitespace

    A white scan or screenshot with a wide margin around the one block of content.

    You add
    scan.png, a 60 by 40 pixel white image with a 30 by 20 pixel block of dark content at x=10, y=10. Border color from the top-left pixel, Tolerance 8, Padding 0, Output format PNG.
    You get
    scan-trimmed.png at 30 by 20 pixels. The result reports the original 60 by 40 pixels, the trimmed 30 by 20 pixels, 10 pixels removed from the left, 10 from the top, 20 from the right and 10 from the bottom, and the reference color with its tolerance.

    Options

    Border color
    The default compares every pixel with the top-left pixel, which is the usual white or coloured margin. Choose a color when the border is a paper shade that the corner pixel does not represent, such as a scan with a printed header.
    Tolerance
    The largest channel difference that still counts as border. Flat digital artwork trims at the default of 8. Check the four edges of the result: raise the number when a soft or uneven margin is left behind, and lower it when pale content near the edge is being absorbed into the border.
    Padding
    Padding expands the crop into the existing surrounding pixels; it does not create a new blank border. It is clamped to the original image edges. If it restores the full frame, the tool asks you to lower it.
    Output format
    Auto keeps the source format. PNG stores the cropped browser-decoded pixels losslessly; JPEG and WebP use the quality setting. File size depends on the picture and encoding, so compare the actual result.

    Supported inputs and limits

    InputUp to 20 JPEG, PNG or WebP images
    Size64 MiB each; 128 MiB and 40 MP combined
    OutputTrimmed PNG, JPEG or WebP; batch ZIP available
    • Up to 20 JPEG, PNG or WebP images, 64 MiB each, 128 MiB and 40 megapixels combined.
    • Batch outputs are capped at 128 MiB.
    • Every pixel is compared with the top-left pixel or chosen color, including alpha.
    • A difference above the tolerance marks content; the smallest rectangle containing all content is kept.
    • Noise or a dark speck in a margin can prevent trimming, while too much tolerance can discard pale content.
    More details

    Padding of 0–200 pixels retains more of the original surrounding area and stops at the image edges.

    Entirely matching images, full-frame content and padding that restores the full frame are refused.

    A refusal stops the batch; try that file separately.

    The crop is encoded from browser-decoded pixels.

    PNG avoids further lossy encoding, but source metadata and original file structure are not preserved.

    JPEG/WebP encoding can alter detail;

    JPEG fills transparency white.

    Where your input is processed

    This tool does not upload your inputs. See the limits for anything saved on your device.

    One speck can keep a wide margin

    The tool scans the whole image for pixels unlike the reference color. A single dark mark near an edge can expand the bounding rectangle and keep a wide margin. Crop unwanted marks first when possible. Raising tolerance may ignore faint noise, but can also remove pale text or lines, so inspect all four edges.

    Questions about Trim Image Whitespace

    How does the tool decide where the content starts?

    It walks the pixels and keeps the smallest rectangle that holds every pixel differing from the border color. The margin above, below, left and right is whatever falls outside that rectangle.

    Nothing happened. Why?

    If every pixel matches the border color, try a lower tolerance or a different reference color so the content remains distinguishable. If content reaches all four edges, there is no removable margin. Padding can also restore the full image extent; lower it and try again.

    Will a slightly uneven gray border still trim?

    Yes, within the tolerance you set. The comparison allows a difference of up to that number in each of the red, green, blue and alpha channels. Start at the default of 8, inspect the edges of the result, and raise it only as far as the margin needs.

    Does trimming change the picture itself?

    The output removes outer rows and columns and re-encodes the crop. PNG avoids additional lossy compression of the browser-decoded pixels. JPEG and WebP can change detail during encoding. Color-profile handling can also affect decoded values, and source metadata is not copied.

    Part of my picture disappeared. Why?

    The tolerance was wide enough for pale content near the edge to count as border. Lower the tolerance and run again, or set the border color to the exact shade of the margin so the comparison has a narrower target.

    Page updated · Project managed by Tony Hines · Report a problem with Trim Image Whitespace