Services
Image Without Background
Removes Image Background
curl -H 'X-API-Key:YOUR_API_KEY' \
-F 'image_file=@/path/to/file/image.jpg' \
-f https://api.withoutbg.com/v1.0/image-without-background \
-o /path/to/file/image-without-background.jpg
Output
A PNG image

Http Response Status Codes
Background Blur
Adds blur to background
curl -H 'X-API-Key:YOUR_API_KEY' \
-F 'image_file=@/path/to/file/image.jpg' \
-F 'background_gaussian_blur=5' \
-f https://api.withoutbg.com/v1.0/background-blur \
-o /path/to/file/image-blurred.jpg
Output
A JPG Image

Request Parameters
background_gaussian_blur
- Blur Amount Http Response Status Codes
Get Mask
Returns background or foreground mask
curl -H 'X-API-Key:YOUR_API_KEY' \
-F 'image_file=@/path/to/file/image.jpg' \
-F 'output_size=same_as_input' \
-F 'region_to_mask=bg' \
-f https://api.withoutbg.com/v1.0/get-mask \
-o /path/to/file/mask.png
Output
A PNG Image

Request Parameters
region_to_mask
- either "fg" or "bg" output_size
- either "same_as_input" or "small_square" Http Response Status Codes
Available Credit
Returns available credit for an API Key.
curl -H 'X-API-Key:YOUR_API_KEY' \
-f https://api.withoutbg.com/v1.0/available-credit
Output
A JSON Object
Http Response Status Codes
Replacing Image Background
Replaces Image Background
curl -H 'X-API-Key:YOUR_API_KEY' \
-F 'image_file=@/path/to/file/image.jpg' \
-F 'background_file=@/path/to/file/background.jpg' \
-f https://api.withoutbg.com/v1.0/replace-background \
-o /path/to/file/background-replaced.jpg
Output
A JPG Image

Request Parameters
image_file
- The image file containing the foreground object. background_file
- The background. If it is not the same with the image_file, then it will be cropped.