Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To remove backgrounds from a whole folder, treat the API as a one-image-at-a-time service and let a local script or job runner manage the batch. The orchestrator should validate each file, send a separate authenticated request, save each result safely, track successes and failures, and throttle requests to the provider’s limits. This approach works for product-photo batches without assuming that every API accepts a folder upload or can process images at the same speed.
Choose the output format before processing: PNG is the straightforward choice when you need transparency. Then test a small sample, record each job in a manifest, and only scale up after checking the cutouts. Limits, authentication, and response formats vary by provider, so build those details into the provider-specific request layer rather than scattering them through the folder workflow.
As an Amazon Associate I earn from qualifying purchases.
How does batch background removal with an API work?
Most folder workflows are not a single “process this directory” API call. They are a loop around an endpoint that removes the background from one image per request. Your script or job runner finds eligible files, submits them one by one or through a limited number of workers, and writes each response to an output location.
That separation matters: the provider handles the image transformation, while your orchestrator handles file discovery, validation, scheduling, retries, naming, and recovery. If a job stops partway through, a well-designed workflow can resume unfinished files instead of repeating the entire folder.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
What the workflow should keep track of
- Input: the source path, file type, file size, and—where available—pixel dimensions.
- Request: the provider, submission time, response status, and any returned credit information.
- Output: the destination path and whether the saved file has been verified as complete.
- Failure: an error message and whether the failure appears temporary or permanent.
Which API should you use for a folder of images?
Compare providers on input and output options, image limits, request rate, authentication, credits, retry support, and retention—not just whether they remove a background. The documented limits below are provider-specific; they are not interchangeable guarantees for every plan or endpoint.
| Provider | Documented input and output | Documented limits and rate | Credits and retry behavior |
|---|---|---|---|
| remove.bg | Accepts an image file or URL; can return an image or JSON data. | Up to 50 megapixels. Its API reference gives an effective rate of 500 images per minute at 1 MP and 10 images per minute at 50 MP. | The documentation lists the first 50 API calls per month as free. The cited material does not establish an idempotent replay policy. |
| remover.bg | POST /remove-bg accepts a multipart file and can return binary data or a temporary URL. |
PNG, JPEG, and WebP; up to 25 MB and 50 MP. | The cited material does not establish a credit or idempotency policy. |
| bg.tools | POST /api/v1/remove-background uses bearer authentication. |
Standard limits listed as 30 MB and 36 MP; 60 requests per minute. | Background removal costs one credit. An idempotency key allows a response to be cached for 24 hours, and a replay is not charged again. |
These figures come from the respective providers’ API documentation and may change. Check the current endpoint documentation and account terms before production use, especially if your images approach a stated maximum or your batch depends on a particular billing rule.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchChoose based on your failure and output needs
- If you need a direct file or URL input option, remove.bg documents both.
- If your inputs include WebP and you want a binary response or temporary URL, remover.bg documents those options for its endpoint.
- If avoiding duplicate charges after a retry is important, bg.tools documents idempotency keys and a 24-hour response cache.
- If you plan to process large images quickly, do not estimate capacity using only a requests-per-minute number. remove.bg’s published throughput differs sharply between its 1 MP and 50 MP examples.
How should you prepare the folder before sending requests?
Build a clean input list first. Do not let the script discover files recursively from a directory that also contains its outputs: doing so can cause already-processed files to be submitted again on a later run.
- Choose an input root and a separate output root. Keep generated results out of the tree being scanned, or explicitly exclude the output directory if it must be nested beneath the input root.
- Allow only supported formats. The documented formats differ: remover.bg lists PNG, JPEG, and WebP. Confirm the accepted formats for the specific provider and endpoint you use.
- Ignore temporary and partial files. Exclude files still being copied or edited, along with temporary artifacts from previous runs.
- Validate before spending a credit. Check file type, byte size, and pixel dimensions against the chosen provider’s documented limits. remove.bg documents a 50 MP maximum; remover.bg documents 25 MB and 50 MP; bg.tools lists standard limits of 30 MB and 36 MP.
- Decide whether to preserve the original filename. A deterministic suffix such as
photo-nobg.pngmakes the output easy to associate with its input while keeping the source unchanged.
Validation should happen before the request, not after a provider rejects the image. It saves a round trip and makes it possible to separate local input problems from API or network failures in the job log.
How do you process each image safely?
Use a provider-specific request function inside a provider-independent folder loop. Store the API key in a server-side secret store or environment variable; do not put it in a script that will be shared with customers, committed to source control, or embedded in a browser application.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Make one authenticated request per file
Send one multipart request for each image unless the provider explicitly documents a different batch endpoint. remove.bg documents the X-Api-Key header; bg.tools and remover.bg document bearer authorization. Follow the selected provider’s current documentation for exact request fields and response handling. A response may be an image payload or structured data containing image data or a temporary URL, depending on the endpoint.
Recommended Free Tools
Keep request construction and response parsing in a small adapter for each provider. That way, the folder loop can apply the same rules—validate, submit, save, record, and recover—without assuming every service uses the same authorization header or returns the same type of result.
Choose an output that preserves the result you need
Use PNG when the output must retain transparency. Do not assume that every image format or conversion step preserves an alpha channel; verify the saved result with a transparent-background viewer or an image-processing check appropriate to your application.
For large transparent-image jobs, remove.bg documents ZIP output as up to 80% smaller and up to 40% faster to generate than PNG. That option requires a color/alpha recomposition step, so it adds work to the receiving pipeline. Treat the figures as that provider’s documented comparison, not as a guaranteed saving for every image or workflow.
Write results so an interrupted job cannot look complete
Write each response to a temporary file in the destination area, then rename it to its final deterministic filename only after the write succeeds. This avoids leaving a truncated file with the same name as a finished output if the process is interrupted. Record the input path, output path, provider, request timestamp, response status, credit information, and any error in a manifest.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
On a rerun, consider an item complete only when the output is verified or the manifest contains a successful entry. A filename alone is not proof that the previous response was fully written. Keep failed items visible in the manifest rather than silently skipping them.
How do you stay within API limits and handle retries?
Throttle requests according to the provider’s published limits and the size of the images you are sending. More workers do not necessarily mean more throughput: image size can change the effective processing rate, and requests beyond a limit can be rejected.
Set a conservative starting rate
remove.bg publishes an effective rate of 500 images per minute at 1 MP, falling to 10 images per minute at 50 MP; requests above its limit can return HTTP 429. bg.tools lists 60 requests per minute as its standard limit. Those figures do not establish that a particular account, image mix, or plan will sustain the maximum continuously. Start below the documented ceiling, monitor responses, and adjust only when the service accepts the workload consistently.
For a mixed-size folder, schedule against the heavier images rather than assuming the smallest-file rate applies to all inputs. If the service starts returning 429 responses, slow down instead of immediately retrying at the same pace; otherwise, retries can add pressure without making progress.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Retry temporary failures, not every failure
Retry transient network failures and rate-limit responses with exponential backoff: wait longer after each repeated failure, and limit the number of attempts. Keep the eventual failure in the manifest so the batch can continue with other files and an operator can inspect it later. Do not treat a malformed, unsupported, or oversized input as a temporary network problem; quarantine it for correction rather than resubmitting it unchanged.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Where a provider supports idempotency, use a stable key for the same logical image operation so a retry can be recognized as a replay. bg.tools documents a 24-hour cache for idempotent responses and says replaying one does not incur another charge. This is a provider-specific safeguard, not a general property of background-removal APIs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How can you check quality and recover from a partial batch?
Background removal is image-dependent, and technical acceptance limits do not guarantee a clean mask. Inspect a representative subset of results before relying on the batch, then review any images whose edges or foreground details matter commercially.
Sample the difficult edges
Include images with hair, transparent objects, shadows, and fine product edges in your visual check. Those cases can reveal issues that a quick review of simple, high-contrast products will miss. If an output needs correction, retain the original and isolate that item for manual review or a different processing choice instead of overwriting the source.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Resume from the manifest
After a crash or network outage, load the manifest and retry only files without a verified output or successful manifest entry. Keep permanent failures in a quarantine list with their error messages, so they do not block successful items or disappear from the final accounting. This also makes it possible to distinguish work that never reached the API from work that received an unsuccessful response.
An operator safeguard is useful for unusually large jobs. The remove-bg command-line tool, for example, adds a confirmation prompt for batches over 50 files. That is a useful pattern to consider in a custom workflow: pause for confirmation before an unexpectedly broad batch begins, rather than allowing a mistaken folder selection to generate a large number of requests.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
What should a production-ready folder workflow include?
Before running the full directory, check that each part of the pipeline has a clear outcome and that a failed item cannot be mistaken for a successful one.
- Discovery: supported extensions only, with outputs and temporary files excluded.
- Preflight: provider-specific format, size, and megapixel validation before submission.
- Secrets: credentials loaded at runtime from a server-side secret store or environment variable.
- Requests: one authenticated request per image, with response handling matched to the provider.
- Output: deliberate transparency format, deterministic filenames, temporary writes, and final rename.
- Operations: rate-limited workers, bounded retries, idempotency where supported, and a useful manifest.
- Quality: visual checks of a subset that includes difficult edges and a recovery path for failures.
Test the workflow on a small, representative set first. Confirm that the saved files open correctly, transparency is preserved where required, the manifest reflects the actual responses, and a second run does not resubmit verified outputs. Then scale the batch at a rate the selected provider documents and your own logs support.
Frequently Asked Questions
Can I run background removal from a browser without exposing my API key?
A browser-only implementation can expose credentials to visitors because requests and client-side code are inspectable. Keep the key on a server or trusted job runner, and have the browser submit work to that controlled layer instead.
Should I delete the original images after the API returns a result?
Keep originals until the output has been checked and any needed corrections are complete. A transparent cutout is a derivative, so retaining the source gives you a way to rerun or adjust the workflow without asking for the image again.
Can I use a temporary result URL as my permanent output?
A temporary URL should be treated as a delivery mechanism, not a durable archive. Download the returned image promptly into storage you control, and record the local destination in your manifest.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute

