Skip to content

Design guides for brands, campaigns, and vectors.GuidesCut a subject out of a photo, locally

Cut a subject out of a photo, locally

Twelve product shots, all on the wrong background, and the client's photos aren't allowed to leave your machine. Remove background runs entirely in your browser, so nothing does leave. This is the order to work in, and what to do when the automatic pass gets the edge wrong.

What you're working with

Remove background is a Forma tool. On the Forma host it's at /remove-background; from the Gesso host the same tool is served under /forma/remove-background.

Everything runs on your device, and the page's own promise is the accurate one: no account, no upload, the model and work stay in this browser. Feed it a PNG or JPEG up to 15 MiB, and you get back a transparent PNG you download.

Drop an image on the canvas, paste from the clipboard, or use Choose image.

Start with the one-tap path

The Approach control has two options, and the tool opens on the first one.

Background color is the one-tap path. It keys out a color, and it's at its best on flat, studio, and product backgrounds. The Color range slider widens or narrows how much of the neighboring color goes with it. Range runs 0 to 40, and the default is 12. Every commit of that slider re-keys the image and discards your corrections, so get the range roughly right before you start painting.

Draw a box hands the picture to the subject model instead. Drag a rectangle around what you want to keep, then correct it afterwards by painting.

The tool rail above these gives you the same moves as buttons. Auto runs the automatic pass again. Sample lets you click a background color directly on the canvas. Erase and Restore switch the brush, and they stay disabled until a subject exists. The panel explains why: Available once a box or the subject model has defined a subject.

When the picture has no single background color

Some photographs get turned away by the color path with this message:

This picture has no single background color. Draw a box around the subject instead.

Read that as routing, not failure. The tool worked out before spending any real effort that this picture needs the subject model rather than a color key.

Draw the box, and three stages report in sequence the first time:

  1. Downloading the subject model, one time only, reported as a percentage. It's roughly 190 MB, it's kept in this browser, and later images start instantly.
  2. Preparing the subject model…
  3. Finding the subject…

While the model works, the deterministic result is already on screen, so you're never staring at nothing. The prediction replaces it when it lands. If the prediction turns out to belong to an image you've since replaced, it gets thrown away rather than applied to the wrong picture.

If the model stops, you get one of two messages, and both end the same way:

The subject model stopped responding. Draw a box around the subject instead.

The subject model could not finish here. Draw a box around the subject instead.

Neither one is a verdict on your photo. The box path is still right there, and it's predictable.

Correct the edge by painting

Once a subject exists, the brush becomes your main tool.

  • Keep paints back anything the cut removed by mistake.
  • Erase removes anything it left behind.
  • Brush size runs 4 to 96, defaulting to 24.

Two view controls make the mistakes visible instead of leaving you to squint:

  • Show removed area puts the whole picture back with everything the cut discards tinted. It's the fastest way to find a chunk of hair the model dropped.
  • Preview background switches between checkerboard, white, and black. Dark fringes hide on a checkerboard and are obvious on white.

Zoom with Fit and 100%, and hold Space and drag to pan.

Undo last stroke takes back one correction at a time. Redo only appears when the local engine build supports it. Start over throws away the corrections and returns you to the color approach with the image still loaded.

The lasso is the correction path, not a starting point

When the engine build exposes them, two more tools appear in the rail.

Lasso takes a freehand path. Draw around the region, and on release Gesso closes the path into a polygon and applies it in the direction of whichever brush is selected. With Erase active it cuts the region away; with Keep active it brings the region back. The prompt on the canvas is Draw around the area to remove.

Magnetic lasso does the same thing, but first asks the local engine to pull your path onto the nearest real edge. The canvas shows Finding edge… while it works. When the edge search can't help, the tool doesn't stall or throw away your work. It commits the path you drew and tells you: Using the path you drew. The prompt here is Draw around the edge to remove.

Use the lasso when the model is nearly right and wrong in one specific place. A hard-edged object against a busy background. A shadow that should have gone. A strap the model swallowed. It's a scalpel over a region, and it will save you forty brush strokes.

Two practical limits. A path needs at least three points to close. And draw at a steady pace rather than flicking, because the tool samples points by distance, so a very fast drag gives the edge search less to work with.

Soften the edge, then download

Edge softness controls how wide a band gets partial transparency instead of a hard cut. It runs 0 to 8, default 2.

Where you land depends on where the cutout is going. Composite against a similar background and a 0 or 1 edge stays crisp. Composite against a very different color and a hard cut reads as a sticker pasted on top, so 2 to 4 does more for you. Change it after your corrections, never before. It's a property of the finished mask.

Then Download PNG. The file is named after your source file with the extension swapped, so hero-shot.jpg comes down as hero-shot.png. The tool confirms with PNG downloaded.

Working order that avoids re-doing things

  1. Load the image and let the automatic pass run.
  2. Settle the color range, or draw the box, before touching a brush. Both re-key the mask and discard corrections.
  3. Turn on Show removed area and switch the preview background to something that contrasts with the subject.
  4. Fix large mistakes with the lasso, small ones with the brush.
  5. Set edge softness last.
  6. Download, and check the PNG against the background it will actually sit on.

When something goes wrong

MessageWhat to do
Choose a PNG or JPEG no larger than 15 MiB.Downscale or re-encode before loading.
That file could not be read as a PNG or JPEG.The bytes aren't a PNG or JPEG, whatever the extension says. Re-export the file.
That image is too large to work on in the browser.Reduce the pixel dimensions, not just the file size.
Draw a box around the subject first.The brush needs a subject to work against. Draw the box.
That took too long and was stopped. Try again with a smaller image.A run passed its deadline. A smaller image is the reliable fix.
The local engine stopped unexpectedly. Load the image again.Reload the image. The session is gone, the tool isn't.
This browser cannot run WebAssembly, which this tool needs.Use a browser that does. Nothing in this tool works without it.

Common questions

No. The tool says so plainly on the page: no account, no upload, and the model and work stay in this browser. The subject model comes from the same origin as the app, is verified against a pinned SHA-256, and runs in a local WebAssembly worker.