rembg removes the background from images. You give it a photo, and it finds the main subject, such as a person, a product or a pet, and gives you back a cut-out with a transparent background. It was created by Daniel Gatis in 2020 and has become the most widely used open source background remover, with more than 25,000 stars on GitHub.
It runs on your own computer, so photos aren't sent anywhere. You can use it from the command line, inside your own Python code, as a small local web page and server, or with Docker.
What it can do
- Cut out people, products and pets. It finds the subject automatically, with no clicking or tracing.
- A whole folder at once. Point it at a folder and it processes every photo, and it can watch a folder for new ones.
- A choice of AI models. BiRefNet for clean edges around hair and fur, a portrait model for people, a small fast model for older computers, and a model for anime artwork.
- Cleaner edges. Options for softer, more natural edges and for removing coloured fringes left by the old background, like Photoshop's Decontaminate Colors.
- A local web page and server. Start it as a small server with a simple page in your browser, or let your own apps send it images.
- Works with your graphics card. It runs on any computer, and faster on NVIDIA or AMD graphics cards.
Where you'll meet it
rembg is the engine behind a lot of other tools. Many background-removal apps, image editors and plugins on GitHub use it under the hood, and the same AI models it uses can also run inside a web browser through transformers.js. That's how you can build your own private background remover with an AI coding assistant, without writing the hard parts yourself.
rembg, remove.bg or Photoshop?
All three cut the background out of a photo. They differ in where your photos go and what they cost.
rembgThis pageBest forFree, private background removal in bulk
Runs on your own computer, handles whole folders and plugs into your own apps. Needs a little setup, and quality depends on the model you pick.
- How you use it
- Command line, a local web page, or inside your own code
- Open source
- Yes (MIT)
- Cost
- Free
Rremove.bg
Best forQuick one-off cut-outs in a browser
Very accurate and nothing to install, but full-size downloads cost credits and every photo is uploaded to its servers.
- How you use it
- A website, desktop app or API
- Open source
- No
- Cost
- Free previews; paid credits for full size
PhotoshopBest forCut-outs you'll touch up by hand
Remove Background is one click, and you can refine the result with Photoshop's tools. Needs a monthly subscription.
- How you use it
- A desktop app
- Open source
- No
- Cost
- Monthly subscription
A quick way to choose: one photo now and then? remove.bg is the fastest. Need to refine every edge by hand? Photoshop. Lots of photos, client work you'd rather not upload, or your own app? Use rembg.
How to get it
- For your own app: ask your AI coding assistant to "add background removal with rembg", or follow our guide to building a free background remover that never uploads a photo.
- On your computer: it needs Python 3.11 or newer. Install it with
pip install "rembg[cpu,cli]", or rembg[gpu,cli] for an NVIDIA graphics card. - Cut out one photo:
rembg i -m birefnet-general photo.jpg cutout.png - A whole folder:
rembg p -m birefnet-general photos/ cutouts/ - A local web page:
rembg s, then open the address it shows in your browser.
Good to know
- The default model isn't free for business use. rembg's default is BRIA's RMBG-2.0, which needs a paid agreement for commercial use. For client work, add
-m birefnet-general (MIT) or use u2net or isnet-general-use. Each model has its own licence, separate from rembg's. - The first time you use a model, it downloads it, from tens of megabytes up to about 1 GB for the largest. After that it works offline.
- It also includes two optional cloud options, withoutBG and Atlas Cloud. These send your images to their servers, so skip them if privacy matters.
- See-through things like glass, and very fine hair against busy backgrounds, can still need a touch-up in a photo editor.
- Licence: MIT. Free to use, change and include in products you sell, as long as you keep the copyright notice. The AI models have their own licences, so check the one you use.