ClawStudiouo
Related Tools:

Free Online PNG Trim — Crop Transparent Edges

Remove transparent borders from PNG images, single or batch — free, online, no registration.

Drop your PNG files here or click to select

Max 100 files, 5MB each, 60MB total

3 free conversions remaining

Use the PNG Trim API

Integrate automatic PNG trimming into your applications with the Easy PNG to Sprites API.

Upload one or more PNG files to remove transparent edges automatically, perfect for preparing game sprites and UI assets.

API Highlights

  • POST /trim: single PNG or batch ZIP output
  • Upload up to 100 PNG files per request
  • Alpha threshold and padding control
  • 5MB per file, 60MB total
  • PNG input; PNG (single) or ZIP (batch) output
  • Fast response with Cloud Run auto-scaling

What Is PNG Trim?

PNG trim is the process of automatically cropping away the transparent pixels around the edges of a PNG image, shrinking the canvas down to the smallest rectangle that still contains all the opaque (or partially opaque) content. Most design and animation tools — Photoshop, Aseprite, Spine, game engine exporters — produce PNG files with large transparent margins, because the export canvas is typically sized to the artboard or the largest frame in a sequence rather than to the actual sprite.

That extra transparent padding is invisible to the eye but very real on disk and in memory. It inflates file sizes, wastes VRAM when the sprite is uploaded as a texture, and confuses bounding-box logic in game engines that rely on sprite dimensions for collision, layout, or hit-testing. A trim pass fixes all of these issues in one step by recalculating each sprite's true bounding box and exporting only the meaningful pixel region.

This tool runs that trim pass for you in your browser. Upload a single PNG or a whole batch, set an optional alpha threshold and padding value, and download either a single trimmed PNG or a ZIP of trimmed files. The original visual content and transparency are preserved exactly — the tool only removes empty margin pixels.

Why Trim Transparent Edges?

The most immediate benefit of trimming is smaller file sizes. Transparent padding still takes up pixel rows and columns in the PNG, and while compression handles large runs of transparency efficiently, eliminating them outright produces noticeably smaller files — often 30-70% reductions for sprites exported onto oversized canvases. Smaller files load faster, fit more comfortably into mobile memory budgets, and transfer faster over the network.

The second benefit is accurate bounding boxes. Game engines typically use a sprite's PNG dimensions as its default hitbox, pivot origin reference, and render extent. A sprite that's 128×128 pixels but contains a 40×60 character in the middle of an otherwise transparent canvas produces collision and alignment bugs because the engine sees a 128×128 hitbox. Trimming the PNG to its true content means your engine sees the real sprite size, and everything downstream — collisions, UI layouts, click targets, tooltip anchoring — works correctly without manual offsets.

Trimming also produces cleaner sprite atlases when you later pack sprites into a spritesheet. Bin-packing algorithms can only minimize the final atlas size when each input is already tight. If every sprite carries a 20-pixel transparent border, the packer wastes those pixels in every cell. Trim first, pack second, and you'll get a dramatically smaller and more efficient texture atlas.

How the Alpha Threshold Works

The trim algorithm scans each PNG pixel by pixel to find the tightest bounding box that encloses all non-empty pixels. The question of what counts as empty is controlled by the alpha threshold parameter. Alpha values range from 0 (fully transparent) to 255 (fully opaque). With a threshold of 0, only fully transparent pixels (alpha = 0) are treated as empty and trimmed; any pixel with alpha ≥ 1 is considered content and preserved.

Increasing the threshold makes the algorithm more aggressive. A threshold of 10 treats pixels with alpha 0-10 as empty — useful when your PNG has faint anti-aliasing ghosts or near-invisible noise pixels at the edges that you want stripped. Thresholds of 30-50 are appropriate when sprites have soft fading shadows or glow edges that you consider decorative rather than meaningful content. Going higher than 100 tends to trim visible semi-transparent effects, so use cautiously.

After finding the bounding box, the tool optionally adds a configurable padding — a transparent border of N pixels around the trimmed content. Padding is useful when you plan to pack the trimmed sprite into a spritesheet or apply bilinear filtering in-engine, because it prevents texture bleeding at the sprite's edge. A padding of 1-2 pixels is usually sufficient for most rendering pipelines.

