Overview
Sources
Libraries
Images API

Background Color background-color

Specify the color to be used for the background of the image.

Values

By default background color is white for output formats not supporting transparency (jpeg) and a total transparent color for images that supports transparency (png, webp and avif).

For more information on how to specify colors visit the color values section.

Examples

Specify a padding of 40 pixels with padding=40 parameter and without specifying a background color will render an image with a non transparent white background color (using default format=jpeg):

GET
https://assets.imglab-cdn.net/woman.jpeg?padding=40
Woman holding a camera with a padding of 40 and a default white background color.
x px

Specify a padding of 40 pixels with padding=40 parameter and without specifying a background color will render an image with a total transparent background color (using format=png):

GET
https://assets.imglab-cdn.net/woman.jpeg?padding=40&format=png
Woman holding a camera with a padding of 40 and transparent background using png as output format.
x px

Specify a custom background color with background-color=eee parameter:

GET
https://assets.imglab-cdn.net/woman.jpeg?padding=40&background-color=eee
Woman holding a camera with a padding of 40 and a light gray background color using background-color parameter.
x px

Specify a custom semi-transparent background color with background-color=75,75,75,128 and format=png parameters:

GET
https://assets.imglab-cdn.net/logo.pdf?background-color=75%2C75%2C75%2C128&format=png
imglab logo with a semi-transparent background logo using png as output format and color with alpha on background-color parameter.
x px