Skip to main content

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).

info

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.

image

Below are some transformations with bgcolor that fills the background transparency with a specified color.

TransformationExamplesDescription
bgcolor=f00000request a image with red background
bgcolor=008080request a image with teal background

The transformation parameters are described below:-

ParameterDescription
bgcolor=colorspecify the hex color code (6 characters - RRGGBB).