curl -F 'api_key=YOUR_CLICKMAJIC_API_KEY'
-F 'sourceFile=@source_image_path'
-f https://api.clickmajic.com/v1/remove-background
-o output.png
Our AI will remove the background from any image that has a clear foreground and Background. (Tested with human, cars, animals, & products )
Remove background from image file
Easily request any one of the 2 formats via our format parameter
Format | Resolution |
---|---|
PNG | Upto 10 MP , Ex - 3872 x 2592 |
JPG | Upto 16 MP , Ex - 6250 x 4000 |
Parameters | |
---|---|
api_key string | Your API key |
sourceFile string($binary) | Source image file. Support only PNG, JPG, JPEG. *** use only one source parameter at a time |
sourceUrl string | Source image url. Support only PNG, JPG, JPEG. *** use only one source parameter at a time |
sourceBase64 string | Source image base64 format. Support only PNG, JPG, JPEG. *** use only one source parameter at a time |
bgImageFile string($binary) | This binary image file will be placed as a background of the output binary image. This image will be resized according to the output image aspect ratio. supported bgImageFile formats are 'png', 'jpg', 'jpeg'. *** use only one bg parameter |
bgImageUrl string | This image from the url will be placed as a background of the output binary image. This image will be resized according to the output image aspect ratio. supported bgImageUrl formats are 'png', 'jpg', 'jpeg'. *** use only one bg parameter |
bgImageBase64 string | This image from the base64 string will be placed as a background of the output binary image. This image will be resized according to the output image aspect ratio. supported bgImageBase64 formats are 'png', 'jpg', 'jpeg'. *** use only one bg parameter |
bgColorCode 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 parameter |
format string | Output image format. Default value 'png'. Otherwise 'jpg' for JPG format and 'png' for PNG format. 'png' format support alpha transparency. |
crop boolean | Default value: false. It will crop all extra transparent pixels |
cropMargin string | This parameter only work when crop applied (crop=True). Default value of this parameter is 0px. it supports input value in the following ways
Ex. 20px - create margin all around the subject..
|
scale string | This parameter scales the subject in the output image. Can be any range between 10% or 100% depending on the image dimensions. Default position parameter value is 'center', unless any other position parameter value is given. |
position string | This parameter place the subject within the image canvas. Only works when 'scale' parameter is given. Default value is 'center'. Can be a single value between 0% to 100%(horizontal and vertical) or two values between 0% to 100% separated by comma(eg: 10%,18%) both horizontal and vertical. |
preview boolean | Default value: false. If true it will resize image to 0.25 megapixel. (eg value: 400x600 pixels) |
channel string | This parameter will return the image channel(red, green, blue, alpha) in RGBA or alpha mask format. 'rgba' is the default parameter, returns alpha mask when value is set to 'alpha'. |
roi string |
This parameter when given will let you extract the region of
interest of a particular image, only the contents of the
selected rectangular will be consider as a foreground and
everything else will be consider as background and will be
completely removed. |
Response | |
Code : 200 | Successfully removed image background Binary image data |
Code : 401 | Error: api_key missing or invalid api_key (No credit deducted) Example :
{ "errors": [ { "detail": "Unauthorized.", "status": 401 } ] } |
Code: 422 |
Error: No credits remaining, or invalid parameters, or
unable to process input image, or Api rate limit crossed Example :
{ "errors": [ { "status": 422, "detail": "No credits remaining." } ] } |
Parameters | |
---|---|
api_key string | Your API key |
Response | |
Code : 200 | Successfully fetched credit details
{ "data": { "creditSubscription": 123, "creditOneTimePayment": 123, "creditFree": 123, "creditTotal": 123 } } |
You can instantly process upto 500 images per hour via the API, but depending on the input image megapixel resolution.
Input Image | Megapixels | Rate Limit approx |
---|---|---|
625 x 400 | 1 MP | 500 images per minute |
1200 x 800 | 1 MP | 500 images per minute |
1600 x 1200 | 2 MP | 250 images per minute |
2500 x 1600 | 4 MP | 125 images per minute |
4000 x 2500 | 10 MP | 50 images per minute |
6250 x 4000 | 16 MP | 20 images per minute |