Scan the four sides, find rows and columns that are all the same colour, and crop them away in one click.
The screenshot below was taken in this tool with a real file and the stated settings — it is not a mock-up.
Note: All processing happens in your browser: images are never uploaded. Gradients and shadows are the known limit of this automatic method.
The tool reads the image into a pixel buffer, samples the border colour from the four corners, then walks inward: a row is considered empty when all sampled pixels match that colour within the tolerance, and likewise for columns. The bounding box of non-empty pixels is kept.
It is a deterministic formula, not a learned model. That means gradients, drop shadows and anti-aliased edges can be misread as content — the tolerance slider and the result readout let you check before downloading.
The tool does not look for white. It builds a reference colour and then asks, for each pixel, whether that pixel is close enough to the reference. Two things decide the answer:
Fully transparent pixels count as background regardless of their colour, because their alpha is below 16. Transparent padding therefore disappears without any tolerance fiddling.
Each row is tested by stepping across it in strides of max(1, floor(width / 240)) pixels — at most about 240 samples per row, and the same rule vertically for columns. On a 3000 px wide image that is a sample every 12 px. A one-pixel hairline running the full width, or a spike of content that happens to land between samples, can be missed, and the row is then judged empty and removed. This is the mechanical explanation for "it cut off a thin part of my chart": the scan is a sampler, and the sampler skipped it.
The four sides are trimmed in sequence — top, bottom, left, right — and each pass searches within the original bounds. A border that is only present on the left and right is handled correctly. A border interrupted by a bright element touching one edge stops that edge's pass at the interruption, which is why a scan with a page number in the margin often keeps a thin strip.
The second mode additionally clears the four corner wedges left behind by rounded corners and anti-aliased edges. It does this with a flood fill seeded from each corner, following pixels that match that corner's own colour, and setting their alpha to zero. The fill is skipped entirely when width × height exceeds four million pixels — a number that is reachable here, since the working canvas allows up to 3000 × 3000. Above that the result note says corner cleanup was skipped, and the output keeps its wedge-shaped corners. If that happens, run the trim on a smaller copy, or clear the corners with the Rounded Corners tool after trimming.
After processing, the line under the preview reports the pixels removed from the left, right, top and bottom, followed by the new dimensions. Those four numbers are the fastest way to catch a bad pass: if the left value is zero on a scan that clearly has a margin, the reference colour is wrong. If the top value is hundreds of pixels on a document with a header, the tolerance is too high. Nothing is written to disk until the download button is pressed, so an incorrect pass costs one more click, not a lost file.
Output is a PNG at the trimmed size with the original alpha preserved. There is no undo, so the untouched upload remains the master copy.