Remove Background (Basic plan)

Changed on

Remove background from an image

post/v1/segment

Request

  • Base URL
    https://sdk.photoroom.com
  • URL
    https://sdk.photoroom.com/v1/segment
  • Auth
    API key in header x-api-key

Request body multipart/form-data

image_filestring binary required

The image file to render

format'png' | 'jpg' | 'webp'

The format of the resulting image

channels'rgba' | 'alpha'

The channels of the resulting image

bg_colorstring

The background color of the resulting image. Can be a hex code (#FF00FF) or a HTML color (red, green, etc.)

size'preview' | 'medium' | 'hd' | 'full'

Will resize the output to the specified size. Can be preview (0.25 Megapixels), medium (1.5 MP), hd (4 MP) or full (36 MP, can be slower for large images). Useful for mobile apps that need smaller images.

crop'true' | 'false'

If true, the image returned is cropped to the cutout border. Transparent pixels are removed from the border

despill'true' | 'false'

If true, automatically removes colored reflections that have been left on the main subject by a green background.

Response

OK

base64imgstring base64 required

Changes