PNG Space Remover

Uploads a PNG, finds the tightest bounding box around its non-transparent pixels, and crops the canvas down to exactly that box — the same auto-trim operation as the padding remover tool, under an alternate name. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool automatically trims empty transparent space from around a PNG's visible content, computed entirely client-side.

It's the equivalent of an image editor's "trim" or "auto-crop to content" command.

What Is PNG Space Remover?

An auto-trim tool that scans every pixel's alpha channel to find the tightest rectangle containing all non-transparent content, then crops the canvas down to exactly that rectangle.

Unlike removing a fixed-thickness border, it adapts to however much space actually surrounds the content on each side.

How PNG Space Remover Works

The tool first locates the minimum and maximum x/y coordinates among all pixels with nonzero alpha, forming a bounding box.

It then crops the image to that exact box, discarding any fully transparent space outside it while preserving every visible pixel untouched.

When To Use PNG Space Remover

Use it to clean up an exported icon or logo that has more transparent space baked in than you want.

It's also useful before measuring or comparing an image's true visible dimensions, independent of how much empty space surrounds it.

Features

Advantages

  • Runs entirely client-side; your image never leaves the browser.
  • Adapts to uneven margins automatically instead of assuming a fixed, symmetric border.
  • Leaves every visible pixel completely untouched — only the transparent space is removed.

Limitations

  • It only detects fully transparent space; a solid-color (opaque) background isn't recognized as trimmable space.
  • A fully transparent image has no content to trim to, so the tool reports an error rather than guessing.

Examples

Trim an icon exported with extra space

Input

A 512x512 PNG icon whose actual artwork only fills the center 300x280 area

Output

A 300x280 PNG containing just the visible artwork, tightly cropped

The tool finds the exact bounding box of the non-transparent pixels and crops to it.

No-op on a fully-filled image

Input

A 100x100 PNG with visible content touching every edge

Output

The same 100x100 PNG, unchanged

Since the content's bounding box already equals the full canvas, there's nothing to trim.

Best Practices & Notes

Best Practices

  • Run this before measuring an image's true content dimensions, since exported assets often carry extra invisible space.
  • Check the transparency checker tool first if you're unsure whether an image has trimmable space.

Developer Notes

This tool's lib function is a thin wrapper re-exporting the padding remover's implementation, since "space" and "padding" are the same auto-trim operation; the shared math composes two existing pure lib functions (the outline finder and the cropper) over a plain Uint8ClampedArray pixel buffer with no DOM dependency.

PNG Space Remover Use Cases

  • Cleaning up an exported icon with excess transparent space
  • Preparing tightly-cropped assets for a sprite sheet
  • Measuring an image's true visible content size

Common Mistakes

  • Expecting this to trim a solid white or colored background — it only removes fully transparent (alpha 0) space.
  • Running it on a fully transparent image and expecting a valid (rather than an error) result.

Tips

  • Pair this with the space adder tool to standardize margins: trim first, then add back a consistent amount.
  • Use the transparency checker tool afterward to confirm how much of the canvas is now visible content.

References

Frequently Asked Questions