Trim Transparent PNG and Crop Whitespace

Choose an image. Transparent margins or a plain-color border are detected and cut away. You can add padding back.

Choose an image to start.

Runs entirely in your browser. Nothing you enter is sent or stored.

How to use

  1. Choose an image.
  2. The tool checks the corners: transparent margins or a plain-color border.
  3. Set padding in pixels if you want space around the result.
  4. Download the trimmed PNG.

If all four corners are transparent (alpha 10% or less), the image is cropped to the pixels whose alpha is above 8 out of 255. Otherwise plain-color rows and columns are trimmed from each edge: a line counts as plain when its sampled pixels differ from its first pixel by 40 or less in R+G+B combined.

Border trimming removes at most a quarter of the width or height from each side.

Frequently asked questions

Why was the border not trimmed?

Border trimming stops after a quarter of the image on each side, and it is cancelled if half of the width or height or less would remain. Lines with noise or gradients beyond the tolerance are kept.

What does padding add?

Transparent pixels on all four sides of the trimmed image.

Is the image resized?

No. The result is cut from the original pixels and saved as PNG.

Related tools