pngtoolskit.org
PNG and image utilities, in the browser
Workflows Sign in Create accountSign up

Remove Background (AI)

U²-Netp model · runs in your browser · transparent PNG, colour fill or mask · batch

Drop a photo and a small neural network finds the main subject and makes everything else transparent. The model runs here, in this tab, so the photo is never uploaded. It is a 4.4 MB model, not a server farm: it is good at one clear subject and soft around hair and fine detail. If your background is one flat colour, Fill or remove a background colour is exact and needs no model at all.

Drop photos here

JPG, PNG, WebP — multiple files allowed

    First run downloads 7.1 MB: ONNX Runtime (2.7 MB, jsDelivr) and the U²-Netp model (4.4 MB, Hugging Face). Your image is never sent anywhere — the model runs in this tab.

    no files
    Ready.

    How to remove a background

    1. Drop one or more photos, click the box to browse, or paste an image with Ctrl/⌘+V.
    2. Choose the output: a transparent PNG, the subject on a colour of your choice, or the mask on its own.
    3. Press Remove background. The first run downloads the model (the size is shown above before anything is fetched); after that, each image takes a moment.
    4. Check the edges in the preview on the checkerboard, then download — or download all as one ZIP.

    What the model does, and where it struggles

    U²-Netp is the small version of U²-Net, a network published in 2020 for salient object detection: for every pixel it estimates how likely that pixel belongs to the most prominent object in the picture. That estimate becomes the alpha channel. It has no idea what a "person" or a "product" is — it picks out whatever stands out — which is why it works best on the kind of photo where the answer is obvious: one subject, in focus, against a background that is not as busy as the subject.

    The model always looks at a 320×320 version of your image, and its answer is scaled back up to your size. On a 3,200-pixel-wide photo, each point of the mask therefore covers a strip of photo about ten pixels wide. Outlines come out smooth; individual hairs, the gaps in a bicycle wheel and thin straps do not. Several subjects, a subject that fills the whole frame, or a subject the same colour as its background, are the cases most likely to need a second look.

    The edge setting

    For a soft fade-out after the fact, run the result through Feather edges; to crop the new transparent border away, Auto-trim.

    The download, and why nothing is uploaded

    There is no server-side step. Your browser downloads two things the first time you press the button: ONNX Runtime Web (2.7 MB, MIT licence) from jsDelivr, the engine that runs the network, and the U²-Netp weights (4.4 MB, Apache-2.0 licence) from Hugging Face. The model file is checked against its SHA-256 fingerprint before it is used, and then kept in your browser's cache storage, so the next visit starts without downloading it again. The photo itself is only ever read by the page.

    The full-size U²-Net is about 168 MB — too heavy to download into a web page for a one-off job — which is why this uses the small one.

    FAQ

    Is my photo uploaded?

    No. The model is downloaded to your browser and runs there. Open your browser's Network panel while it works: after the one-time model download, nothing is sent.

    Can I use the results commercially?

    The output images are yours. The model is released under the Apache-2.0 licence and ONNX Runtime under MIT, both of which permit commercial use, and nothing here adds a watermark or a size limit.

    How is this different from the Background tool?

    Background removes one flat colour that you pick, exactly, pixel by pixel — ideal for a logo on white or a sprite on magenta. This page guesses the subject in a photo where the background is not a single colour. If your background is flat, the colour tool will give the cleaner edge.

    It kept part of the background, or cut off part of the subject.

    Crop closer to the subject first with Crop, so it is clearly the most prominent thing in the frame, then run it again. Hair and fine detail will always be approximate with a model this small.

    What does the mask output give me?

    White where the subject is, black where the background is, greys at the edges. Use it as a layer mask in an image editor, or apply it to another version of the same picture with Apply alpha mask.

    Part of: Cut a product out of its photo

    Remove the background before trimming: the trim can only find the edge once the background is transparent.

    1. 1 Remove background Let the model find the product and clear the rest
    2. 2 Auto-trim Crop to the product itself
    3. 3 Square Pad to the square most shop listings ask for
    4. 4 Drop shadow A soft shadow so it does not float
    5. 5 PNG to WebP Small enough for the listing, transparency intact

    All 29 step-by-step workflows