Remove Background

Remove & Change Background

Changed on

Discover the magic of seamless background removal with our removebg service, powered by cutting-edge AI technology. Our sophisticated algorithm effortlessly identifies and isolates the foreground, ensuring every detail from the delicate intricacies of jewelry to the finest strands of hair is captured with unparalleled precision. Designed to excel across a vast array of use cases, our service guarantees immaculate cutouts, whether for professional product photos, dynamic campaign graphics, or personal images meant for creative exploration. Experience flawless edges and exceptional detail preservation every time, elevating your images beyond the ordinary.

post/removebg

Request

  • Base URL
    https://api.picsart.io/tools/1.0
  • URL
    https://api.picsart.io/tools/1.0/removebg
  • Auth
    API key in header X-Picsart-API-Key

Request body multipart/form-data

imagestring binary

Source image file (binary). (If this parameter is present, the other image source parameters must be empty.)

image_urlstring uri

Source image URL. (If this parameter is present, the other image source parameters must be empty.)

image_idstring

Deprecated. Source image ID of an image previously uploaded to Picsart or result image ID from a different API. (If this parameter is present, the other image source parameters must be empty.)

output_type'mask' | 'cutout'

Select one of the two output options. If you submit a photo of a person, cutout returns the person as a sticker while mask returns a mask photo of the person.

bg_imagestring binary nullable

Source image file (binary). (If this parameter is present, the other image source parameters must be empty.) This only has an effect when output=cutout.

bg_image_urlstring uri nullable

Source image URL. (If this parameter is present, the other image source parameters must be empty.) If this has a value, the output value is dismissed.

bg_image_idstring nullable

Deprecated. Source image ID of an image previously uploaded to Picsart or result image ID from a different API. (If this parameter is present, the other image source parameters must be empty.) See /upload method. If this has a value, the output value is dismissed.

bg_colorstring nullable

Can be a hexcolor code (e.g., #82d5fa, #fff) or a color name (e.g., blue). For semi-transparency, 4-/8-digit hexcodes are also supported (e.g., #18d4ff87). (If this parameter is present, the other bg_ parameters must be empty).

bg_blurinteger

Enter an integer value from 0 to +100.

bg_widthinteger

Size, in pixels, for the width. If left blank, the background is left at its original width.

bg_heightinteger

Size, in pixels, for the height. If left blank, the background is left at its original height.

scale'fit' | 'fill'

Fit is where the longer side (width/height) fits the background. Fill is where the shorter side fits the background. Fit is the default.

auto_centerboolean

Automatically center the object. Works only, when output_type=cutout. We don't recommend using this flag when the object is visible only partially (e.g. half-cup or half-shoe is in the image).

stroke_sizeinteger nullable

Add a solid stroke (border) around the cutout result. Works when output_type=cutout. Set 0 to remove. Takes values from 0 to 100.

stroke_colorstring nullable

Define the color of the stroke. Can be a hexcolor code (e.g., #82d5fa, #fff; with or without #) or a color name (e.g., blue; in English). For semi-transparency, 4-/8-digit hexcodes are also supported (e.g., #18d4ff87). Gets applied if the stroke_size is 1 and above.

stroke_opacityinteger nullable

Define the opacity of the stroke added to the cutout result. Works when output_type=cutout and stroke_size is 1 and above. Takes values from 0 to 100. Default is 100 (opaque). Set to 0 to make it transparent.

shadow'disabled' | 'custom' | 'bottom-right' | 'bottom' | 'bottom-left' | 'left' | 'right' | 'top-left' | 'top' | 'top-right'

A universal parameter to configure the shadow. The default value is "disabled" and it will make sure that the shadow is not rendered. The "custom" value allows to define custom position for the shadow, when this value is chosen, the shadow_offset_x and the shadow_offset_y will get applied. Other values are shadow directions with preset shadow setup (10px).

shadow_opacityinteger nullable

Shadow Opacity. Works when shadow is enabled (a non-disabled value).

shadow_blurinteger nullable

Shadow Blur. Works when shadow is enabled.

shadow_offset_xinteger nullable

Shadow Offset X. This is mandatory to specify when shadow=custom.

shadow_offset_yinteger nullable

Shadow Offset Y. This is mandatory to specify when shadow=custom.

model'urn:air:picsart:model:picsart:sod@8.2' | 'urn:air:picsart:model:picsart:sod@10' | 'urn:air:picsart:model:picsart:sod@10.1' | 'urn:air:picsart:model:picsart:sod@11' nullable

Optionally choose a specific AI model to use for this request. If not specified, a default model will be applied. Please note that the default model may change over time as Picsart continues to improve performance and accuracy. Any change to the default will be made only after thorough testing and validation to ensure it delivers better results. If you require consistent behavior or wish to evaluate different models on your own, we recommend explicitly setting this parameter.

format'JPG' | 'PNG' | 'WEBP'

Optionally select one of the image formats (PNG is chosen if left blank). Options are as follows:

  • JPG
  • PNG
  • WEBP

Response

Success.

statusstring

Changes

    • warning

      the optional response header X-Correlation-Id removed for the status 400

    • warning

      the optional response header X-Correlation-Id removed for the status 401

    • warning

      the optional response header X-Correlation-Id removed for the status 403

    • warning

      the optional response header X-Correlation-Id removed for the status 404

    • warning

      the optional response header X-Correlation-Id removed for the status 405

    • warning

      the optional response header X-Correlation-Id removed for the status 413

    • warning

      the optional response header X-Correlation-Id removed for the status 415

    • warning

      the optional response header X-Correlation-Id removed for the status 429

    • warning

      the optional response header X-Correlation-Id removed for the status 431

    • warning

      the optional response header X-Correlation-Id removed for the status 500

    • warning

      the optional response header X-Correlation-Id removed for the status 503

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      the request property default value #008800 was removed

    • info

      added the non-success response with the status