Skip to main content
POST
Replace the background with a vertical gradient that runs from top_color at the top to bottom_color at the bottom. Returns a PNG 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, top_color=(255, 140, 0, 255) and bottom_color=(229, 46, 113, 255).
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.

top_color
string
required

Color at the top of the gradient. 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)"

bottom_color
string
required

Color at the bottom of the gradient. Format: (R, G, B, A), each value 0–255, where A is opacity (255 = solid). Example: (229, 46, 113, 255).

Example:

"(229, 46, 113, 255)"

Response

The subject on a vertical gradient from top to bottom. Returned as binary image data with Content-Type: image/png.

The response is of type file.