Background Color
Fill transparent parts of a PNG image with a specified color. This is useful when you want fill an image that has transparent background with a specific color dynamically to match the web page style (such as in retail product image pages).
This options will be ignored for non-PNG images that do not have transparency. The returned image is JPG by default. This can be changed with format option.
Example
Consider this original PNG image with transparent background. Due to the transparent background of the image, you see the page color as the background color.

Below are some transformations with bgcolor that fills the background transparency with a specified color.
| Transformation | Examples | Description |
|---|---|---|
bgcolor=f00000 | request a image with red background | |
bgcolor=008080 | ![]() | request a image with teal background |
The transformation parameters are described below:-
| Parameter | Description |
|---|---|
bgcolor=color | specify the hex color code (6 characters - RRGGBB). |
Examples
Background color parameters go on the asset's on-demand image URL, like every other transformation, and combine with other options using &:
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?bgcolor=f00000
| URL | Result |
|---|---|
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?bgcolor=f00000 | transparent areas filled red |
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?bgcolor=008080&format=jpg | transparent areas filled teal, returned as JPG |
