Remove backgrounds with deep learning AI. Runs entirely in your browser — no upload, no server.
PNG, JPG, WebP, BMP — any size, mochi handles it all
After removing the background, use AI Upscale to enhance resolution, or Compress to optimize file size for web.
Browse All Tools →Remove backgrounds from any image using deep learning AI directly in your browser. imagemochi's background remover uses U2-Net, a state-of-the-art salient object detection neural network, to create precise masks that separate foreground subjects from backgrounds. Unlike cloud-based tools, your images never leave your device — all AI processing happens locally using WebGPU or WebAssembly. Perfect for product photos, profile pictures, social media content, and design work. Choose transparent output for compositing, or apply a solid color or frosted blur effect.
Background removal looks like a single operation but is actually three stacked problems: segmentation (which pixels belong to the subject), alpha blending (how opaque is each subject pixel), and edge refinement (how do we handle semi-transparent fringes like hair or glass). This page walks through how imagemochi's implementation solves each one.
U²-Net is a segmentation network originally proposed by Xuebin Qin and collaborators for salient object detection. The "U" in the name refers to a U-Net architecture — an encoder compresses spatial information into a bottleneck, a decoder reconstructs a full-resolution output, and skip connections between encoder and decoder layers preserve fine spatial detail. The "²" (squared) indicates a nested architecture where each encoder and decoder block is itself a U-shaped sub-network. The result is a model that's unusually good at edge precision relative to its parameter count.
We ship U²-Net Lite in two quantizations — 4.4 MB fp32 for maximum quality and a slightly smaller fp16 variant for devices that support half-precision WebGPU. The tool auto-selects based on your device capability. Both run via ONNX Runtime Web; on WebGPU-enabled browsers (Chrome, Edge, recent Safari) you get 5–10× speedup over the WASM fallback, but the WASM path still produces identical results, just slower.
A single-pass segmentation at the input resolution tends to miss small details — earrings, stray hair, background bokeh that shouldn't be foreground. Multi-scale inference runs the model at three input resolutions (full, half, quarter) and composites the masks together, letting small-scale features ride on the high-resolution pass and large-scale consistency come from the low-resolution pass. This is what makes it possible to remove backgrounds behind frizzy hair or glass without the mask collapsing into a silhouette.
Raw segmentation output is a binary mask: pixel is foreground (1) or background (0). Real objects have soft edges — hair strands, fabric fuzz, water droplets. The edge-refinement pass takes the binary mask and the original colour image, samples a narrow band around the mask boundary, and estimates a continuous alpha value (0.0–1.0) for each pixel in that band. We use a modified guided-filter approach: the colour image guides the alpha estimation, so the refined edge follows the actual subject silhouette rather than the approximate mask one.
The tool exposes two edge controls — "edge refine radius" (how wide the uncertainty band is, default 70 px) and "edge feather" (additional smoothing, default 0). Increase the radius for hair-heavy subjects or semi-transparent objects; keep it low for hard-edged subjects like products on a white background.
Subject on solid colour: fastest, cleanest result. Keep edge radius low (30–50). Export PNG to preserve transparency, or export JPEG with a white background fill for Amazon-compliant main images.
Focus on hair — increase edge radius to 80–100. Use the "preserve fine edges" preset, which runs an extra alpha-refinement pass on detected hair regions. Export PNG for compositing.
Run at full multi-scale with edge radius 70+. Expect some residual transparency in the mask — the model keeps the shape of the glass but alpha-blends through it. For pure cutouts, add a small desaturation and contrast bump afterward in Photo Editor.
The hardest case. Multi-scale inference is essential. Try both fp32 and fp16 models — depending on the image, one may catch more detail than the other. Expect to manually touch up a few strands in a dedicated editor for print-quality output.
The default output is PNG with a true alpha channel, ready for compositing. You can also export with a solid colour background (white for marketplace listings, chroma green for video keying) or a gradient fill. Colour management stays sRGB throughout — the model was trained on sRGB data and the output preserves the source's colour profile. If your input is in Adobe RGB or ProPhoto, we convert to sRGB on import and the output will be in sRGB. For wider-gamut workflows, export the alpha mask separately and composite in your colour-managed editor.
The model weights are the official Xuebin Qin U²-Net release, quantized by us for browser deployment. Weights are downloaded once and cached in IndexedDB. Your images never leave your device — verify in DevTools Network tab if you like. Anonymous performance telemetry (time, device, mask area) is collected; image content is not.
Batch mode (drop a folder, get a ZIP of transparent PNGs back) is Pro-gated because it's compute-heavy. Free accounts get unlimited single-file processing, forever. The Pro 30-day history also remembers your preferred edge settings across sessions, which is handy if you shoot consistent subjects. See pricing.
Curated multi-step recipes that build on this tool — drop an image, get the right output for the destination platform without configuring the steps yourself.