Image Background Removal

PicWish API enables to integrate the automatic background removal solution on any platform.
curl --request POST \
--url 'https://api.apilayer.com/picwish/segmentation' \
--header 'apikey: dq2TlGLIDrBh1OHx0o7umAtVyyhNzFrE' \
--data-raw '{body}'
{"message":"No sample response available for this endpoint yet."}

PicWish API helps you automatically process a large number of images by removing the background and, if needed, replacing them with a solid background color. It is powered by AI and has the top-ranking algorithm with perfect image processing results.

 

Parameters Type Required Description Remarks
image_file file No Image file
  • Supported image types

    jpg, jpeg, bmp, png, webp, tiff, bitmap

  • image_url

    Support HTTP protocol and OSS protocol

    Up to 512 strings

    Download timeout of 10 seconds

  • One of the three must be chosen
  • Priority

    image_file>image_url>image_base64

  • The input image size (as received by the server) should not exceed 15MB.
image_base64 string No Image encoding in base64 format will increase the file size by 33%, not recommended
image_url string No Image Download Address
sync int No Whether to return synchronously
  • 0:Asynchronous
  • 1:Synchronize
type string No Image type Do not fill in, automatically recognize the type of cutout [default]
  • person: Portraits
  • object: Products
  • stamp: Stamps
return_type int No Result return method
  • 1: Return the download address of the image [default]
  • 2: Return the image as a base64 string
output_type int No Return results for selected images
  • 1: Return to image and mask
  • 2: Return to image [default]
  • 3: Return to mask

Image cutout results(color image),mask black and white mask area

crop int No Crop to edge
  • 0: Return to original image size [default]
  • 1: Crop to the edge of the target
format string No Image format
  • png:Transparent image [default]
  • jpg:No transparency, default white background, set the background color through bg_color
bg_color string No Image background color This parameter will take effect only when the format is JPG.

Solid background color, not filled,JPG defaults to white background, rgb hex format, for example

  • White:ffffff
  • Red:ff0000
  • Blue:0000ff