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. GraphQL Content Delivery API
  4. Image Transformations

Image Transformations

markdownView as Markdown

You can use the parameters of Contentstack’s Image Delivery API in GraphQL queries to transform images while fetching them.

The following table consists of the different parameters that Contentstack GraphQL supports for image delivery, along with their acceptable values:

ParameterSupported Values
auto
  • WEBP
width
  • String
height
  • String
disable
  • UPSCALE
format
  • GIF
  • PNG
  • JPG
  • PJPG
  • WEBP
  • WEBPLL
  • WEBPLY
fit
  • BOUNDS
  • CROP
quality
  • Integer
crop
  • String
trim
  • String
orient
  • DEFAULT
  • HORIZONTALLY
  • BOTH
  • VERTICALLY
  • ROTATE90LEFT
  • ROTATE90RIGHT
overlay
  • String
overlay_align
  • TOP
  • BOTTOM
  • LEFT
  • RIGHT
  • MIDDLE
  • CENTER
overlay_repeat
  • X
  • Y
  • BOTH
overlay_width
  • String
overlay_height
  • String
pad
  • String
bg_color
  • String
dpr
  • String
disposition
  • ATTACHMENT
  • INLINE

Let us look at a few simple and complex examples to understand how Contentstack’s Image Delivery parameters work with GraphQL queries to transform images.

Try 'Format' Parameter

Open Builder
GEThttps://graphql.contentstack.com/stacks/apiKey/explore

Let’s get started by using a single format parameter to understand how these parameters function.

To convert an image placed on your Contenstack website from one format to another, use the format parameter. For example, we have set the format parameter to GIF in the following image transformation query.

query {
  all_assets(limit: 25) {
    total
    items {
        title
            url(transform: {format: GIF})
    }
  }
}

This query will convert the current image format to a GIF format.

Try 'Width' and 'Height' Parameters

Open Builder
GEThttps://graphql.contentstack.com/stacks/apiKey/explore

Let’s look at a few sample GraphQL queries that make use of multiple parameters.

Changing the Width and Height

To dynamically resize the width and height of your output image, use the width and height parameters. For example, we have set the values of the width and height parameters to ‘650’ and ‘400’, respectively, in the following image transformation query.

query {
  all_assets(limit: 25) {
    total
    items {
        title
      url(transform: {width: "650", height: "400", disable: UPSCALE})
    }
  }
}

This query will render an output image with width and height values of 650 and 400 pixels, respectively.

NoteWe have also set the disable parameter to UPSCALE to disable the upscale image feature for the output image in the above image transformation query.

Try 'Overlay' and 'Overlay Align' Parameters

Open Builder
GEThttps://graphql.contentstack.com/stacks/apiKey/explore
Using the Overlay and Overlay Align Parameters

To place one image on top of another, use the overlay parameter. In addition, use the overlay_align parameter to define the position of the overlay image.

For example, we have specified the value of the overlay parameter as the URL of the image to be placed on top. We have also set the value of the overlay_align parameter as ‘LEFT’ in the following image transformation query.

query {
  all_assets(limit: 25) {
    total
    items {
        title
      url(transform: {overlay: "/v3/assets/blteae40eb499811073/bltb21dacdd20d0e24c/59e0c401462a293417405f34/download", overlay_align: LEFT})
    }
  }
}

This query will place the image lying at the specified URL on top of the original image. It will also align the overlay image toward the left side of the original image.