( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<!DOCTYPE HTML>
<html lang="en">
<!-- /api 21:43:10 GMT -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
Background Removal API – remove.bg
</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
<meta name="author" content="Kaleido" />
<meta property="og:title" content="Background Removal API – remove.bg" />
<meta property="og:image" content="images/remove_image_background.jpg" />
<meta property="twitter:image" content="images/remove_image_background.jpg" />
<meta property="og:url" content="api.html" />
<meta property="og:site_name" content="remove.bg"/>
<meta property="og:description" content="The simplest way to remove image backgrounds programmatically" />
<meta property="twitter:title" content="Background Removal API – remove.bg" />
<meta property="twitter:url" content="api.html" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="appsignal:frontend" content="b677ac28-2e69-418d-82c7-231790f57fef" />
<meta name="robots" content="index, follow" />
<link rel="canonical" href="api.html" />
<meta name="description" content="The simplest way to remove image backgrounds programmatically" />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon30ee.png?v=YAXaAv7pao">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x3230ee.png?v=YAXaAv7pao">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x1630ee.png?v=YAXaAv7pao">
<link rel="manifest" href="site30ee.webmanifest?v=YAXaAv7pao">
<link rel="mask-icon" href="safari-pinned-tab30ee.svg?v=YAXaAv7pao" color="#009af6">
<link rel="shortcut icon" href="favicon30ee.ico?v=YAXaAv7pao">
<meta name="apple-mobile-web-app-title" content="remove.bg">
<meta name="application-name" content="remove.bg">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#f7f9fa">
<link href="https://fonts.googleapis.com/css?family=Poppins:700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open%20Sans:400,600,700" rel="stylesheet">
<meta name="upload-page:t" content="{"url":"https://www.remove.bg/upload","trust_tokens_url":"/trust_tokens","images_url":"/images","title":"Upload Image – remove.bg","mobile_app_supports_login":null,"meta_description":"Select an image \u0026 remove the background – 100% automatically – in 5 seconds – without a single click – for free.","upload_image":"Upload Image","or_drop_a_file":"or drop a file","paste_text_start":"Paste image or","paste_text_url":"URL","paste_text_end":" ","no_image":"No image?","try_one_of_these":"Try one of these:","upload_terms_html":"By uploading an image or URL you agree to our \u003ca target=\"_blank\" class=\"text-dark font-weight-bold\" href=_/tos/_/u003eTerms.html of Service\u003c/a\u003e. This site is protected by hCaptcha and its \u003ca target=\"_blank\" rel=\"noopener\" class=\"text-dark font-weight-bold\" href=_https_/hcaptcha.com/privacy/_/u003ePrivacy.html Policy\u003c/a\u003e and \u003ca target=\"_blank\" rel=\"noopener\" class=\"text-dark font-weight-bold\" href=_https_/hcaptcha.com/terms/_/u003eTerms.html of Service\u003c/a\u003e apply.\n","upload_page_heading_html":"Upload an image to\u003cbr/\u003eremove the background","waiting_for_previous_images":"Waiting for previous image(s)...","preparing_upload":"Preparing upload...","uploading":"Uploading...","skip":"Skip","for_025_credits":"for 0.25 credits","current_balance":"Current balance","failed_to_delete_image":"Failed to delete image.","drop_paste_text_start":"or drop a file, paste an image or","drop_paste_text_url":"URL","drop_paste_text_end":" ","image_url":"Image URL","invalid_image_url":"Invalid image URL","only_jpg_png_supported":"Only JPG and PNG images are supported.","max_file_size_exceeded":"The maximum file size is 12 MB.","image_resized":"Note: Image resized due to file size \u003e 12 MB","dont_forget_to_download":"Don't forget to download your files. They will be discarded automatically after 60 minutes.","drop_image_anywhere":"Drop image anywhere","one_at_a_time":"1 file at a time","download":"Download","original":"Original","removed_background":"Removed Background","edit":"Edit","preview_image":"Preview Image","full_image":"Full Image","rate_this_result":"Rate this result","rate_good":"Rate good","rate_bad":"Rate bad","spread_the_word":"Spread the word","tweet_message":"I just removed a photo background in 5 seconds with remove.bg ","tweet":"Tweet","share":"Share","thanks_for_feedback":"Thanks for your feedback!","not_available":"not available","toggle_dropdown":"Toggle dropdown","preview":"Preview","high_res":"High-Res","sorry":"Sorry...","could_not_identify_foreground":"Could not identify foreground","please_select_supported_foreground":"Please select an image with a clear distinction between foreground and background. For instance, try a photo of a person, product, animal, car or another object.","example_gallery":"Example Gallery","photo_recommendations":"Photo Recommendations","constantly_improving":"We are constantly working on supporting more images.","want_to_help":"Want to help us improve by contributing this image to teach the Artificial Intelligence?","help_us_improve":"Help us improve","contribute_image":"Contribute image","good_quality":"Good Quality","best_quality":"Best Quality","up_to_025_megapixels":"up to 0.25 megapixels","up_to_25_megapixels":"up to 25 megapixels","download_high_res":"Download HD","please_upload_higher_resolution":"Please upload a higher resolution image or download the preview image.","upload_footer_link":"https://www.unscreen.com/?ref=removebgupload","upload_footer_text_bold":"NEW:","upload_footer_text":"Video background removal – 100% automatically –","upload_footer_text_underlined":"Try now"}" />
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="eFnKGwb/duML29PVC/KeD9lByeJTce9pnHLruDSIaOEWZ2jhxo5Wt6rdri4va6aNQz0A2IGGP0mSgqweFs0ivw==" />
<meta name="csp-nonce" />
<script>window.noZensmooth = true;</script>
<script src="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/packs/js/application-493e6e543a2a6d1c9f88.js"></script>
<link rel="stylesheet" media="screen" href="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/packs/css/application-32b5b2af.css" />
<script>
window.trackErrors('QXBpRG9jc0NvbnRyb2xsZXIjaW5kZXg=', {});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','../www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-102016867-3', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<!-- Hotjar Tracking Code for www.remove.bg -->
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:1304470,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
</head>
class="cookies-accepted">
<nav class="navbar navbar-expand-lg navbar-light fixed-top d-none-mobile-app">
<a class="navbar-brand" style="padding-top: 0; padding-bottom: 0;" href="index.html">
<img alt="remove.bg" style="max-width: 210px;" src="https://assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/logo-nav-22aab70183946de3d717620adef36247aca127c1a0f04885d786c6be1d2cf9fa.svg" />
</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-center" id="navbarSupportedContent" data-controller="navbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown" data-target="navbar.dropdownParent">
<a class="nav-link" href="#" id="howToUseDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
How to use
<i class="fas fa-caret-down d-lg-none"></i>
</a>
<div class="dropdown-menu" aria-labelledby="howToUseDropdown">
<div class="container">
<div class="row">
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/individuals.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-user fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Individuals</div>
</a> </div>
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/photographers.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-camera fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Photographers</div>
</a> </div>
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/marketing.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-bullhorn fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Marketing</div>
</a> </div>
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/developers.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-code fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Developers</div>
</a> </div>
</div>
<div class="row">
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/ecommerce.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-shopping-cart fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Ecommerce</div>
</a> </div>
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/media.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-laptop fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Media</div>
</a> </div>
<div class="col-12 col-sm-6 col-lg-3 py-1 py-lg-3">
<a class="dropdown-item" href="g/car-dealerships.html">
<div class="d-inline-block d-sm-block" style="vertical-align: middle;"><i class="fal fa-car fa-2x text-primary fa-fw"></i></div>
<div class="d-inline-block d-sm-block mt-lg-1">for Car Dealerships</div>
</a> </div>
<div class="col-lg-3"></div>
</div>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="tools-api.html">Tools & API</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.html">
Pricing
</a> </li>
</ul>
<div>
<div class="navbar-btn-wrapper">
<a class="btn btn-outline-primary mx-2 mb-2 mb-lg-0" href="upload.html">Browse Designs</a>
</div>
<div class="navbar-btn-wrapper" id="navbar-user-options">
<a class="btn btn-outline-secondary sso-sign-in-btn" href="https://accounts.kaleido.ai/oauth/authorize?client_id=Wr--JQP_UWyenrH54zWrGh9OFuYRnRCYntYqsGNeQBM&locale=en&redirect_uri=https%3A%2F%2Fwww.remove.bg%2Fauth&response_type=code">Login / Sign up</a>
</div>
</div>
</div>
</nav>
<div class="navbar-backdrop" style="display: none;"></div>
<main id="page-content">
<section class="header header-backdrop header-backdrop-blue position-relative overflow-hidden"><div class="container"><div class="d-none d-md-block sprite sprite-circle-bottom" style="position: absolute; top: 50%; left: 0; color: #E7F5F8; opacity: 0.5;"></div><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="192" height="146" viewBox="0 0 192 146" class="d-none d-md-block sprite sprite-dots" style="position: absolute; left: 30px; top: 50%; color: #D2C2D0;"><circle r="1.5" fill="currentColor" cx="2" cy="2"></circle><circle r="1.5" fill="currentColor" cx="2" cy="25"></circle><circle r="1.5" fill="currentColor" cx="2" cy="48"></circle><circle r="1.5" fill="currentColor" cx="2" cy="71"></circle><circle r="1.5" fill="currentColor" cx="2" cy="94"></circle><circle r="1.5" fill="currentColor" cx="2" cy="117"></circle><circle r="1.5" fill="currentColor" cx="2" cy="140"></circle><circle r="1.5" fill="currentColor" cx="25" cy="2"></circle><circle r="1.5" fill="currentColor" cx="25" cy="25"></circle><circle r="1.5" fill="currentColor" cx="25" cy="48"></circle><circle r="1.5" fill="currentColor" cx="25" cy="71"></circle><circle r="1.5" fill="currentColor" cx="25" cy="94"></circle><circle r="1.5" fill="currentColor" cx="25" cy="117"></circle><circle r="1.5" fill="currentColor" cx="25" cy="140"></circle><circle r="1.5" fill="currentColor" cx="48" cy="2"></circle><circle r="1.5" fill="currentColor" cx="48" cy="25"></circle><circle r="1.5" fill="currentColor" cx="48" cy="48"></circle><circle r="1.5" fill="currentColor" cx="48" cy="71"></circle><circle r="1.5" fill="currentColor" cx="48" cy="94"></circle><circle r="1.5" fill="currentColor" cx="48" cy="117"></circle><circle r="1.5" fill="currentColor" cx="48" cy="140"></circle><circle r="1.5" fill="currentColor" cx="71" cy="2"></circle><circle r="1.5" fill="currentColor" cx="71" cy="25"></circle><circle r="1.5" fill="currentColor" cx="71" cy="48"></circle><circle r="1.5" fill="currentColor" cx="71" cy="71"></circle><circle r="1.5" fill="currentColor" cx="71" cy="94"></circle><circle r="1.5" fill="currentColor" cx="71" cy="117"></circle><circle r="1.5" fill="currentColor" cx="71" cy="140"></circle><circle r="1.5" fill="currentColor" cx="94" cy="2"></circle><circle r="1.5" fill="currentColor" cx="94" cy="25"></circle><circle r="1.5" fill="currentColor" cx="94" cy="48"></circle><circle r="1.5" fill="currentColor" cx="94" cy="71"></circle><circle r="1.5" fill="currentColor" cx="94" cy="94"></circle><circle r="1.5" fill="currentColor" cx="94" cy="117"></circle><circle r="1.5" fill="currentColor" cx="94" cy="140"></circle><circle r="1.5" fill="currentColor" cx="117" cy="2"></circle><circle r="1.5" fill="currentColor" cx="117" cy="25"></circle><circle r="1.5" fill="currentColor" cx="117" cy="48"></circle><circle r="1.5" fill="currentColor" cx="117" cy="71"></circle><circle r="1.5" fill="currentColor" cx="117" cy="94"></circle><circle r="1.5" fill="currentColor" cx="117" cy="117"></circle><circle r="1.5" fill="currentColor" cx="117" cy="140"></circle><circle r="1.5" fill="currentColor" cx="140" cy="2"></circle><circle r="1.5" fill="currentColor" cx="140" cy="25"></circle><circle r="1.5" fill="currentColor" cx="140" cy="48"></circle><circle r="1.5" fill="currentColor" cx="140" cy="71"></circle><circle r="1.5" fill="currentColor" cx="140" cy="94"></circle><circle r="1.5" fill="currentColor" cx="140" cy="117"></circle><circle r="1.5" fill="currentColor" cx="140" cy="140"></circle><circle r="1.5" fill="currentColor" cx="163" cy="2"></circle><circle r="1.5" fill="currentColor" cx="163" cy="25"></circle><circle r="1.5" fill="currentColor" cx="163" cy="48"></circle><circle r="1.5" fill="currentColor" cx="163" cy="71"></circle><circle r="1.5" fill="currentColor" cx="163" cy="94"></circle><circle r="1.5" fill="currentColor" cx="163" cy="117"></circle><circle r="1.5" fill="currentColor" cx="163" cy="140"></circle><circle r="1.5" fill="currentColor" cx="186" cy="2"></circle><circle r="1.5" fill="currentColor" cx="186" cy="25"></circle><circle r="1.5" fill="currentColor" cx="186" cy="48"></circle><circle r="1.5" fill="currentColor" cx="186" cy="71"></circle><circle r="1.5" fill="currentColor" cx="186" cy="94"></circle><circle r="1.5" fill="currentColor" cx="186" cy="117"></circle><circle r="1.5" fill="currentColor" cx="186" cy="140"></circle><circle r="1.5" fill="currentColor" cx="209" cy="2"></circle><circle r="1.5" fill="currentColor" cx="209" cy="25"></circle><circle r="1.5" fill="currentColor" cx="209" cy="48"></circle><circle r="1.5" fill="currentColor" cx="209" cy="71"></circle><circle r="1.5" fill="currentColor" cx="209" cy="94"></circle><circle r="1.5" fill="currentColor" cx="209" cy="117"></circle><circle r="1.5" fill="currentColor" cx="209" cy="140"></circle></svg><div class="d-none d-md-block sprite sprite-triangle-equi" style="position: absolute; right: 10%; top: 17%; color: #F2FAFB; opacity: 0.3; transform: scale(0.35);"></div><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="192" height="146" viewBox="0 0 192 146" class="d-none d-md-block sprite sprite-dots" style="position: absolute; bottom: 60px; right: 0; color: #D2C2D0;"><circle r="1.5" fill="currentColor" cx="2" cy="2"></circle><circle r="1.5" fill="currentColor" cx="2" cy="25"></circle><circle r="1.5" fill="currentColor" cx="2" cy="48"></circle><circle r="1.5" fill="currentColor" cx="2" cy="71"></circle><circle r="1.5" fill="currentColor" cx="2" cy="94"></circle><circle r="1.5" fill="currentColor" cx="2" cy="117"></circle><circle r="1.5" fill="currentColor" cx="2" cy="140"></circle><circle r="1.5" fill="currentColor" cx="25" cy="2"></circle><circle r="1.5" fill="currentColor" cx="25" cy="25"></circle><circle r="1.5" fill="currentColor" cx="25" cy="48"></circle><circle r="1.5" fill="currentColor" cx="25" cy="71"></circle><circle r="1.5" fill="currentColor" cx="25" cy="94"></circle><circle r="1.5" fill="currentColor" cx="25" cy="117"></circle><circle r="1.5" fill="currentColor" cx="25" cy="140"></circle><circle r="1.5" fill="currentColor" cx="48" cy="2"></circle><circle r="1.5" fill="currentColor" cx="48" cy="25"></circle><circle r="1.5" fill="currentColor" cx="48" cy="48"></circle><circle r="1.5" fill="currentColor" cx="48" cy="71"></circle><circle r="1.5" fill="currentColor" cx="48" cy="94"></circle><circle r="1.5" fill="currentColor" cx="48" cy="117"></circle><circle r="1.5" fill="currentColor" cx="48" cy="140"></circle><circle r="1.5" fill="currentColor" cx="71" cy="2"></circle><circle r="1.5" fill="currentColor" cx="71" cy="25"></circle><circle r="1.5" fill="currentColor" cx="71" cy="48"></circle><circle r="1.5" fill="currentColor" cx="71" cy="71"></circle><circle r="1.5" fill="currentColor" cx="71" cy="94"></circle><circle r="1.5" fill="currentColor" cx="71" cy="117"></circle><circle r="1.5" fill="currentColor" cx="71" cy="140"></circle><circle r="1.5" fill="currentColor" cx="94" cy="2"></circle><circle r="1.5" fill="currentColor" cx="94" cy="25"></circle><circle r="1.5" fill="currentColor" cx="94" cy="48"></circle><circle r="1.5" fill="currentColor" cx="94" cy="71"></circle><circle r="1.5" fill="currentColor" cx="94" cy="94"></circle><circle r="1.5" fill="currentColor" cx="94" cy="117"></circle><circle r="1.5" fill="currentColor" cx="94" cy="140"></circle><circle r="1.5" fill="currentColor" cx="117" cy="2"></circle><circle r="1.5" fill="currentColor" cx="117" cy="25"></circle><circle r="1.5" fill="currentColor" cx="117" cy="48"></circle><circle r="1.5" fill="currentColor" cx="117" cy="71"></circle><circle r="1.5" fill="currentColor" cx="117" cy="94"></circle><circle r="1.5" fill="currentColor" cx="117" cy="117"></circle><circle r="1.5" fill="currentColor" cx="117" cy="140"></circle><circle r="1.5" fill="currentColor" cx="140" cy="2"></circle><circle r="1.5" fill="currentColor" cx="140" cy="25"></circle><circle r="1.5" fill="currentColor" cx="140" cy="48"></circle><circle r="1.5" fill="currentColor" cx="140" cy="71"></circle><circle r="1.5" fill="currentColor" cx="140" cy="94"></circle><circle r="1.5" fill="currentColor" cx="140" cy="117"></circle><circle r="1.5" fill="currentColor" cx="140" cy="140"></circle><circle r="1.5" fill="currentColor" cx="163" cy="2"></circle><circle r="1.5" fill="currentColor" cx="163" cy="25"></circle><circle r="1.5" fill="currentColor" cx="163" cy="48"></circle><circle r="1.5" fill="currentColor" cx="163" cy="71"></circle><circle r="1.5" fill="currentColor" cx="163" cy="94"></circle><circle r="1.5" fill="currentColor" cx="163" cy="117"></circle><circle r="1.5" fill="currentColor" cx="163" cy="140"></circle><circle r="1.5" fill="currentColor" cx="186" cy="2"></circle><circle r="1.5" fill="currentColor" cx="186" cy="25"></circle><circle r="1.5" fill="currentColor" cx="186" cy="48"></circle><circle r="1.5" fill="currentColor" cx="186" cy="71"></circle><circle r="1.5" fill="currentColor" cx="186" cy="94"></circle><circle r="1.5" fill="currentColor" cx="186" cy="117"></circle><circle r="1.5" fill="currentColor" cx="186" cy="140"></circle><circle r="1.5" fill="currentColor" cx="209" cy="2"></circle><circle r="1.5" fill="currentColor" cx="209" cy="25"></circle><circle r="1.5" fill="currentColor" cx="209" cy="48"></circle><circle r="1.5" fill="currentColor" cx="209" cy="71"></circle><circle r="1.5" fill="currentColor" cx="209" cy="94"></circle><circle r="1.5" fill="currentColor" cx="209" cy="117"></circle><circle r="1.5" fill="currentColor" cx="209" cy="140"></circle></svg><div class="d-none d-md-block sprite sprite-circle" style="position: absolute; right: -50px; bottom: 30px; color: #D7E4F2; opacity: 0.3; transform: scale(1.4);"></div><svg xmlns="http://www.w3.org/2000/svg" width="91.329" height="90.941" viewBox="0 0 91.329 90.941" class="d-none d-md-block sprite sprite-waves" style="position: absolute; right: -70px; top: 15%; color: #D7E4F2;"><defs><style>.a{fill:none;stroke:currentColor;stroke-miterlimit:10;stroke-width:2px;}</style></defs><g transform="translate(-4.336 -5.086)"><path class="a" d="M5,30.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,40.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,10.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,20.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,70.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,80.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,50.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,60.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/><path class="a" d="M5,90.556s11.25,10,22.5,0,22.5,0,22.5,0,11.25,10,22.5,0,22.5,0,22.5,0"/></g></g></svg>
<h1>
Background Removal API
</h1>
</div></section>
<div class="container">
<div class="card card-with-shadow">
<div class="card-body">
<div style="text-align: center;">
<h2>
Remove the background<br/>
of any image<span style="opacity: 0.5;">*</span><br/>
with 1 API call
</h2>
<p class="d-none d-sm-block">
<code style="display:block; color: #256bc7; background-color: #f2f4f9; max-width: 700px; margin: 0 auto; font-size: 120%; text-align: left; padding: 15px;">
$ curl -H 'X-API-Key: YOUR_API_KEY' <span style="opacity: 0;">\</span><br>
-F '<a href="cdn-cgi/l/email-protection.html" class="__cf_email__" data-cfemail="9af3f7fbfdffc5fcf3f6ffa7da">[email protected]</a>/path/to/file.jpg' <span style="opacity: 0;">\</span><br>
-f https://api.remove.bg/v1.0/removebg -o no-bg.png</code>
</p>
<p class="d-sm-none">
<code style="display:block; color: #256bc7; background-color: #f2f4f9; max-width: 700px; margin: 0 auto; font-size: 3.4vw; text-align: left; padding: 15px; margin-left: -15px; margin-right: -15px;">
$ curl -H 'X-API-Key: YOUR_API_KEY'<span style="opacity: 0; font-size: 0;"> \</span><br>
-F '<a href="cdn-cgi/l/email-protection.html" class="__cf_email__" data-cfemail="31585c5056546e57585d540c71">[email protected]</a>/path/to/file.jpg'<span style="opacity: 0; font-size: 0;"> \</span><br>
-f https://api.remove.bg/v1.0/removebg<span style="opacity: 0; font-size: 0;"> \</span><br>
-o no-bg.png</code>
</p>
<p>
<a class="btn btn-primary btn-lg" href="https://accounts.kaleido.ai/oauth/authorize?client_id=Wr--JQP_UWyenrH54zWrGh9OFuYRnRCYntYqsGNeQBM&locale=en&redirect_uri=https%3A%2F%2Fwww.remove.bg%2Fauth&response_type=code#api-key">Get API Key</a>
</p>
<p class="text-muted small">
* <a href="https://help.remove.bg/hc/en-us/articles/360015633153" style="color: inherit; text-decoration: underline;" target="_blank">Any image that has a foreground (tested with people, products, animals, cars, etc.)</a>
</p>
</div>
</div>
</div>
</div>
<div class="mt-5 pt-md-5">
<div class="container">
<div class="row">
<div class="col-md-6">
<img class="img-fluid" src="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-desc-c50d783d30131b995f024027cec282d7372e487353dd68e6b02547975a36e9a3.png" />
</div>
<div class="col-md-6">
<h2>
Easy to integrate
</h2>
<p>
Our API is a simple HTTP interface with various options:
</p>
<ul>
<li><b>Source images:</b> Direct uploads or URL reference</li>
<li><b>Result images:</b> Image file or JSON-encoded data</li>
<li><b>Output resolution:</b> up to 25 megapixels</li>
<li>Requires <a href="https://help.remove.bg/hc/en-us/articles/360015633153" style="color: inherit; text-decoration: underline;" target="_blank">images that have a foreground (e.g. people, products, animals, cars, etc.)</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="mt-5">
<div class="container" style="max-width: 700px;">
<a name="docs" id="docs"></a>
<h2>
Get started
</h2>
<ol class="lead">
<li class="mb-3">
<a href="https://accounts.kaleido.ai/oauth/authorize?client_id=Wr--JQP_UWyenrH54zWrGh9OFuYRnRCYntYqsGNeQBM&locale=en&redirect_uri=https%3A%2F%2Fwww.remove.bg%2Fauth&response_type=code#api-key">Get your API Key</a>.<br/>Your first 50 API calls per month are on us (see <a href="pricing.html">Pricing</a>).
</li>
<li class="mb-3">
Use the following code samples to get started quickly
</li>
<li class="mb-3">
Review the reference docs to adjust any parameters
</li>
</ol>
<div class="sample-code-docs" data-controller="sample-code">
<h3 style="margin-top: 30px;">
Sample Code
</h3>
<div style="margin-top: 10px;">
Browse Designs from
</div>
<div>
<div class="btn-group" role="group" data-target="sample-code.source">
<button type="button" data-action="click->sample-code#selectSource" data-value="file" class="btn btn-outline-secondary active">Image File</button>
<button type="button" data-action="click->sample-code#selectSource" data-value="url" class="btn btn-outline-secondary">Image URL</button>
</div>
</div>
<div style="margin-top: 10px;">
Environment
</div>
<div>
<div class="btn-group sample-code-environments" role="group" data-target="sample-code.language">
<button type="button" data-action="click->sample-code#selectLanguage" data-value="bash" class="btn btn-outline-secondary active">cURL</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="javascript" class="btn btn-outline-secondary">Node.js</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="python" class="btn btn-outline-secondary">Python</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="ruby" class="btn btn-outline-secondary">Ruby</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="php" class="btn btn-outline-secondary">PHP</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="java" class="btn btn-outline-secondary">Java</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="csharp" class="btn btn-outline-secondary">.NET</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="swift" class="btn btn-outline-secondary">Swift</button>
<button type="button" data-action="click->sample-code#selectLanguage" data-value="objectivec" class="btn btn-outline-secondary">Objective-C</button>
</div>
</div>
<div style="margin-top: 10px;">
Code
</div>
<div data-target="sample-code.code" data-source="file" data-lang="bash" class="d-none"><pre><code class="language-bash">$ curl -H 'X-API-Key: INSERT_YOUR_API_KEY_HERE' \
-F '<a href="cdn-cgi/l/email-protection.html" class="__cf_email__" data-cfemail="6c05010d0b09330a050009512c">[email protected]</a>/path/to/file.jpg' \
-F 'size=auto' \
-f https://api.remove.bg/v1.0/removebg -o no-bg.png
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="javascript" class="d-none"><pre><code class="language-javascript">// Requires "request" to be installed (see https://www.npmjs.com/package/request)
var request = require('request');
var fs = require('fs');
request.post({
url: 'https://api.remove.bg/v1.0/removebg',
formData: {
image_file: fs.createReadStream('/path/to/file.jpg'),
size: 'auto',
},
headers: {
'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'
},
encoding: null
}, function(error, response, body) {
if(error) return console.error('Request failed:', error);
if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
fs.writeFileSync("no-bg.png", body);
});
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="python" class="d-none"><pre><code class="language-python"># Requires "requests" to be installed (see python-requests.org)
import requests
response = requests.post(
'https://api.remove.bg/v1.0/removebg',
files={'image_file': open('/path/to/file.jpg', 'rb')},
data={'size': 'auto'},
headers={'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'},
)
if response.status_code == requests.codes.ok:
with open('no-bg.png', 'wb') as out:
out.write(response.content)
else:
print("Error:", response.status_code, response.text)
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="ruby" class="d-none"><pre><code class="language-ruby"># Install "remove_bg" first (https://github.com/remove-bg/ruby)
require "remove_bg"
RemoveBg.from_file("/path/to/file.jpg",
api_key: "INSERT_YOUR_API_KEY_HERE"
).save("no-bg.png")
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="php" class="d-none"><pre><code class="language-php">// Requires "guzzle" to be installed (see guzzlephp.org)
$client = new GuzzleHttp\Client();
$res = $client->post('https://api.remove.bg/v1.0/removebg', [
'multipart' => [
[
'name' => 'image_file',
'contents' => fopen('/path/to/file.jpg', 'r')
],
[
'name' => 'size',
'contents' => 'auto'
]
],
'headers' => [
'X-Api-Key' => 'INSERT_YOUR_API_KEY_HERE'
]
]);
$fp = fopen("no-bg.png", "wb");
fwrite($fp, $res->getBody());
fclose($fp);
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="java" class="d-none"><pre><code class="language-java">// Requires "Apache HttpComponents" to be installed (see hc.apache.org)
Response response = Request.Post("https://api.remove.bg/v1.0/removebg")
.addHeader("X-Api-Key", "INSERT_YOUR_API_KEY_HERE")
.body(
MultipartEntityBuilder.create()
.addBinaryBody("image_file", new File("/path/to/file.jpg"))
.addTextBody("size", "auto")
.build()
).execute();
response.saveContent(new File("no-bg.png"));
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="objectivec" class="d-none"><pre><code class="language-objectivec">// Requires AFNetworking to be installed (see https://github.com/AFNetworking/AFNetworking)
NSURL *fileUrl = [NSBundle.mainBundle URLForResource:@"file" withExtension:@"jpg"];
NSData *data = [NSData dataWithContentsOfURL:fileUrl];
if (!data) {
return;
}
AFHTTPSessionManager *manager =
[[AFHTTPSessionManager alloc] initWithSessionConfiguration:
NSURLSessionConfiguration.defaultSessionConfiguration];
manager.responseSerializer = [AFImageResponseSerializer serializer];
[manager.requestSerializer setValue:@"INSERT_YOUR_API_KEY_HERE"
forHTTPHeaderField:@"X-Api-Key"];
NSURLSessionDataTask *dataTask = [manager
POST:@"https://api.remove.bg/v1.0/removebg"
parameters:nil
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
[formData appendPartWithFileData:data
name:@"image_file"
fileName:@"file.jpg"
mimeType:@"image/jpeg"];
}
progress:nil
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
if ([responseObject isKindOfClass:UIImage.class] == false) {
return;
}
self.imageView.image = responseObject;
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
// Handle error here
}];
[dataTask resume];
</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="swift" class="d-none"><pre><code class="language-swift">// Requires Alamofire to be installed (see https://github.com/Alamofire/Alamofire)
guard let fileUrl = Bundle.main.url(forResource: "file", withExtension: "jpg"),
let data = try? Data(contentsOf: fileUrl) else { return }
Alamofire
.upload(
multipartFormData: { builder in
builder.append(
data,
withName: "image_file",
fileName: "file.jpg",
mimeType: "image/jpeg"
)
},
to: URL(string: "https://api.remove.bg/v1.0/removebg")!,
headers: [
"X-Api-Key": "INSERT_YOUR_API_KEY_HERE"
]
) { result in
switch result {
case .success(let upload, _, _):
upload.responseJSON { imageResponse in
guard let imageData = imageResponse.data,
let image = UIImage(data: imageData) else { return }
self.imageView.image = image
}
case .failure:
return
}
}</code></pre></div>
<div data-target="sample-code.code" data-source="file" data-lang="csharp" class="d-none"><pre><code class="language-csharp">using (var client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
formData.Headers.Add("X-Api-Key", "INSERT_YOUR_API_KEY_HERE");
formData.Add(new ByteArrayContent(File.ReadAllBytes("/path/to/file.jpg")), "image_file", "file.jpg");
formData.Add(new StringContent("auto"), "size");
var response = client.PostAsync("https://api.remove.bg/v1.0/removebg", formData).Result;
if(response.IsSuccessStatusCode) {
FileStream fileStream = new FileStream("no-bg.png", FileMode.Create, FileAccess.Write, FileShare.None);
response.Content.CopyToAsync(fileStream).ContinueWith((copyTask) =>{ fileStream.Close(); });
} else {
Console.WriteLine("Error: " + response.Content.ReadAsStringAsync().Result);
}
}
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="bash" class="d-none"><pre><code class="language-bash">$ curl -H 'X-API-Key: INSERT_YOUR_API_KEY_HERE' \
-F 'image_url=https://www.remove.bg/example.jpg' \
-F 'size=auto' \
-f https://api.remove.bg/v1.0/removebg -o no-bg.png
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="javascript" class="d-none"><pre><code class="language-javascript">// Requires "request" to be installed (see https://www.npmjs.com/package/request)
var request = require('request');
var fs = require('fs');
request.post({
url: 'https://api.remove.bg/v1.0/removebg',
formData: {
image_url: 'https://www.remove.bg/example.jpg',
size: 'auto',
},
headers: {
'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'
},
encoding: null
}, function(error, response, body) {
if(error) return console.error('Request failed:', error);
if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
fs.writeFileSync("no-bg.png", body);
});
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="python" class="d-none"><pre><code class="language-python"># Requires "requests" to be installed (see python-requests.org)
import requests
response = requests.post(
'https://api.remove.bg/v1.0/removebg',
data={
'image_url': 'https://www.remove.bg/example.jpg',
'size': 'auto'
},
headers={'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'},
)
if response.status_code == requests.codes.ok:
with open('no-bg.png', 'wb') as out:
out.write(response.content)
else:
print("Error:", response.status_code, response.text)
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="ruby" class="d-none"><pre><code class="language-ruby"># Install "remove_bg" first (https://github.com/remove-bg/ruby)
require "remove_bg"
RemoveBg.from_url("https://www.remove.bg/example.jpg",
api_key: "INSERT_YOUR_API_KEY_HERE"
).save("no-bg.png")
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="php" class="d-none"><pre><code class="language-php">// Requires "guzzle" to be installed (see guzzlephp.org)
$client = new GuzzleHttp\Client();
$res = $client->post('https://api.remove.bg/v1.0/removebg', [
'multipart' => [
[
'name' => 'image_url',
'contents' => 'https://www.remove.bg/example.jpg'
],
[
'name' => 'size',
'contents' => 'auto'
]
],
'headers' => [
'X-Api-Key' => 'INSERT_YOUR_API_KEY_HERE'
]
]);
$fp = fopen("no-bg.png", "wb");
fwrite($fp, $res->getBody());
fclose($fp);
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="java" class="d-none"><pre><code class="language-java">// Requires "Apache HttpComponents" to be installed (see hc.apache.org)
Response response = Request.Post("https://api.remove.bg/v1.0/removebg")
.addHeader("X-Api-Key", "INSERT_YOUR_API_KEY_HERE")
.body(
MultipartEntityBuilder.create()
.addTextBody("image_url", "https://www.remove.bg/example.jpg")
.addTextBody("size", "auto")
.build()
).execute();
response.saveContent(new File("no-bg.png"));
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="objectivec" class="d-none"><pre><code class="language-objectivec">// Requires AFNetworking to be installed (see https://github.com/AFNetworking/AFNetworking)
AFHTTPSessionManager *manager =
[[AFHTTPSessionManager alloc] initWithSessionConfiguration:
NSURLSessionConfiguration.defaultSessionConfiguration];
manager.responseSerializer = [AFImageResponseSerializer serializer];
[manager.requestSerializer setValue:@"INSERT_YOUR_API_KEY_HERE"
forHTTPHeaderField:@"X-Api-Key"];
NSURLSessionDataTask *dataTask = [manager
POST:@"https://api.remove.bg/v1.0/removebg"
parameters:@{@"image_url": @"https://www.remove.bg/example.jpg"}
progress:nil
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
if ([responseObject isKindOfClass:UIImage.class] == false) {
return;
}
self.imageView.image = responseObject;
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"ERROR");
}];
[dataTask resume];
</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="swift" class="d-none"><pre><code class="language-swift">// Requires Alamofire to be installed (see https://github.com/Alamofire/Alamofire)
Alamofire
.request(
URL(string: "https://api.remove.bg/v1.0/removebg")!,
method: .post,
parameters: ["image_url": "https://www.remove.bg/example.jpg"],
encoding: URLEncoding(),
headers: [
"X-Api-Key": "INSERT_YOUR_API_KEY_HERE"
]
)
.responseData { imageResponse in
guard let imageData = imageResponse.data,
let image = UIImage(data: imageData) else { return }
self.imageView.image = image
}</code></pre></div>
<div data-target="sample-code.code" data-source="url" data-lang="csharp" class="d-none"><pre><code class="language-csharp">using (var client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
formData.Headers.Add("X-Api-Key", "INSERT_YOUR_API_KEY_HERE");
formData.Add(new StringContent("https://www.remove.bg/example.jpg"), "image_url");
formData.Add(new StringContent("auto"), "size");
var response = client.PostAsync("https://api.remove.bg/v1.0/removebg", formData).Result;
if(response.IsSuccessStatusCode) {
FileStream fileStream = new FileStream("no-bg.png", FileMode.Create, FileAccess.Write, FileShare.None);
response.Content.CopyToAsync(fileStream).ContinueWith((copyTask) =>{ fileStream.Close(); });
} else {
Console.WriteLine("Error: " + response.Content.ReadAsStringAsync().Result);
}
}
</code></pre></div>
</div>
<h3 style="margin-top: 40px;">
Libraries and tools
</h3>
<ul>
<li>
<a href="https://github.com/remove-bg/go" target="_blank"><strong>Official command-line tool</strong></a> <small>(written in go)</small>
</li>
<li>
<a href="https://github.com/remove-bg/ruby" target="_blank"><strong>Official ruby gem</strong></a>
</li>
<li>
<strong>PHP / Laravel library:</strong> <a href="https://github.com/mtownsend5512/remove-bg" target="_blank"><strong>remove-bg</strong></a>
<small>by @mtownsend5512</small>
</li>
<li>
<strong>Node.js:</strong> <a href="https://www.npmjs.com/package/remove.bg" target="_blank"><strong>remove.bg</strong></a>
<small>by @eddyverbruggen</small> / <a href="https://www.npmjs.com/package/removd" target="_blank"><strong>removd</strong></a>
<small>by @przemyslawpluta</small>
</li>
<li>
<strong>Python:</strong> <a href="https://github.com/brilam/remove-bg" target="_blank"><strong>remove-bg</strong></a>
<small>by Brian Lam</small>
</li>
</ul>
<h3 style="margin-top: 40px;">
<a id="output-formats"></a>
Output Formats
</h3>
<p>
You can request one of three formats via the <code>format</code> parameter:
</p>
<table class="table">
<thead>
<tr>
<th>
Format
</th>
<th>
Resolution
</th>
<th>
Pros and cons
</th>
<th>
Example
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
PNG
</td>
<td>
Up to 10 Megapixels<br/>
<small>e.g. 4000x2500</small>
</td>
<td>
+ Simple integration<br/>
+ Supports transparency<br/>
- Large file size
</td>
<td>
<a download="example-tiger.png" href="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-docs/example-tiger-3c57ca723193f93575754bab2a886a77e9f6bbea44945af4471cdd936880ea7c.png">
<i class="fas fa-download"></i> <strong>Download</strong><br/>
<small>7 MB</small></a>
</a> </td>
</tr>
<tr>
<td>
JPG
</td>
<td>
Up to 25 Megapixels<br/>
<small>e.g. 6250x4000</small>
</td>
<td>
+ Simple Integration<br/>
+ Small file size<br/>
- No transparency supported
</td>
<td>
<a download="example-tiger.jpg" href="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-docs/example-tiger-a02b5b9f816623e692ab39f154825e54ef4c3102c86ef4a08105b6607df96259.jpg">
<i class="fas fa-download"></i> <strong>Download</strong><br/>
<small>1 MB</small></a>
</a> </td>
</tr>
<tr>
<td>
ZIP
</td>
<td>
Up to 25 Megapixels<br/>
<small>e.g. 6250x4000</small>
</td>
<td>
+ Small file size<br/>
+ Supports transparency<br/>
- Integration requires compositing
</td>
<td>
<a download="example-tiger.zip" href="https://assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-docs/example-tiger-671d12c94040cfb91e6dd128db2d2ae73eddd03595f297ad022d3ae57d7f39d9.zip">
<i class="fas fa-download"></i> <strong>Download</strong><br/>
<small>3 MB</small></a>
</a> </td>
</tr>
</tbody>
</table>
<p>
Please note that <strong>PNG images above 10 megapixels are not supported</strong>. If you require transparency for images of that size, use the ZIP format (see below). If you don't need transparency (e.g. white background), we recommend JPG.
</p>
<h3 style="margin-top: 40px;">
<a id="zip-format"></a>
How to use the ZIP format
</h3>
<p>
The ZIP format has the best runtime performance for transparent images. In comparison to PNG, the resulting file is up to 80% smaller (faster to download) and up to 40% faster to generate. For performance optimization we recommend using the ZIP format whenever possible. Above 10 megapixels, usage of the ZIP format is required for transparent results.
</p>
<p>
The ZIP file always contains the following files:
</p>
<table class="table">
<tbody>
<tr>
<td>
<strong>color.jpg</strong>
</td>
<td>
A non-transparent RGB image in JPG format containing the colors for each pixel. <small>(Note: This image differs from the input image due to edge color corrections.)</small>
–
<a download="example-tiger-color.jpg" href="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-docs/example-tiger-color-71b428bf8b9a23f589de1c6e707d9c7d2aa59d3ce8fb8c90c7d76a5d8b609a00.1a9.dela">
Show example
</a> </td>
</tr>
<tr>
<td>
<strong>alpha.png</strong>
</td>
<td>
A non-transparent grayscale image in PNG format containing the alpha matte. White pixels are foreground regions, black is background.
–
<a download="example-tiger-alpha.png" href="assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/api-docs/example-tiger-alpha-e0ae0f94e34a25f1e9bd7a2a68a0bb34f1568a5bcdadd62e623b5cb021981032.1aa.dela">
Show example
</a> </td>
</tr>
</tbody>
</table>
<p>
To compose the final image file:
</p>
<ol>
<li>
Extract the files from the ZIP
</li>
<li>
Apply the alpha matte (alpha.png) to the color image (color.jpg).
</li>
<li>
Save the result in a format of your choice (e.g. PNG)
</li>
</ol>
<p>
<strong>Sample code for linux</strong> (requires <a href="http://infozip.sourceforge.net/" target="_blank">zip</a> and <a href="https://imagemagick.org/" target="_blank">imagemagick</a>):
<pre class="language-bash" style="max-width: 450px"><code class="language-bash">$ unzip no-bg.zip && \
convert color.jpg alpha.png \
-compose CopyOpacity \
-composite no-bg.png
</code></pre>
</p>
<p>
A <code>zip2png</code> command-line tool and more code samples can be found <a href="https://github.com/remove-bg/integration/tree/master/zip2png" target="_blank">here</a>.
</p>
<h3 style="margin-top: 40px;">
<a id="oauth-2"></a>
OAuth 2.0
</h3>
<p>
If you want to authenticate users with the click of a button instead of having them enter an API Key, <a href="support5c5b.html?subject=OAuth+2.0+Login">get in touch</a> to try our OAuth 2.0 login.
</p>
</div>
</div>
<div>
<div class="container" style="margin-top:40px; max-width: 700px;">
<h2>
API Reference
</h2>
<script data-cfasync="false" src="cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script type="text/javascript">
Auth.onChange(function() { window.location.reload(); });
</script>
<div id="swagger-docs" data-api-key="" data-url="/api/swagger.yaml"></div>
<h3 style="margin-top: 30px;">
<a id="rate-limit"></a>
Rate Limit
</h3>
<p>
You can process up to <strong>500 images per minute</strong> through the API, depending on the input image resolution in megapixels.
</p>
<p>
<strong>Examples:</strong>
</p>
<table class="table">
<thead>
<tr>
<th>
Input image
</th>
<th>
Megapixels
</th>
<th>
Effective Rate Limit
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
625 x 400
</td>
<td>
1
MP
</td>
<td>
500 images per minute
</td>
</tr>
<tr>
<td>
1200 x 800
</td>
<td>
1
MP
</td>
<td>
500 images per minute
</td>
</tr>
<tr>
<td>
1600 x 1200
</td>
<td>
2
MP
</td>
<td>
500 / 2 =
250 images per minute
</td>
</tr>
<tr>
<td>
2500 x 1600
</td>
<td>
4
MP
</td>
<td>
500 / 4 =
125 images per minute
</td>
</tr>
<tr>
<td>
4000 x 2500
</td>
<td>
10
MP
</td>
<td>
500 / 10 =
50 images per minute
</td>
</tr>
<tr>
<td>
6250 x 4000
</td>
<td>
25
MP
</td>
<td>
500 / 25 =
20 images per minute
</td>
</tr>
</tbody>
</table>
<p>
Exceedance of rate limits leads to a HTTP status 429 response (no credits charged). Clients can use the following response headers to gracefully handle rate limits:
</p>
<table class="table">
<thead>
<tr>
<th style="width: 210px">
Response header
</th>
<th style="width: 130px">
Sample value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>X-RateLimit-Limit</code>
</td>
<td>
<code>500</code>
</td>
<td>
Total rate limit in megapixel images
</td>
</tr>
<tr>
<td>
<code>X-RateLimit-Remaining</code>
</td>
<td>
<code>499</code>
</td>
<td>
Remaining rate limit for this minute
</td>
</tr>
<tr>
<td>
<code>X-RateLimit-Reset</code>
</td>
<td>
<code>1611178930</code>
</td>
<td>
Unix timestamp when rate limit will reset
</td>
</tr>
<tr>
<td>
<code>Retry-After</code>
</td>
<td>
<code>59</code>
</td>
<td>
Seconds until rate limit will reset (only present if rate limit exceeded)
</td>
</tr>
</tbody>
</table>
<p>
Higher Rate Limits are available <a href="support9a1a.html?subject=Rate+Limit+Requirements">upon request</a>.
</p>
<h3 style="margin-top: 30px;">
<a id="exponential-backoff"></a>
Exponential backoff
</h3>
<p>
Exponential backoff is an error handling strategy in which a client periodically retries a failed request.
The delay increases between requests and often includes jitter (randomized delay) to avoid collisions when using concurrent clients.
Clients should use exponential backoff whenever they receive HTTP status codes <code>5XX</code> or <code>429</code>.
</p>
<p>
The following pseudo code shows one way to implement exponential backoff:
</p>
<pre><code class="language-php">retry = true
retries = 0
WHILE (retry == TRUE) AND (retries < MAX_RETRIES)
wait_for_seconds (2^retries + random_number)
result = get_result
IF result == SUCCESS
retry = FALSE
ELSE IF result == ERROR
retry = TRUE
ELSE IF result == THROTTLED
retry = TRUE
END
retries = retries +1
END
</code></pre>
<p class="mt-4">
The maximum number of retries and the delay between retries depends on the use case of your application
and network conditions. Mobile clients may need to retry more often and need longer delays compared to
desktop clients.
</p>
<h3 style="margin-top: 30px;">
API Changelog
</h3>
<p>
Most recent API updates:
</p>
<ul>
<li>
<strong>2020-09-30:</strong> Added <code>type_level</code> parameter and <code>POST /improve</code> endpoint.
</li>
<li>
<strong>2020-05-06:</strong> Added <code>semitransparency</code> parameter.
</li>
<li>
<strong>2019-09-27:</strong> Introduce ZIP format and support for images up to 25 megapixels.
</li>
<li>
<strong>2019-09-25:</strong> Increased maximum file size to 12 MB and rate limit to 500 images per minute. Rate limit is now resolution-dependent.
</li>
<li>
<strong>2019-09-16:</strong> Added <code>enterprise</code> credit balance field to account endpoint.
</li>
<li>
<strong>2019-08-01:</strong> Added <code>add_shadow</code> option for car images.
</li>
<li>
<strong>2019-06-26:</strong> Added <code>crop_margin</code>, <code>scale</code> and <code>position</code> parameters.
</li>
<li>
<strong>2019-06-19:</strong> Added support for animals and other foregrounds (response header <code>X-Type: animal</code> and <code>X-Type: other</code>)
</li>
<li>
<strong>2019-06-11:</strong> Credit balances can now have fractional digits, this affects the <code style="white-space: nowrap;">X-Credits-Charged</code> value
</li>
<li>
<strong>2019-06-03:</strong> Added parameters <code>bg_image_url</code>, <code>bg_image_file</code> (add a background image), <code>crop</code> (crop off empty regions) and <code>roi</code> (specify a region of interest).
</li>
<li>
<strong>2019-05-13:</strong> Added car support (<code>type=car</code> parameter and <code>X-Type: car</code> response header)
</li>
<li>
<strong>2019-05-02:</strong> Renamed size <code>"regular"</code> to <code>"small"</code>. Clients should use the new value, but the old one will continue to work (deprecated)
</li>
<li>
<strong>2019-05-01:</strong> Added endpoint <code>GET /account</code> for credit balance lookups
</li>
<li>
<strong>2019-04-15:</strong> Added parameter <code>format</code> to set the result image format
</li>
<li>
<strong>2019-04-15:</strong> Added parameter <code>bg_color</code> to add a background color to the result image
</li>
</ul>
</div>
</div>
</main>
<footer class="d-none-mobile-app">
<div class="upper pb-4 pt-2 py-md-5">
<div class="container mt-4">
<div class="row">
<div class="col-md">
<div class="d-flex justify-content-between align-items-center py-2" role="button" data-toggle="collapse" data-target="#learn-more-group">
<h2 class="mb-0 mb-md-3">
Learn more
</h2>
<i class="fas fa-plus d-block d-md-none"></i>
</div>
<div id="learn-more-group" class="collapse footer-collapse ml-4 ml-md-0 my-2 my-md-0">
<div class="upper-footer-line"><a class="upper-footer-link" href="g/individuals.html">Individuals</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/photographers.html">Photographers</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/marketing.html">Marketing</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/developers.html">Developers</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/ecommerce.html">Ecommerce</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/media.html">Media</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="g/car-dealerships.html">Car Dealerships</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="enterprise.html">Enterprise</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="pricing.html">Pricing</a></div>
</div>
</div>
<div class="col-md">
<div class="d-flex justify-content-between align-items-center py-2" role="button" data-toggle="collapse" data-target="#tools-api-group">
<h2 class="mb-0 mb-md-3">
Tools & API
</h2>
<i class="fas fa-plus d-block d-md-none"></i>
</div>
<div id="tools-api-group" class="collapse footer-collapse ml-4 ml-md-0 my-2 my-md-0">
<div class="upper-footer-line"><a class="upper-footer-link" href="api.html">API Documentation</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="photoshop.html">Photoshop Extension</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="windows-mac-linux.html">Windows / Mac / Linux</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="design_templates.html">Design Templates</a></div>
</div>
</div>
<div class="col-md">
<div class="d-flex justify-content-between align-items-center py-2" role="button" data-toggle="collapse" data-target="#support-group">
<h2 class="mb-0 mb-md-3">
Support
</h2>
<i class="fas fa-plus d-block d-md-none"></i>
</div>
<div id="support-group" class="collapse footer-collapse ml-4 ml-md-0 my-2 my-md-0">
<div class="upper-footer-line"><a class="upper-footer-link" target="_blank" href="https://help.remove.bg/">Help & FAQs</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="support.html">Contact us</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="refunds.html">Refunds</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" target="_blank" href="http://status.kaleido.ai/">Platform Status</a></div>
</div>
</div>
<div class="col-md">
<div class="d-flex justify-content-between align-items-center py-2 last" role="button" data-toggle="collapse" data-target="#company-group">
<h2 class="mb-0 mb-md-3">
Company
</h2>
<i class="fas fa-plus d-block d-md-none"></i>
</div>
<div id="company-group" class="collapse footer-collapse ml-4 ml-md-0 my-2 my-md-0">
<div class="upper-footer-line"><a class="upper-footer-link" href="blog.html">Blog</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="affiliate/info.html">Affiliate Program</a></div>
<div class="upper-footer-line">
<a class="upper-footer-link" target="_blank" href="https://www.unscreen.com/">
Video Background Removal
<span class="badge-left">NEW</span>
</a> </div>
<div class="upper-footer-line"><a class="upper-footer-link" href="careers.html">Careers</a></div>
<div class="upper-footer-line"><a class="upper-footer-link" href="about.html">About us</a></div>
</div>
<div class="mt-3 d-flex justify-content-between">
<button type="button" class="btn btn-outline-secondary d-md-none" data-toggle="modal" data-target="#languageModal">
<i class="fal fa-globe fa-lg"></i>
<span class="ml-1 mr-2">
English
</span>
<i class="fas fa-chevron-right"></i>
</button>
<div>
<a href="https://www.facebook.com/removebg" target="_blank" class="btn d-inline-flex align-items-center justify-content-center footer-social-media-btn">
<i class="fab fa-facebook-f fa-lg fa-fw"></i>
</a>
<a href="https://www.instagram.com/removebg.official" target="_blank" class="btn d-inline-flex align-items-center justify-content-center footer-social-media-btn">
<i class="fab fa-instagram fa-lg fa-fw"></i>
</a>
<a href="https://twitter.com/remove_bg" target="_blank" class="btn d-inline-flex align-items-center justify-content-center footer-social-media-btn">
<i class="fab fa-twitter fa-lg fa-fw"></i>
</a>
</div>
</div>
</div>
</div>
<div class="row row-eq-height align-items-center mt-3 mt-md-5">
<div class="col-md-4 pt-2">
<button type="button" class="btn btn-outline-secondary d-none d-md-block" data-toggle="modal" data-target="#languageModal">
<i class="fal fa-globe fa-lg"></i>
<span class="ml-1 mr-2">
English
</span>
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="col-md-8 text-md-right pt-2">
<a class="upper-footer-link" href="privacy.html">Privacy Policy</a> |
<a class="upper-footer-link" href="tos.html">Terms of Service</a> |
<a class="upper-footer-link" href="gtc.html">General Terms and Conditions</a> |
<a class="upper-footer-link" href="imprint.html">Imprint</a>
</div>
</div>
</div>
</div>
<div class="lower py-5 text-center">
<div class="container" style="opacity: 0.5;">
<p>
<img alt="remove.bg" style="max-width: 140px;" src="https://assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/logo-footer-4add5d6011751a7a224fa2f1e29859be3ac25d492d299a6c71c4b81e20719415.svg" />
<span class="mx-1 mx-md-2">
<span class="d-none d-md-inline">made with ♥</span>
by
</span>
<a target="_blank" href="https://www.kaleido.ai/">
<img alt="Kaleido" style="max-width: 120px;" src="https://assets/remove-bg-web/0ecd84f6554559cb28c9699e5c5196b290556a5d/assets/logo-footer-kaleido-e1e7a09f241f4fc02fda8c2dd90701fe98ef328c3b1a94d513db891605e377ce.svg" />
</a> </p>
<p class="mt-4 copyright-line">
Copyright 2018-2021 Kaleido AI GmbH - All rights reserved.
</p>
<p style="font-size: 70%;" class="mt-3">
All trademarks, service marks, trade names, product names, logos and trade dress appearing on our website are the property of their respective owners.
Adobe, Creative Cloud and Photoshop are either registered trademarks or trademarks of Adobe in the United States and/or other countries.
0ecd84f6554559cb28c9699e5c5196b290556a5d
</p>
</div>
</div>
</footer>
<div id="improvedialog-popup" class="white-popup mfp-hide" style="max-width: 580px" data-controller="improvedialog">
<h3 style="margin: -20px -20px 25px -20px; padding: 20px 20px 15px 20px; background: #ecf1f9;" class="text-center">
Thanks for your feedback!
</h3>
<div data-target="improvedialog.initial">
<p class="lead">
Want to help us improve? <span style="opacity: 0.5;">(optional)</span>
</p>
<ul style="list-style-type: none; padding-left: 0px;">
<li>
<i class="fas fa-arrow-right" style="margin-right: 5px;"></i>
Contribute this image & help us make remove.bg better
</li>
<li>
<i class="fas fa-arrow-right" style="margin-right: 5px;"></i>
Teach the Artificial Intelligence
</li>
<li>
<i class="fas fa-arrow-right" style="margin-right: 5px;"></i>
Get better results for similar images in the future
</li>
</ul>
<div style="font-size: 80%; margin-top: 15px;">
<label style="font-weight: 300" data-target="improvedialog.terms">
<input type="checkbox" />
I agree to the <a style="color: inherit; text-decoration: underline;" target="_blank" href="ipc.html">Improvement Program Conditions</a>.*
</label>
<label style="font-weight: 300" data-target="improvedialog.remember">
<input type="checkbox" />
Remember my decision for future images that I rate negatively
</label>
</div>
<div class="row" style="text-align: center;">
<div class="col-md-6">
<button class="btn btn-outline-primary" data-action="click->improvedialog#accept" style="margin-top: 15px;">
Yes, contribute image
</button>
<div style="font-size: 75%; opacity: 0.75;">
Choose if you want us to use this image for quality improvements.
</div>
</div>
<div class="col-md-6">
<button class="btn btn-outline-primary" data-action="click->improvedialog#reject" style="margin-top: 15px;">
No, don't contribute
</button>
<div style="font-size: 75%; opacity: 0.75;">
Choose if you do NOT want us to use this image for quality improvements.
</div>
</div>
</div>
</div>
<div class="col-md-12 text-center">
<div data-target="improvedialog.accepted">
<p class="lead">Your image will be used for future improvements of remove.bg.</p>
<button class="btn btn-primary" onclick='$(".mfp-close").click()'>Close</button>
</div>
<div data-target="improvedialog.rejected">
<p class="lead">Your image will NOT be used for future improvements of remove.bg.</p>
<button class="btn btn-primary" onclick='$(".mfp-close").click()'>Close</button>
</div>
</div>
</div>
<div class="modal fade" id="languageModal" tabindex="-1" aria-hidden="true">
<div class="d-flex flex-column" style="height: 100%">
<div class="modal-dialog flex-grow-1 d-flex d-md-block flex-column" style="max-width: 750px">
<div class="modal-content d-flex flex-column flex-grow-1">
<div class="modal-header border-0 pb-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body flex-grow-1 px-0 px-md-4 py-4">
<h2 class="h2 text-center text-dark">Choose Your Language</h2>
<div class="d-flex flex-wrap mt-4 pt-3 pt-md-0 px-4">
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-primary" href="api.html">
English
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="zh/api.html">
中文
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="pt-br/api.html">
Português (Brasil)
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="ja/api.html">
日本語
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="ko/api.html">
한국어
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="ru/api.html">
Русский
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="fr/api.html">
Français
</a> </div>
<div class="col-12 col-md-6 col-lg-4 my-2 my-md-3">
<a class="d-block btn btn-outline-secondary" href="de/api.html">
Deutsch
</a> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<!-- /api 21:43:22 GMT -->
</html>