rembg

25.2k GitHub starsdanielgatis/rembg

The most popular free background remover on GitHub. Cut people and products out of photos on your own computer, one image or a whole folder.

View on GitHub

Build a stack with rembg

Pick parts from it and the projects that work well with it. We check the licences together and write a prompt for your AI.

rembg
Squoosh
Filee

Your stack

Tick the parts you want to use. Projects whose parts are not listed yet can be added whole; the prompt tells your AI to find the right pieces in their code.

More actions

Why we picked it

rembg is the free, open source answer to remove.bg. Give it a photo and it cuts out the subject, from people and pets to products, with no credits, no watermarks and no uploads. It runs on your own computer, handles a whole folder at once, and can run as a small local website or server that other apps call. It's MIT licensed and has been around since 2020, with more than 25,000 GitHub stars and regular releases. One thing to know: its default AI model isn't free for commercial use, so for client work pick the BiRefNet model instead.

About rembg

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 page

Best 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
remove.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
Photoshop

Best 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.

What you can build with it

  • Cutting out product photos for an online shop
  • Removing the background from portraits and team photos
  • Processing a whole folder of photos at once
  • Adding background removal to your own app or website
  • Making transparent PNGs for slides, thumbnails and social posts

Works well with

  • Squoosh

    26.1k GitHub stars

    Google's free image compressor that works in your browser. Make images much smaller as WEBP, AVIF or JPG, and compare before and after side by side.

    • Photo & media
    • Apache 2.0
  • Filee

    12.2k GitHub stars

    A free file converter you use by dragging: drop files on a format at your cursor. 244+ formats, works offline, no Office or uploads needed.

    • Photo & media
    • File sync & storage
    • MIT License

Comments

No comments yet. Be the first to share your thoughts.