We recommend limiting images to 25 megapixels for optimal performance.
Maximum File Size: 50MB
Maximum Resolution: 6,000 pixels on the widest side
Please note that large images will result in API calls taking a longer time to complete.
If you experience timeouts, we recommend that you try to increase the default timeout of your networking library.
Can I use the URL of an image?
The Remove Background API requires you to upload the content of your image file when making the API call.
However, if your images are already hosted online, it's possible that you don't have the image file itself, but rather a URL that points to the file.
If that's the case, there are two solutions for you to process your image through the Photoroom API.
Option 1: Download the image locally
In most situations, you should be able to use the image URL to download the content of the image, store it in a local variable, and then use it when calling the Remove Background API.
Here's an example code in JavaScript of how to implement this workflow:
If downloading the content of the image in a local variable is absolutely not possible for you, then you can use our Image Editing API to process your images.
The Image Editing API does offer a GET endpoint, thanks to which you can use the argument imageUrl to pass the URL of your image.
The Image Editing API is part of our Plus plan and calling this API is more expensive than calling the Remove Backhround API.