By Tim King · Updated
Auto Crop Image Online
Trim Whitespace and Transparent Pixels Around a Picture, Save as PNG
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Auto Crop Image works
Auto crop image borders in one step, with nothing uploaded. Drop in a screenshot, scan, logo or product shot with too much empty space around it and the blank border is trimmed away automatically. The tool works out what the background is, finds the smallest box that holds everything else, and crops to it, adding back as much padding as you ask for. The image stays in your browser.
Cropping by hand means dragging handles until the edges look right, and doing it for fifty product photos is tedious. Auto-cropping replaces the dragging with a rule: every pixel is either background or content, and the crop is the tightest rectangle around the content. The rule that decides which is which is the only thing you need to set.
Why empty margins cost more than they look
Whitespace around an image is not free. On a web page, an image with a 20% border on every side spends over half its pixels on nothing, and the subject is displayed smaller than it needs to be in whatever box the layout gives it. Marketplaces notice: Amazon's main-image rules ask for a pure white background with the product filling at least 85% of the frame, and Etsy and eBay thumbnails are cropped to a square that punishes a small subject. Logos with transparent padding sit off centre in headers and email signatures because the layout aligns the box, not the ink. Removing the margin first, then adding back a deliberate, consistent amount, fixes all of these.
Where it gets used
- Product photos shot on a white sweep or light tent, where every picture has a slightly different margin.
- Screenshots with a desktop or window border around the part you want to show.
- Scanned documents, receipts and artwork, which come off a flatbed with a band of white or grey around the page.
- Logos, icons and signatures exported with a generous transparent canvas.
- Charts saved from spreadsheets with a wide white frame.
How auto crop image detection chooses the background
Treat as background picks the reference. Edge colour, the default, averages the outermost ring of pixels and treats that colour as the background, which handles white, off-white, grey and coloured backdrops without you having to say which. White and black are fixed references for the common cases. Transparency ignores colour entirely and treats any pixel with low alpha as background, which is the right choice for logos and icons saved as PNG with a transparent margin.
Tolerance sets how far a pixel may differ from that reference and still count as background. At zero only an exact match is trimmed; a little tolerance lets JPEG noise, faint scanner shading and slight gradients be treated as empty; too much starts to eat into pale content such as light text or a white shirt. Ten is a sensible default for most screenshots and scans.
Once the mask is built, the tool finds every content pixel and takes their bounding rectangle, then widens it by the padding you choose so the result is not cramped against its edges.
Tips and pitfalls
- One stray pixel sets the box. Dust on a scan, a watermark in a corner or a shadow at the edge counts as content, and the crop will stretch to include it. If the box is much bigger than expected, raise the tolerance a little or clean the speck first.
- Shadows are content. A product with a soft drop shadow gets cropped around the shadow, not the product. That is usually what you want for a catalogue, but raise the tolerance if not.
- Vignetted or gradient backdrops fool the edge-colour average. Pick White or Black explicitly, or accept a looser crop.
- Use the same padding across a set. Consistent padding is what makes a grid of product shots look like a range rather than a pile. 20 to 40 pixels suits most thumbnails.
- Crop, then shape. Auto-crop finds the content; it does not force an aspect ratio. For a square marketplace image, run the result through the Aspect Ratio Cropper or the Image Resizer afterwards.
- Need a transparent background instead? The Photo Background Remover cuts the subject out; this tool only trims around it.
How to read the result
The stats list the source size, the background colour or mode it used, the content box it found (its width, height and the top-left corner's position) and the output size with the percentage of the original area removed. A product photo on a sweep typically loses 30–60%; a screenshot with a window border might lose 5–15%. If the removed figure is close to zero, the background guess was probably wrong — check the Background line and switch to a fixed reference. If every pixel matched the background the image is returned unchanged with a note. The output is always a PNG, so transparent margins stay transparent and nothing is recompressed; images larger than 4000 pixels on the long side are scaled to fit before cropping. For publishing, the post on how to compress an image for the web covers the next step.
FAQ
Why did it crop into the picture itself?
The tolerance is too high, or the content near the edge is close to the background colour, such as light text on white. Lower the tolerance, or switch the background reference from Edge colour to a fixed White or Black.
Why was nothing trimmed?
The border is not a flat colour. Scanner shading, a gradient or a drop shadow differs from the edge colour by more than the tolerance, so it counts as content. Raise the tolerance a few steps at a time until the box tightens.
Can I crop a batch of images at once?
No, one image at a time. The settings stay put between drops, so a run of similar product shots is quick: drop, download, drop the next.
Why is the output a PNG when I gave it a JPEG?
So transparent margins stay transparent and nothing is recompressed. If you need a smaller file, run the result through the image to WebP tool once the crop is right.
See also: all Images tools, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.
Related tools
Aspect Ratio Cropper
Crop to a standard ratio without shrinking the picture.
Image Resizer
Resize to a width, height or percent with the aspect ratio locked.
Photo Background Remover
Cut a person out of a photo into a transparent PNG. Nothing uploaded.
Image To WebP
Convert to WebP, JPEG or PNG with a quality slider.
Circle Crop Image
Crop a photo to a circle, oval or rounded rectangle.