Skip to main content
POST
Replace the background with a solid color. Returns a PNG of the subject on that color directly in the response body.
Colors are strings in the format (R, G, B, A). Each value is 0–255, and A is opacity (255 = solid). For example, (255, 140, 0, 255) is solid orange.
Image requirements: upload the image as multipart/form-data in the image field (image URLs aren’t supported). Formats: JPG, PNG, WEBP, BMP, GIF. Size: 1 KB to 10 MB. Content type: image/jpeg, image/png, image/webp, image/bmp or image/gif. Other files return 400 invalid_image. See Errors.

Result

Image
Image

Authorizations

ApiKey
string
header
required

Your API key (looks like bg_live_sk_…). Create one in the dashboard at https://fapihub.com/dashboard/.

Body

multipart/form-data
image
file
required

The image to process, uploaded as a file. Supported formats: JPG, PNG, WEBP, BMP, GIF. Size: 1 KB to 10 MB. The upload's content type must be image/jpeg, image/png, image/webp, image/bmp or image/gif. Image URLs are not supported.

bgcolor
string
required

Background color. Format: (R, G, B, A), each value 0–255, where A is opacity (255 = solid). Example: (255, 140, 0, 255).

Example:

"(255, 140, 0, 255)"

Response

The subject on a solid color. Returned as binary image data with Content-Type: image/png.

The response is of type file.