Remove background from multiple images offline with rembg: one install, one folder command, no upload.
Short answer: install the free, open source tool rembg, then run one command on a folder: rembg p -m u2net photos cutouts. Every photo in photos comes out as a see-through PNG in cutouts, made on your own computer. Nothing is uploaded. Pick the model on purpose, because the default one is huge and can crash a normal laptop.

You have 200 product photos and a shop that wants clean cutouts. The usual online remover takes one photo at a time, uploads each one to someone else’s server, and charges for the full-size result. On remove.bg, the free download is a small preview of up to 0.25 megapixels, and every full-resolution cutout costs one credit.
That gets slow and expensive fast. It also means your photos leave your machine, which matters for client work, ID scans or anything private.
This post shows the offline way, step by step. I ran it on real photos, timed five models, and found one thing the setup guides skip: bigger is not better here, and the default model is the wrong pick for most people.
What does removing a background actually mean?

A computer does not see a cup on a table. It sees a grid of colored dots, and it has to guess which dots belong to the cup. Start from the base. A digital photo is made of pixels (tiny colored squares). Each pixel stores three numbers: how much red, green and blue it has. Your screen mixes those three to show one color.
Now add a fourth number. The alpha channel (a number for how solid a pixel is) runs from 0 to 255. At 255 the pixel is fully visible. At 0 it is invisible, so whatever sits behind it shows through. That checkerboard you see in editors is just “nothing here.”

So removing a background means one job: set alpha to 0 for every background pixel and leave it at 255 for the subject. Soft edges like hair get values in between, so they blend instead of looking cut with scissors.
That is also why the output must be PNG. JPG has no alpha channel, so it cannot store “see-through.”
How does the AI know which pixels to keep?
It paints a mask, a black and white copy of your photo where white means keep and black means drop. The tool behind this is a segmentation model (an AI trained to sort every pixel into “object” or “not object”). It learned from thousands of photos where people had already traced the subject by hand. After enough examples, it can trace new photos on its own.
Think of it like a stencil. The model cuts the stencil, and the tool lays it over your photo. White parts of the stencil keep their pixels. Black parts get alpha 0.
rembg (short for “remove background”) is a free, open source wrapper around many of these models. You install it once, it downloads the model you choose the first time you use it, and from then on it runs fully offline. It works as a command, a Python library, or a small local web server.
How do I install rembg?
One install command, and you need Python 3.11 or newer. Open a terminal and run:
pip install "rembg[cpu,cli]"The cpu part installs the engine that runs models on your normal processor. The cli part adds the rembg command. If you have an NVIDIA graphics card, swap cpu for gpu. A GPU (graphics chip that does AI math in parallel) makes every model much faster.
Then download the model you plan to use while you still have internet:
rembg d u2netAfter that, the internet is optional. I tested this by cutting off the network completely: a downloaded model still processed photos fine. A model I had not downloaded yet failed with a connection error. So download first, then go offline.
How do I remove the background from a whole folder?
Use the p command (for “folder”) and point it at an input folder and an output folder.
rembg p -m u2net photos cutoutsThat is the whole batch job. rembg loads the model once, walks through every image, and writes a PNG with the same name into cutouts. On my test machine, seven photos took about 8 seconds with this model. A smoke on this box with rembg and u2netp processed one 400×300 PNG to RGBA in about 1.5 seconds after a 4.57 MB download (Asia/Calcutta, 9 Nov 2026).

Three options are worth knowing:
-bgc 255 255 255 255puts a solid white background behind the subject instead of transparency. Good for shop listings that need white.-wkeeps watching the folder, so any photo you drop in later gets processed automatically.-omsaves only the black and white mask, handy if you want to edit edges in another app.
One option to avoid unless you mean it: -d deletes each original after processing. Keep your originals.
Which rembg model is best?
For most photos, u2net. For fur, hair and fine edges, isnet-general-use. Not the default.
This is where the trap sits. If you run rembg without -m, it uses bria-rmbg, a model of about 1 GB that works on a large 1024 by 1024 version of every photo. Big model, big input, big memory use.
So I tested. Seven real photos: animals, a cat close-up, a portrait and an espresso cup. One machine with 2 CPU cores, about 7 GB of memory and no GPU.

Here is what happened:
- u2netp (4.4 MB download): about 0.5 seconds per photo, peak memory about 740 MB.
- u2net (168 MB): about 1.1 seconds per photo, about 1.2 GB of memory.
- isnet-general-use (171 MB): about 2.9 seconds per photo, about 1.9 GB of memory.
- birefnet-general-lite (214 MB): killed by the system for running out of memory.
- bria-rmbg, the default (977 MB on disk): also killed for running out of memory.
What this means for you: on an everyday laptop with no graphics card, the default can simply die halfway. That is not a bug in your setup. It is a model sized for stronger hardware.
And the quality gap is smaller than the size gap. On the espresso cup and the portrait, the tiny 4.4 MB model gave a cutout almost as clean as the 171 MB one. The bigger models earned their keep only on the cat close-up, where whiskers and soft fur confused the small ones and left blotchy patches.

The catch: seven photos is a small test, and one machine is one machine. With a GPU or 16 GB of memory, the big models will run, and their edges are sharper. Still, start small. Move up only when you can see the edges failing.
Can I use these cutouts for commercial work?
rembg itself is MIT licensed, so it is free to use, but each model carries its own license, and the default one does not allow free commercial use. This part is easy to miss. The rembg code is under the MIT license, which lets you use it for almost anything. The model files are separate. The rembg docs say the default model, RMBG-2.0 from BRIA AI, “requires a paid agreement for commercial use.”
The older models come from projects published under the Apache 2.0 license, which does allow commercial use. That covers u2net, u2netp (both from the U-2-Net project) and isnet-general-use (from the DIS project).
So if you sell products, run a client business, or plan to ship this inside an app, pick u2net or isnet-general-use on purpose. That one flag keeps you clear of a license problem you never agreed to.
Is offline as good as remove.bg?
For clean product photos, close enough that most shoppers will not notice. For messy hair and busy scenes, a paid service can still look better. Paid tools have one real edge. They run larger models on strong servers, so fine hair and see-through objects like glass often come out cleaner. If you edit a few hero portraits a month, paying per image can be worth it.
But for batches, the math flips. A folder of 500 product shots costs 500 credits online. Offline, it costs a few minutes of your computer’s time, and no photo ever leaves it.

There is also a middle path. Run rembg on the whole folder first, then send only the handful of failed cutouts to a paid tool. You pay for 5 photos instead of 500.
Quick fixes when a cutout looks wrong
Most bad results come from the photo, not the tool, so fix the input first. – Subject fills the whole frame: the model has little background to compare against. Shoot with some space around the subject.
- Subject and background are the same color: a white mug on a white table is hard for every model. Use a contrasting backdrop.
- Fuzzy edges or halo: try
isnet-general-use, or add-ppm, which cleans up the mask edges. - Color fringe on soft edges: add
-dc, which removes leftover background color from semi-transparent pixels. - Process killed or freezes: you are probably on a model too big for your memory. Switch to
u2netoru2netp.
Start with u2net on a copy of your folder. Look at ten cutouts. Then decide if you need anything bigger.
Common questions about removing backgrounds offline
Can I remove backgrounds from images without uploading them?
Yes. Tools like rembg run the AI model on your own computer, so photos never leave it. After the first model download, it works with no internet at all.
What is the best free bulk background remover?
For offline batches, rembg with the u2net model is a strong free choice. One command processes an entire folder and saves transparent PNGs.
Does rembg need a GPU?
No. It runs on a normal CPU. A supported NVIDIA GPU makes it faster and lets the largest models run without memory problems.
Why did rembg crash or get killed?
The default model is about 1 GB and needs a lot of memory. Add -m u2net to use a smaller model that runs on everyday laptops.
—




