Background colour
Log in to add to favouritesPage last updated 07 October 2026
The background or bg parameter fills the transparent areas of an image with a colour. It is most often used with fit fill, which pads an image to the dimensions requested, and with a rotation that is not a multiple of 90 degrees, which leaves empty corners.
Colour values
The value is a hex colour, given with or without a leading # character, in any of these lengths:
| Digits | Meaning | Example |
|---|---|---|
| 3 | Red, green and blue in shorthand | bg=fff |
| 4 | Shorthand with an alpha value | bg=fff8 |
| 6 | Red, green and blue | bg=ff0000 |
| 8 | Red, green, blue and an alpha value | bg=ff000080 |
An alpha value below ff leaves the fill partly transparent. That is only visible in a format that stores transparency, such as PNG or WebP. A JPEG has no transparency to store, so a partly transparent fill is flattened.
Padding a fit

Filling the corners of a rotation

Give it after the transformation it fills
The parameter only fills transparency that exists at the point it is reached, so it must come after the transformation that creates it. In ?bg=ff0000&width=500&height=500&fit=fill there is nothing to fill when the colour is applied, so the padding is left transparent and the request appears to ignore it.
A background colour given for an image that has no transparent areas has no effect. It does not replace an existing background or tint the image.