# CutItOut

CutItOut cuts the background out of an image and gives you back a full-resolution transparent PNG. It does the work in the browser tab, with no upload step and no account, which is the whole reason it exists — the commercial equivalents all want the image on their server and most of them watermark the result or cap the output resolution.

## How it works

The segmentation model is U2-Net, a salient-object detector, run through the `@imgly/background-removal` library. That library ships the model as ONNX and executes it with the ONNX runtime compiled to [[webassembly]], so inference happens in the page. Because there is no inference server, hosting cost is whatever a static site costs and the privacy claim is structural rather than a policy promise: the bytes never leave the device.

The rest is an editing surface on top of the mask the model produces. Automatic segmentation gets edges wrong on hair, glass and low-contrast boundaries, so there is a magic brush that adds or removes regions by colour similarity, a restore mode that shows the removed pixels as a ghost overlay while you paint them back, and zoom/pan for working at pixel scale. Export is full resolution.

The build is a Vite app, and the production output is a `dist/` directory that drops onto any static host.

```bash
git clone https://github.com/Suvink/cut-it-out.git
cd cut-it-out
npm install
npm run dev     # http://localhost:5173
npm run build   # dist/, deployable to Vercel, Netlify, Pages
```

## Limitations

The model and the runtime have to be downloaded before the first image can be processed, so the first use on a cold cache is slow and the tool is not usable offline until then. Inference is CPU-bound WebAssembly; large images on a modest laptop take noticeable seconds. U2-Net is a general salient-object model, not a portrait matting model, so it is decent on a single clear subject and weak on multiple subjects, fine hair and semi-transparent edges — hence the manual brush.

Almost all of the value here is in `@imgly/background-removal` and the U2-Net weights; CutItOut is the editing UI around them. That is not a criticism of the tool so much as a note on where the dependency risk sits. The repo has had no commits since the day it was published in December 2025, which for a small self-contained static app is closer to "finished" than "abandoned", but it does mean upstream model or runtime improvements won't arrive on their own.

Repo: [github.com/Suvink/cut-it-out](https://github.com/Suvink/cut-it-out) — ~435 stars, Apache-2.0, TypeScript.
