Get inspired at ContentCon. Learn more and register today
Get inspired at ContentCon. Learn more and register today
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Image Delivery API
  4. Background Color

Background Color

markdownView as Markdown

The bg-color parameter lets you set a backgroud color for the given image. This is useful when applying padding or for replacing the transparent pixels of an image. There are three possible types of values for this parameter. 

The first type is the 3- or 6-digit hexadecimal value, for example ?bg-color=cccccc.

Click to enlarge

Change background color using hexadecimal value

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.png?environment={environment_name}&bg-color={value}

Note Check out the limitations that are applicable here.

The second type is the Red, Blue, Green value which defines the intensity of the corresponding color, with the value ranging anywhere between 0 and 255 for each. An example of this is ?bg-color=140,220,123. 

Change background color by Red, Blue, Green value

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.png?environment={environment_name}&bg-color={value}

Note Check out the limitations that are applicable here.

And the last type is the Red, Blue, Green, Alpha value, which is an extension of the second type with an addition of the alpha element. The alpha value defines the transparency, with 0.0 being fully transparent and 1.0 being completely opaque. An example of this is ?bg-color=140,220,123,0.5.

Change background color by Red, Blue, Green, Alpha value

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.png?environment={environment_name}&bg-color={value}

Note Check out the limitations that are applicable here.

Hide Parameters

Query Parameters

bg-coloroptionalstring

Enter the value for the background color. It should be a 3- or 6-digit hexadecimal value.

Example:

cccccc
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production
Hide Parameters

Query Parameters

bg-coloroptionalstring

Enter the value for the background color. It should be a Red, Blue, Green value.

Example:

140,220,123
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production
Hide Parameters

Query Parameters

bg-coloroptionalstring

Enter the value for the background color. It should be a Red, Blue, Green, Alpha value.

Example:

140,220,123,0.5
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production