Auto-Trim Transparent Margins

Trim empty margins from transparent PNGs
Save as PNG or ZIP

Images are processed only in your browser

Quick start

  1. Choose images
  2. Trim margins
  3. Save selected images as ZIP

Trimmed images

0 images

Add images and choose Trim margins.
Results appear here.

Save individual PNGs or selected images as a ZIP

Trims outer transparent margins without splitting images. Does not remove image backgrounds.

If no margins are found, the original is saved with only your chosen padding added. Faint shadows or edges may be partly trimmed.

Before and after trimming margins

First, the transparent mug PNG from the background removal page, trimmed with the default 0 px margin. Second, a transparent PNG drawn for this page, where trimming barely helps. The checkerboard marks transparent areas.

Works well A mug with its background removed

A 1920×1280 transparent PNG with a wide empty margin around the mug, before trimming
Before · original
The mug as a transparent PNG with its margin removed (711×658)
After · result

The 1920×1280 transparent PNG became 711×658 after trimming the outer margin. Both images are shown at the same scale, so the size change is visible. Only transparent margins are removed; the mug pixels remain untouched.

Does not work well A star with stray dots in the corners

A yellow star with one tiny dot in each of two opposite corners
Before · original
Result where the margin barely shrank
After · result

The trim barely shrinks the image when tiny stray dots remain. Two nearly invisible 3 px dots in opposite corners count as content, so 800×600 only shrinks to 773×573. Remove such dots in another editor first.

These example images were made the same way as this tool.

You open a product PNG, the background looks white, and you expect the trim to shrink it to the product. It comes back the same size, because that "white" is an opaque light grey (247, 247, 247) with a soft floor shadow under the product. This tool looks at transparency and ignores how white a pixel is. It trims the transparent margin around a PNG and can add 0 to 1,000 px of transparent padding back. An RGB PNG has no transparency, so even a pure-white background stays. A JPG can't be added at all.

A white-looking background is still opaque

The grey and the shadow are both fully opaque, so the tool finds picture right up to the edge and leaves the size alone. A JPG stops one step earlier, with the notice Choose a PNG file next to its file name. Remove the background first so you have a PNG with a transparent edge. Erase any border drawn around the shot too, since even a 2 px opaque line counts as part of the picture.

When the file comes back the same size

Take two 800 × 800 shots, one on an off-white background with a shadow and one on white with a 2 px grey frame. Both come back at 800 × 800, and the status line reads Processed 2 of 2 images. Trimmed 0 · Original unchanged 2. Save selected images as ZIP downloads loopyti-auto-crop.zip, and each PNG inside has _crop added to its name. To get a real trim, run the shot through Remove Background first, erase the frame in an image editor, then add the PNG here again.

Trim tight, or add padding back

If the picture shouldn't sit flush against the edge, keep some padding. Set Padding to keep anywhere from 0 to 1,000 px, and the same amount of transparent space goes on all four sides after the trim. For a fixed canvas size and a background color, take the trimmed PNG to Make Product Photos Uniform.

You can add up to 20 PNG files at once, each up to 40 MiB and 25 million pixels. A fully transparent image has nothing to trim to, so it comes back at its original size.