How to Trim PNG Transparent Edges

1. Upload PNG Files

Drag and drop one or more PNG files onto the upload area, or click to open the file picker. Single-file mode produces a trimmed PNG; batch mode (two or more files) produces a ZIP containing every trimmed file, preserving original filenames. You can upload up to 100 PNGs per batch, with each file up to 5 MB and a combined total of 60 MB.

2. Set Alpha Threshold and Padding

Open the Trim Options panel to configure the alpha threshold (default 0) and padding (default 0 pixels). Keep the threshold at 0 if your PNGs have clean, fully transparent margins; bump it to 10-30 if anti-aliasing or compression artifacts leave faint ghost pixels at the edges. Set padding to 1-2 pixels if you plan to pack the output into a spritesheet or use bilinear texture filtering in a game engine, otherwise leave it at 0.

3. Run the Trim

Click the Trim button. The server calculates each PNG's content bounding box, crops the image to that rectangle (plus any padding you requested), and returns the result. Processing is fast — typically under a second for a single file, a few seconds for a full 100-file batch — because the algorithm only reads alpha values and performs a simple rectangular crop.

4. Download the Result

Single-file uploads return a trimmed PNG with a preview so you can inspect the result before downloading. Batch uploads return a ZIP containing every trimmed file, with filenames preserved from the originals for easy drop-in replacement in your asset folder. Click Download to save the file, or Trim Another to clear the workspace and start over.

Features

Single and Batch Mode

Drop in one PNG to get a single trimmed PNG back, or drop in up to 100 PNGs to get a ZIP with every file trimmed. Batch mode preserves original filenames so you can drop the extracted files straight back into your asset folder to replace the originals.

Configurable Alpha Threshold

Control exactly which pixels count as empty with an alpha threshold from 0 to 255. Leave it at 0 for strict trimming that only removes fully transparent pixels, or raise it to trim away anti-aliasing ghosts, faint shadows, and compression artifacts that you consider padding rather than content.

Optional Padding Preservation

Add a configurable pixel border of transparent padding around the trimmed content. This is useful when you plan to atlas-pack the sprite later, or when you want a small safety margin against bilinear filtering artifacts in a game engine. A padding of 1-2 pixels is typical for most rendering pipelines.

Full Alpha Preservation

Every alpha level in your source PNG is preserved exactly in the output. The trim operation only removes empty margin pixels — it never re-samples, re-compresses, or alters the visible content of your sprite. Semi-transparent edges, soft shadows, and partially transparent overlays come through untouched.

No Registration, Fast Processing

No sign-up, no account creation, no tracking. Open the page, upload PNGs, download results. Trimming is algorithmically simple — the server finds the bounding box and crops — so even large batches finish in seconds.

Privacy First

Your PNG files are processed on the server and discarded immediately after the response is returned. Nothing is stored, logged, or retained. No account is required, and no cookies are used for tracking your uploads.

Use Cases

Preparing Game Sprites for Packing

Export your character and prop sprites from Aseprite, Photoshop, or Spine with their full artboards intact, then run this tool to trim every file to its true content size. Trimmed sprites pack into dramatically smaller atlases — bin-packers only minimize space when each input is already tight, so removing transparent borders first can cut your final atlas size in half or more.

Cleaning UI Icon Exports

Design apps often export icons at fixed canvas sizes (256×256, 512×512) regardless of the actual icon dimensions. Run your icon exports through the trim tool to get crisp, correctly-sized assets where the icon fills the PNG. Bounding-box-driven UI systems will then size and position icons correctly without needing manual padding offsets in code.

Batch Trimming Animation Frames

Drop in a whole folder of animation frames exported from your animation tool — a walk cycle, an explosion sequence, a spell effect — and get a ZIP of all frames trimmed in one pass. This is the necessary first step before assembling frames into a spritesheet with the packed layout, because packed layouts rely on tight bounding boxes for efficient packing.

Reducing Sprite Atlas Size

If your existing sprite atlases are bigger than they should be, trimming the individual source PNGs before re-packing often reveals significant savings. Projects that trim aggressively before atlasing routinely see 40-60% smaller atlas textures, which translates directly to faster asset loads and lower VRAM usage — especially valuable for mobile and web builds.

Frequently Asked Questions