Remove Background
POST
/crop/remove-backgroundThe Remove Background API empowers you to effortlessly eliminate backgrounds from your images, delivering PNG files with transparent backgrounds. Whether you're enhancing product images for your e-commerce platform, refining portraits for professional use, or creating visually appealing designs, this API streamlines the process of background removal with precision and ease.
Example 1: Below given example removes the background from the image and streams it back to you.
curl --location --request POST 'https://us1-api.crop.photo/v1/crop/remove-background' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"image_url": "https://loremflickr.com/640/480/sports",
"response_type": "stream"
}'
Request
Body Params application/json
image_url
string <url>
required
- Specifies the URL of the image. The URL should be a direct link to the image file, allowing the system to retrieve and process the image as needed.
- The URL must be publicly accessible to ensure the system can retrieve the image without authentication barriers.
- Supported image formats include
.png
,.jpg
,.jpeg
and.webp
, etc. Ensure the URL points directly to a compatible image file. - Use a reliable hosting service to prevent issues with image availability or loading times.
- This property is essential for operations that require an image as input, facilitating the integration of external images into the workflow.
Example:
https://acme.s3.aws.com/image.png
response_type
enum<string>
required
- Specifies the method by which the response is delivered to the client. Available options include:
stream
- The response is streamed back in the same request. This option is optimal for immediate processing or display of the data without the need for a separate download step.url
- The response will be provided as a signed S3 URL. This method will be supported in the future and is ideal for cases where the response needs to be accessed multiple times or shared.- Note: Choosing the appropriate response type depends on the use case and the desired workflow for accessing the response data.
Allowed values:
streamurl
Default:
stream
Example:
stream
Example
{
"image_url": "https://acme.s3.aws.com/image.png",
"response_type": "stream"
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : Binaryapplication/octet-stream
Example
Not configured
Last modified: 5 months ago