Slazzer auto background removal API

Remove image background with just a single API call
$ curl -H 'API-KEY: YOUR_API_KEY'
       -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
  • Upto 10 MP , Ex - 3872 x 2592
jpg
  • Upto 25 MP , Ex - 6250 x 4000

*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
    string

    Your 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
    string

    Source image url. Support only PNG, JPG, JPEG.

    *** use only one source_image_ parameters at a time

  • source_image_base64
    string

    Source image base64 format. Support only PNG, JPG, JPEG.

    *** use only one source_image_parameters at a time

  • output_image_format
    string

    Parameter value: base64. Support only PNG, JPG, JPEG.

    *** use only one output_image_parameters at a time

  • format
    string

    Output image format. Default value 'png'. Otherwise 'jpg' for JPG format and 'png' for PNG format. 'png' format support alpha transparency.

  • scale
    string

    Scale value from 10 to 100 applicable. Default value 100. Scaling will apply from center.

  • bg_color_code
    string

    Output 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
    string

    Output 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
    string

    Output 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
    boolean

    Default value: false. It will crop all extra transparent pixels

  • crop_margin
    int

    Adds 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
    boolean

    Default value: false. If true it will resize image to 0.25 megapixel. (eg value: 400x600 pixels)

  • output_mask
    boolean

    Default value: false. If true it will send mask image url. Will not work with binary parameter.

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
    string

    Your 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 1200 images per hour via the API, but depending on the input image megapixel resolution.

Duration Rate Limit Input image size
Per Day Max 20 x 60 x 24 = 28800 images Upto 25 MP
Per Hour Max 20 x 60 = 1200 images Upto 25 MP
Per Minute Max 20 x 1 = 20 images Upto 25 MP

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