v1

latestOpenAPI 3.0.02026-07-13650400.5 KB
Image Editing

Crop out foreground

Description

The Crop Route is used to remove the background from an image and crop tightly around the foreground or remaining region of interest. It supports both images with and without a background.

post/crop

Headers

api_tokenstring required

Request body

image_urlstring

The URL of the input image. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

filestring

The file of the input image, in base64 format. Used if image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

paddinginteger

Cropping the object with padding around it. Currently, padding is applied to all four borders of the remaining region. This parameter is optional.

force_rmbgboolean

Forces background removal, even if the original image already contains an alpha channel. Useful for refining existing foreground/background separation or ignoring unnecessary alpha channels.

Response

Successful operation.

result_urlstring

URL that represents the updated visual created in the request. It is a temporary URL that will expire

Example response

{
  "result_url": "URL"
}