Delete a Margin from a PNG
Trim peripheral margin space so content sits edge-to-edge. Runs entirely in your browser, so your data never leaves your device.
Drop a file here, or click to browse
Files never leave your device
Output
The result appears here as you type.
How to use Delete a Margin from a PNG
- 1. Load the PNG with excess margin. Add a PNG that has empty or uniform space around its actual content, such as a logo with extra transparent padding on every side.
- 2. Adjust the Detection tolerance (%). Set how strict the edge detection should be. A low tolerance only trims pixels that match the border color exactly; a higher one also removes near-matching pixels like faint gradients.
- 3. Download the trimmed PNG. Check the preview to confirm the content now sits edge-to-edge, then download the cropped file. Only the surrounding margin is removed, the artwork itself is untouched.
When to use Delete a Margin from a PNG
Delete a Margin from a PNG trims the empty space surrounding the actual content of an image, so the file's canvas matches its visible artwork. It solves the common problem of exported assets carrying extra padding that a layout does not want.
- Cleaning up an exported logo. A logo exported from a design tool has a wide transparent margin baked into the canvas. Trimming it lets the logo sit flush against other elements in a header without manual offset adjustments.
- Fixing an icon set for a sprite sheet. Icons exported from different artists carry inconsistent padding around the same visual size. Running each one through the trimmer normalizes them before packing into a sprite sheet.
- Preparing a badge for an app icon slot. A badge graphic has extra whitespace that makes it look small once placed in a fixed-size icon container. Trimming the margin lets the artwork fill the available space properly.
- Removing scanner border artifacts. A scanned document saved as PNG picked up a gray border from the scanner bed. Increasing the detection tolerance clears that uneven border along with the blank margin.
Examples
Reset to content edges
Input
logo.png with transparent margin
Output
logo.png trimmed to its content bounds
About the Delete a Margin from a PNG tool
Delete a Margin from a PNG runs as plain JavaScript in your browser tab, with no server behind it. Trim peripheral margin space so content sits edge-to-edge. Whatever you put in stays on your device from start to finish.
The tool is part of EditSafely's PNG Tools section, 108 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.
You can shape the output with the Detection tolerance (%) setting, and the result refreshes the moment you change it. The finished file is put together in browser memory and saved with the Download button, so it never touches a server on the way to your disk. A worked example further down the page shows exactly what the tool produces for a real input.
That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.
Frequently asked questions
Does Delete a Margin from a PNG cost anything?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Are my files uploaded to a server?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
Which files does Delete a Margin from a PNG accept?
It accepts PNG images. There is no file size cap imposed by a server; very large files are limited only by your device's memory.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
How do I save the output?
Click the Download button once the result is ready. The file is built in your browser's memory and handed straight to your downloads folder, without passing through a server.