Background Removal API
Remove backgrounds from any image with one API call. Transparent PNG output. 2-4 second processing. Works with products, portraits, and everything in between.
import requests response = requests.post( "https://pixelpanda.ai/api/v1/remove-background", headers={"Authorization": "Bearer pk_live_xxx"}, files={"file": open("product.jpg", "rb")} ) result = response.json() # {"success": true, "image_url": "https://...", "credits_remaining": 199}
See it in action
Drop an image below. Same AI model, same output quality as the API.
Three lines of code
Works with any language. Here are copy-paste examples to get started.
import requests API_KEY = "pk_live_your_api_key" # Upload an image and remove its background response = requests.post( "https://pixelpanda.ai/api/v1/remove-background", headers={"Authorization": f"Bearer {API_KEY}"}, files={"file": open("product.jpg", "rb")} ) data = response.json() print(data["image_url"]) # Transparent PNG URL print(data["credits_remaining"]) # Credits left # Download the result img = requests.get(data["image_url"]) with open("product_nobg.png", "wb") as f: f.write(img.content)
// Browser — using fetch + FormData const input = document.querySelector('input[type="file"]'); const form = new FormData(); form.append('file', input.files[0]); const response = await fetch('https://pixelpanda.ai/api/v1/remove-background', { method: 'POST', headers: { 'Authorization': 'Bearer pk_live_your_api_key' }, body: form }); const data = await response.json(); console.log(data.image_url); // Transparent PNG URL // Display the result document.querySelector('img').src = data.image_url;
const fs = require('fs'); const FormData = require('form-data'); const form = new FormData(); form.append('file', fs.createReadStream('product.jpg')); const response = await fetch('https://pixelpanda.ai/api/v1/remove-background', { method: 'POST', headers: { 'Authorization': 'Bearer pk_live_your_api_key', ...form.getHeaders() }, body: form }); const data = await response.json(); console.log(data.image_url); // Download the result const img = await fetch(data.image_url); const buffer = Buffer.from(await img.arrayBuffer()); fs.writeFileSync('product_nobg.png', buffer);
<?php $apiKey = 'pk_live_your_api_key'; $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => 'https://pixelpanda.ai/api/v1/remove-background', CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"], CURLOPT_POSTFIELDS => [ 'file' => new CURLFile('product.jpg') ], ]); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); echo $data['image_url']; // Transparent PNG URL echo $data['credits_remaining']; // Download the result file_put_contents('product_nobg.png', file_get_contents($data['image_url']));
require 'net/http' require 'json' require 'uri' uri = URI('https://pixelpanda.ai/api/v1/remove-background') request = Net::HTTP::Post::Multipart.new(uri, { 'file' => UploadIO.new(File.new('product.jpg'), 'image/jpeg') }) request['Authorization'] = 'Bearer pk_live_your_api_key' response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(request) end data = JSON.parse(response.body) puts data['image_url'] # Transparent PNG URL puts data['credits_remaining']
package main import ( "bytes" "encoding/json" "fmt" "io" "mime/multipart" "net/http" "os" ) func main() { file, _ := os.Open("product.jpg") defer file.Close() body := &bytes.Buffer{} writer := multipart.NewWriter(body) part, _ := writer.CreateFormFile("file", "product.jpg") io.Copy(part, file) writer.Close() req, _ := http.NewRequest("POST", "https://pixelpanda.ai/api/v1/remove-background", body) req.Header.Set("Authorization", "Bearer pk_live_your_api_key") req.Header.Set("Content-Type", writer.FormDataContentType()) resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var data map[string]interface{} json.NewDecoder(resp.Body).Decode(&data) fmt.Println(data["image_url"]) // Transparent PNG URL }
# Remove background from an image curl -X POST https://pixelpanda.ai/api/v1/remove-background \ -H "Authorization: Bearer pk_live_your_api_key" \ -F "file=@product.jpg" # Response: # { # "success": true, # "image_url": "https://pub-xxx.r2.dev/results/abc123.png", # "credits_remaining": 199 # } # Download the transparent PNG curl -o product_nobg.png "https://pub-xxx.r2.dev/results/abc123.png"
8x cheaper than remove.bg
Same AI quality. Fraction of the price. No subscriptions required.
Background removal only. Pay-per-image or subscription.
- Background removal
- No image upscaling
- No text removal
- No product photo generation
- No AI product photos
- 50 free previews/month (low res)
Full image processing suite. $7.99/week for 280 credits to start.
- Background removal
- Image upscaling (2x-8x)
- Text & watermark removal
- AI product photo generation
- AI product photo generation
- 280 credits/week for $7.99 — no subscription
Background removal + basic editing. API starts at $49/mo.
- Background removal
- No image upscaling
- No text removal
- AI scene generation
- $49/mo minimum for API
- Limited free tier
Built for production
Everything you need to integrate background removal into your app.
Fast processing
State-of-the-art BiRefNet model delivers results fast enough for real-time user flows.
Hair & fine edge handling
Graduated alpha transparency on hair, fur, and wispy edges. No jagged cutouts.
Large file support
Upload images up to 10MB. Automatically optimized for processing. No pre-resizing needed.
Simple auth
Bearer token authentication. Generate API keys from your dashboard. No OAuth complexity.
All formats supported
Input JPEG, PNG, or WebP. Output is always a high-quality transparent PNG with alpha channel.
Full image suite
Same API key for upscaling, text removal, and AI product photos. One integration, all tools.
Common questions
Start removing backgrounds today
280 credits/week for $7.99. One API key. Production-ready in minutes.