Batch background removal tutorial - manual sampling, edge shrink and zip download
This walkthrough follows the real order of work: what the tool is for, what each control does, a five step pass, and a self-check before you ship the export.
When to use
Product shots, ID photos and icons usually sit on one flat colour, so a large model is overkill. This tool samples the four borders, treats sufficiently similar pixels as background, clears them and feathers the edge to avoid a hard white rim.
Batch friendly: drop a dozen files, set tolerance and feather once, then download everything as a zip. All processing happens in the browser and no image is uploaded.
One 800x600 image is processed about 0.1 s after import. The background flood fill uses a fixed-size integer queue, and feathering plus shrink reuse two buffers instead of copying the whole bitmap every round.
The queue caps at 20 images and 24 million pixels. Results are stored as PNG blobs with separate 64 px thumbnails, so clearing the queue returns memory to the starting level.
Steps
- Drop up to twenty images, each under 20 MB.
- Adjust tolerance on the first preview until the backdrop disappears without eating the subject.
- Set feather and max edge; changes apply to the whole batch.
- Check the transparent ratio per image; a very high value means tolerance is too loose.
- Download all as a zip, or save each file individually.
Screenshots
These three shots come from the final build of this plugin.



Features in detail
Border sampling detects white, grey and single colour backdrops.
Tolerance from 5 to 120 with instant recompute.
Feather from 0 to 8 px to soften the cutout edge.
Up to twenty images per batch with thumbnail previews and transparent pixel ratios.
Optional max edge from 800 to 2400 px to control file size.
Download single PNGs or the whole batch as a zip with a -nobg suffix.
What you get
Inputs
- JPG, PNG or WebP, up to 20 MB and 4000 px per side, twenty files per batch.
- Tolerance 5 to 120, feather 0 to 8 px, max edge 800 to 2400 px or original.
Outputs
- Transparent PNGs named with a -nobg suffix, single download or zip.
- Each row shows transparent ratio and output size.
Parameters
The workspace exposes 6 controls, from 容差 to 边缘收缩, and every one of them only affects the local rendering: nothing is sent back to a server.
Ranges and defaults: 容差 (5–120(默认 28)), 背景取样 (自动(四边取样) / 手动指定颜色), 边缘羽化 (0–8(默认 2)), 输出格式 (PNG 透明底 / JPEG 白底), 输出最长边 (保持原尺寸 / 1200px / 1600px / 2400px), 边缘收缩 (0–3(默认 0)). Values outside the slider range are rejected rather than silently clamped.
| Control | Type | Range or options |
|---|---|---|
| 容差 | range | 5–120(默认 28) |
| 背景取样 | select | 自动(四边取样) / 手动指定颜色 |
| 边缘羽化 | range | 0–8(默认 2) |
| 输出格式 | select | PNG 透明底 / JPEG 白底 |
| 输出最长边 | select | 保持原尺寸 / 1200px / 1600px / 2400px |
| 边缘收缩 | range | 0–3(默认 0) |
Typical cases
- Turning white-background catalogue shots into transparent cutouts for composites.
- Removing white behind icon and sticker assets for dark interfaces.
- Preparing transparent PNGs before swapping backdrops.
In each of these cases the pass is the same: load the file, make one change, check the preview, export and reopen. Skipping the reopen step is why people later discover a transparent halo or a truncated table that looked fine on screen.
A worked pass
Step 1: Drop up to twenty images, each under 20 MB. Read the hint line before touching anything: it tells you which prerequisite is missing.
Step 2: Adjust tolerance on the first preview until the backdrop disappears without eating the subject. Do not start with the most extreme setting; one small change is enough to see whether the result moves in the right direction.
Step 3: Set feather and max edge; changes apply to the whole batch. Check the preview at 100% rather than the fitted view, because artefacts often hide in the downsampled version.
Step 4: Check the transparent ratio per image; a very high value means tolerance is too loose. Export once, open the file in a local viewer, and only then decide the settings are final.
Step 5: Download all as a zip, or save each file individually. Keep the source file untouched so you can repeat the pass with a different setting without re-importing.
Walking through the controls
The 容差 slider is bounded by 5–120(默认 28). Keep it near the default for a first pass, then move one step at a time: each step is visible in the preview, and moving it in large jumps makes it impossible to tell which setting produced the artefact you are trying to remove. Values outside the range are rejected instead of being silently clamped, so the number in the readout always matches what the export will use.
The 背景取样 dropdown offers 自动(四边取样) / 手动指定颜色. Switching it re-renders the preview immediately, so compare two neighbouring options rather than jumping across the whole list; the exported file follows the option that is selected at the moment you press export, not the one you looked at earlier.
The 边缘羽化 slider is bounded by 0–8(默认 2). Keep it near the default for a first pass, then move one step at a time: each step is visible in the preview, and moving it in large jumps makes it impossible to tell which setting produced the artefact you are trying to remove. Values outside the range are rejected instead of being silently clamped, so the number in the readout always matches what the export will use.
The 输出格式 dropdown offers PNG 透明底 / JPEG 白底. Switching it re-renders the preview immediately, so compare two neighbouring options rather than jumping across the whole list; the exported file follows the option that is selected at the moment you press export, not the one you looked at earlier.
The 输出最长边 dropdown offers 保持原尺寸 / 1200px / 1600px / 2400px. Switching it re-renders the preview immediately, so compare two neighbouring options rather than jumping across the whole list; the exported file follows the option that is selected at the moment you press export, not the one you looked at earlier.
The 边缘收缩 slider is bounded by 0–3(默认 0). Keep it near the default for a first pass, then move one step at a time: each step is visible in the preview, and moving it in large jumps makes it impossible to tell which setting produced the artefact you are trying to remove. Values outside the range are rejected instead of being silently clamped, so the number in the readout always matches what the export will use.
Practical notes
Keep the browser window above 1200 pixels wide while working: below that the right column collapses under the left one and you lose the side-by-side view.
Use the reset control between experiments; carrying state from a previous pass is the most common reason a setting appears to have no effect.
If a control looks unresponsive, check the hint line first: most no-op states are caused by a missing file rather than a broken button.
Export after every meaningful change rather than at the very end, so you still have a known-good file if the next experiment goes wrong.
On a laptop with a scaled display the preview is drawn at device pixel ratio, so text that looks crisp on screen stays crisp in the exported image at the same size.
Compare your result against the limits section: if you are working outside the documented range, the tool may still run but the output quality is not guaranteed.
Long sessions are fine because nothing is uploaded, but reload before switching to a different kind of file so cached state cannot leak into the new pass.
The controls you will touch most often here are 容差, 背景取样, 边缘羽化, 输出格式.
Self-check list
Run the workflow once with a real file and confirm the result pane shows content, not the empty state.
Push every slider to its minimum and maximum and confirm the readout follows without an error.
Switch each dropdown and confirm the preview and the export change together.
Export once and reopen the file with a local viewer to confirm it is not truncated.
Reset the workspace and confirm all panels return to the empty state.
Reload the page and confirm no previous result is restored by accident.
FAQ
Q: Part of the subject vanished
A: Tolerance was too high and subject pixels matched the backdrop; lower it.
Q: Backdrop is not fully removed
A: It may be a gradient or has shadows; raise tolerance and use feather.
Q: Can it handle hair?
A: No. Colour thresholding cannot preserve translucent edges.
Q: How many images can I process at once?
A: Up to 20. Beyond 24 million pixels total, later images are skipped to avoid exhausting memory; process in batches and download one batch first.
Q: Does the file leave my device?
A: No. Everything runs inside the browser; requireNetwork is false and no upload happens.
Q: Which browsers does it run in?
A: Current Chrome, Edge, Firefox and Safari builds; no extension or plugin is needed.
Q: Why does the exported file differ in size from the source?
A: The export re-encodes the result, so size follows the chosen format and quality settings.
Limits
- Flat or near flat backgrounds only.
- No hair, glass or smoke preservation.
- No manual mask editing; output is always PNG.
Version and compliance
This build is v1.0.0 on ToolCMS plugin spec 3.19, schemaVersion 2.1 and coreVersion 3.7.4. All processing happens inside the browser, requireNetwork is false and no file leaves the device.