Sets the background color of the image.

The bg-color parameter sets the background color of an image to use when applying padding or when replacing transparent pixels.



value may be one of:

  • Hex RGB value: Both 3- and 6-digit values are acceptable (e.g. a22 or cf23a5).
  • Decimal RGB: RGB values between 0 and 255. Comma-delimited (e.g. 255,0,0).
  • Decimal RGB with alpha| RGBA colors include an additional value for alpha (transparency), which ranges from 0 for fully transparent to 1 for fully opaque.


Click the links to view the transformed image using a demo Fastly IO service.

Example usageDescription
?bg-color=c5c5c5Set background color to grey
?bg-color=000Set background color to black
?bg-color=0,255,0Set background color to green
?bg-color=0,255,0,0.5Set background color to green with 50% transparency