Remove an image background on a CPU with rembg

Our rembg test: on the left, the self-made input, a red circle with a yellow square on a green background; on the right, the output with the green removed, leaving the circle and square on a transparent checkerboard
Left: our self-made input. Right: rembg output.

We tested rembg on Oct 15 with a self-made test image: a red circle with a yellow square on a green background. rembg (MIT) with the u2netp model (Apache-2.0, from U-2-Net) took about 3.7 s wall-clock on an 8-vCPU CPU-only machine, including the first-run model download. The green background was removed and the circle and square were kept, with a faint gray edge around the circle.

Try it yourself

What you get

A PNG with the background removed and a transparent backdrop, with no GPU.

Tools

  • rembg (MIT)
  • u2netp model (Apache-2.0, from U-2-Net)

Time / cost: About 3.7 s wall-clock on an 8-vCPU CPU-only machine, including the first-run model download

Steps

  1. Install it with pip install "rembg[cpu,cli]" (we used rembg 2.0.85).
  2. Run rembg i -m u2netp input.png output.png; the first run downloads the small u2netp model.
  3. Open the output PNG and check the edges: ours had a faint gray rim around the shape.
  4. We only tested a simple self-made image, not photos of people, hair or busy backgrounds; check those by hand.

Watch out: rembg is MIT; the u2netp model is Apache-2.0 (from U-2-Net). No region limits. One simple test image only.

Proof / source

Tested by AgentPlays Our own test on Oct 15, 2026, on an 8-vCPU machine, CPU only: input image, output image and timing log.

Read the original source ↗ Discussion ↗

Added · How we verify · Report an error

Related