Trim Transparent Pixels — Auto-Crop PNG/WebP Borders Free
Automatically crop away transparent borders from a PNG or WebP image. Batch-trim a whole icon set with matching padding and alignment — free, runs entirely in your browser.
What it does
Upload a PNG (or WebP with transparency) and this tool finds the smallest rectangle that contains everything non-transparent, then crops to it — removing empty margin without touching your actual artwork. It works on one file or a whole batch at once.
How it works
The tool scans every pixel’s alpha channel to find the tightest bounding box around your content, then crops to that box (optionally padded back out by however many pixels you choose — a pure tight trim usually looks too cramped for real use). An adjustable alpha threshold lets you ignore faint, anti-aliased edge pixels that would otherwise stop the crop from getting properly tight.
For a batch — an icon set, a sprite sheet’s individual pieces, anything meant to stay visually aligned — turning on symmetric trim changes the math: instead of cropping each image as tightly as it individually allows, it finds the smallest safe margin on each side across the whole batch and applies that same inset to every image, so nothing shifts out of alignment relative to the others. Pad results to match largest goes a step further and centers every trimmed result onto a shared canvas sized to the biggest output in the set, so a whole batch ends up as uniformly-sized files.
How to use it
- Drag your PNG or WebP files onto the drop zone.
- Adjust the alpha threshold if a faint halo is preventing a tight trim.
- Add padding back if a completely tight crop looks too cramped.
- For a batch you want to keep aligned, turn on Symmetric trim across batch (and optionally Pad results to match largest).
- Download a single result from its card, or use Trim all & download each / Download all as .zip for the whole batch.
- Use Export trim report to get a quick text summary of how much was cropped off each file.
If your source images started as JPGs or another opaque format, convert them to PNG first and add transparency (via a background remover or design tool) before trimming, since trimming needs a transparency channel to work from. If your icons need consistent corner rounding after trimming, the rounded corners tool is a natural next step.
FAQ
What happens if an image has no transparency at all? It’s flagged as “nothing to trim” rather than silently left unchanged or cropped incorrectly — a fully opaque photo has no transparent margin to detect.
What if an image is completely transparent? That’s also flagged rather than producing a broken zero-size file — there’s no content to find a bounding box around.
Will this cut into my actual artwork? Only if you lower the alpha threshold enough to start counting very faint, semi-transparent pixels (like soft-edged shadows) as “empty.” The default threshold only trims fully transparent margin.
Does JPG work with this tool? No — JPG has no transparency channel, so there’s nothing to detect. This tool is built for PNG and WebP.
What’s the difference between symmetric trim and just trimming each image normally? Normal trimming crops each image as tightly as its own content allows, which can shift icons in a set out of visual alignment with each other if their margins differ slightly. Symmetric trim finds the smallest margin that’s safe across the entire batch and applies it uniformly, so relative positioning stays consistent.
Can I undo padding to get back to the tightest possible crop? Yes — padding is just a slider; set it back to 0 and every preview updates immediately.