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.
Often used alongside PNG Space Adder, PNG Padding Adder and PNG Padding Remover.
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
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.