Trim Images Online
Automatically detect and remove empty pixels from image edges. Minimize image dimensions by trimming transparent or solid color borders.
Drop images here or click to upload
Supports JPG, PNG, GIF, WEBP, SVG
What Trim Image Does
Trim Image scans your picture's pixels from each of the four edges toward the center and finds where the uniform border stops and the actual subject begins. In Transparent mode it reads the alpha channel and walks inward, row by row and column by column, until it reaches a pixel that isn't fully transparent. In Background Color mode it compares every edge pixel's RGB value against a reference color — either sampled automatically with Auto-detect or set manually via Color to trim — and keeps walking inward as long as pixels stay within the Tolerance you've set, from 0 (only an exact color match counts as border) up to 255 (almost any color is treated as border). Once the scan stops on all four sides, those boundary lines define a bounding box, the canvas is cropped to it, and any Padding you've set is added back as margin on every side. What it won't do: clean up a border that isn't actually uniform. A gradient backdrop, a soft drop shadow, or JPEG compression noise near the edge won't collapse into one clean trimmed line — you'll get a partial trim or none at all depending on how high you push Tolerance. Edge Connected mode changes what counts as trimmable background in Background Color mode: instead of matching any pixel in the image against the reference color, it only removes background-colored pixels that are contiguously connected to the outer edge, so a patch of the same color sitting inside the subject — a highlight, an accent, a hole in the design — doesn't get chewed into by mistake. Everything here runs by reading canvas pixel data directly in your browser; the trim calculation itself never leaves your device.
Why Trim Matters
Product photos exported from a studio setup or a marketplace template often carry inconsistent margins — one shot has an inch of white space on the left, the next has almost none, and stacking them into a catalog grid produces uneven-looking thumbnails even though every canvas is the same size. Trim removes that inconsistency by cropping each image to its actual content instead of making you eyeball a marquee selection file by file. Game and app icon assets exported from design tools frequently bake in transparent padding — the real artwork is 96x96 sitting inside a 128x128 canvas. That extra alpha margin throws off sprite atlases, misaligns pixel-perfect anchor points, and wastes texture memory at scale; trimming to the alpha bounding box fixes the asset without touching the artwork itself. Screenshots captured with window chrome, browser toolbars, or a solid desktop background around the real content need the same cleanup before they go into documentation or a support ticket — Background Color mode with a sampled edge color strips that frame in one pass instead of a manual crop. Scanned stickers, logos, or line art saved on a plain white or flat-color canvas benefit the same way: trimming reduces the file to its real footprint before it's dropped into a layout or layered in another editor, and Edge Connected mode keeps that safe even when the artwork itself contains shapes that match the background color.
How to Trim an Image
Trimming is a detection pass followed by a single crop, so most of the work is picking the right settings before you apply it.
Pick a Detection Mode: Transparent for PNGs with alpha-channel edges, or Background Color for flat-color borders on any format.
In Background Color mode, click Auto-detect to sample the border color or set Color to trim manually, then adjust Tolerance until the preview outline hugs the subject.
Set Padding if you want a small margin left after trimming instead of a flush crop, and turn on Edge Connected if the subject contains areas matching the border color that shouldn't be trimmed.
If the border isn't a flat color at all, toggle Remove background before trimming first, then apply to crop the canvas to the detected bounding box.
Frequently Asked Questions
More Image Tools
Explore other powerful tools for your image editing needs
Compress Image
Reduce file size
Resize Image
Change dimensions
Crop Image
Cut out area
Convert Format
Change format
Photo Editor
Edit photos
Rotate Image
Rotate image
Flip Image
Horizontal/Vertical
Add Watermark
Add watermark
Add Border
Add image border
Rounded Corners
Add rounded corners
Filters
Brightness/Contrast
Blur Face
Hide faces
Mosaic
Blur regions
Remove Background
Remove BG
Enhance Image
AI upscale
Add Text
Add text to image
Collage
Combine multiple images
HTML to Image
Webpage to image
GIF to Image
Extract frames
Batch Rename Images
Safely rename files in bulk
Circle Crop
Crop images into circles
Black & White
Convert images to grayscale
Split Image
Cut an image into a grid
Merge Images
Combine images into one
Change DPI
Set image DPI metadata
Image to Base64
Encode images as Base64
Image to PDF
Combine images into one PDF
HEIC to JPG
Convert iPhone HEIC photos to JPG
EXIF Remover
View and strip hidden photo metadata, including GPS location
Favicon Generator
Full icon set plus HTML
Color Palette
Extract colors from an image
Base64 to Image
Decode Base64 back to an image
HEIC to PNG
Convert iPhone HEIC photos to lossless PNG
Text Behind Image
Put text behind the subject of a photo, entirely in your browser
Color Picker
Get the HEX, RGB and HSL of any pixel
Signature Maker
Draw a signature and download it as a transparent PNG
Signature Background Remover
Ink from paper, on transparency
Transparent Background Maker
Make a background transparent