Slazzer auto background removal API
Remove image background with just a single API call
-F '[email protected]/your/image/file.jpg'
-f https://slazzer.com/api/v1/remove_image_background
Our AI will remove the background from any image that has a clear foreground and Background. (Tested with human, cars, animals, & Products )
Check out our sample code
Remove background from image file
Environment
SLAZZER - SDK
Check out the official android library here
Output Formats
Easily request any one of the 2 formats via our format parameter
Format | Resolution |
---|---|
png |
|
jpg |
|
*Please note that PNG images above 10 megapixels are not supported by default. If you don't require transparency we recommend using the JPG format.
API Reference
Server URL:https://slazzer.com/api/v1
Request Body:multipart/form-data
Method:POST
API:/remove_image_background
Authorization
-
API-KEY
stringYour API key
Parameters Request body
-
source_image_file
string($binary)Source image file. Support only PNG, JPG, JPEG.
*** use only one source_image_ parameters at a time
-
source_image_url
stringSource image url. Support only PNG, JPG, JPEG.
*** use only one source_image_ parameters at a time
-
source_image_base64
stringSource image base64 format. Support only PNG, JPG, JPEG.
*** use only one source_image_parameters at a time
-
output_image_format
stringParameter value: base64. Support only PNG, JPG, JPEG.
*** use only one output_image_parameters at a time
-
format
stringOutput image format. Default value 'png'. Otherwise 'jpg' for JPG format and 'png' for PNG format. 'png' format support alpha transparency.
-
scale
stringScale value from 10 to 100 applicable. Default value 100. Scaling will apply from center.
-
bg_color_code
stringOutput with solid background color. Has to be HEX color code. (e.g. #72E4B3, #B3D472).
*** Please Note: Add '#' before color code.
*** use only one bg_parameters
-
bg_image_file
string($binary)Output with image file background. This image will be resize according to the output image file aspect ratio. supported bg_image_file formats are 'png', 'jpg', 'jpeg'.
*** use only one bg_parameters
-
bg_image_url
stringOutput with image url background. This image will be resize according to the output image file aspect ratio. supported bg_image_file formats are 'png', 'jpg', 'jpeg'.
*** use only one bg_parameters
-
bg_image_base64
stringOutput with image base64 background.This image will be resize according to the output image file aspect ratio. supported bg_image_file formats are 'png', 'jpg', 'jpeg'.
*** use only one bg_parameters
-
crop
booleanDefault value: false. It will crop all extra transparent pixels
-
crop_margin
intAdds a margin around the cropped image (eg value: 20). This parameter will only take effect if crop is true.
*** Only when use crop parameter
-
preview
booleanDefault value: false. If true it will resize image to 0.25 megapixel. (eg value: 400x600 pixels)
Response
-
Code : 200
Successfully removed image background
{
"output_image_url": "image_url"
} -
Code: 400
Error: Invalid parameters or unable to process input image file (No credit deducted)
Example :
{
"error": "Source image file not found"
} -
Code: 401
Error: API-KEY missing or invalid API-KEY (No credit deducted)
Example :
{
"error": "invalid api key"
} -
Code: 402
Error: No credits remaining (No credit deducted)
Example :
{
"error": "No credits remaining"
} -
Code: 429
Error: Api rate limit crossed (No credit deducted)
Example :
{
"error": "Api rate limit crossed"
}
Credit API Reference
Server URL:https://slazzer.com/api/v1
Request Body:multipart/form-data
Method:POST
API:/account
Parameters Request body
-
api_key
stringYour API key
Response
-
Code : 200
Successfully fetched credit details
{
"plan_credits": XXX,
"other_credits": XXX,
"total_credits": XXX
}
API Rate Limit
You can instantly process upto 500 images per minute via the API , but depending on the input image megapixel resolution.
Megapixels | Rate Limit | Input image size |
---|---|---|
1 MP | 500 / 1 = 500 images / min | Upto 1200 x 820 |
2 MP | 500 / 2 = 250 images / min | Upto 1600 x 1200 |
4 MP | 500 / 4 = 125 images / min | Upto 2500 x 1600 |
10 MP | 500 / 10 = 50 images / min | Upto 4000 x 2500 |
25 MP | 500 / 25 = 20 images / min | Upto 6250 x 4000 |
Error code 429 will return if api rate limit exceed & no credit will be charged.
Higher api rate limit are available for enterprise customers. Contact Us