---
title: "Image parameters in Content SDK apps"
slug: "image-parameters-in-content-sdk-apps"
abstract: "Use parameters to resize or configure images rendered by Content SDK Image and NextImage components."
---
# Image parameters in Content SDK apps

When using the `NextImage` component (imported from `@content-sdk\next`) or the `Image` component (imported from `@content-sdk\react`), you can apply image parameters. Some of these parameters affect visual aspects of the rendered image, such as sizing. Others provide more generic metadata, such as the language or version of the image.

These parameters either appear in the `srcset` attribute of the rendered HTML `img` element or are appended to the image's source URL as query string parameters.

Here is a list of parameters you can define as part of the `imageParams` object for both [`Image`](https://doc.sitecore.com/sai/en/developers/content-sdk/20/the-content-sdk-image-component.html "The Content SDK Image component") and [`NextImage`](https://doc.sitecore.com/sai/en/developers/content-sdk/20/the-content-sdk-nextimage-component.html "The Content SDK NextImage component") components:

<table style="width:100%;" class="informaltable frame-void rules-rows"><thead><tr><th class="th"><p>Key</p></th><th class="th"><p>Description</p></th></tr></thead><tbody><tr><td class="td"><p><code class="code">w</code></p></td><td class="td"><p>Width in pixels.</p></td></tr><tr><td class="td"><p><code class="code">h</code></p></td><td class="td"><p>Height in pixels.</p></td></tr><tr><td class="td"><p><code class="code">mw</code></p></td><td class="td"><p>Maximum width in pixels.</p></td></tr><tr><td class="td"><p><code class="code">mh</code></p></td><td class="td"><p>Maximum height in pixels.</p></td></tr><tr><td class="td"><p><code class="code">la</code></p></td><td class="td"><p>Language (defaults to context language).</p></td></tr><tr><td class="td"><p><code class="code">vs</code></p></td><td class="td"><p>Version (defaults to the latest version).</p></td></tr><tr><td class="td"><p><code class="code">db</code></p></td><td class="td"><p>Database name (defaults to context database).</p></td></tr><tr><td class="td"><p><code class="code">bc</code></p></td><td class="td"><p>Background color (defaults to black).</p></td></tr><tr><td class="td"><p><code class="code">as</code></p></td><td class="td"><p>Whether to allow the image to stretch or upscale beyond its original size (<code class="code">1</code> to enable stretching, <code class="code">0</code> to disable it).</p></td></tr><tr><td class="td"><p><code class="code">iar</code></p></td><td class="td"><p>Whether to ignore the image's aspect ratio when resizing it (<code class="code">1</code> to ignore the aspect ratio, <code class="code">0</code> to preserve it).</p></td></tr><tr><td class="td"><p><code class="code">sc</code></p></td><td class="td"><p>Scale by floating point number (for example, <code class="code">sc=.25</code> scales the image to 25% of its normal size).</p></td></tr><tr><td class="td"><p><code class="code">thn</code></p></td><td class="td"><p>Whether to return a version of the image optimized for use as a thumbnail (<code class="code">1</code> to return the thumbnail, <code class="code">0</code> to return the regular image).</p></td></tr><tr><td class="td"><p><code class="code">dmc</code></p></td><td class="td"><p>Whether to disable media caching for both retrieval and storage (<code class="code">1</code> to disable media caching, <code class="code">0</code> to enable it).</p></td></tr></tbody></table>

> [!note]
> The `Image` component also supports the standard `srcSet` property, which accepts a subset of `imageParams` keys (namely `w`, `h`, `mw`, `mh`, `iar`, `as`, and `sc`).
>
> `NextImage` supports all [`next/image` properties](https://nextjs.org/docs/api-reference/next/image) except `src`, and it does not support `srcSet`.

## Examples

### The Image component

The following example demonstrates how to configure an `Image` component with the `srcSet` and `sizes` properties. This example renders a responsive image with server-side resizing, and the parameters provided appear as corresponding `srcset` and `sizes` attributes on the resulting HTML `img` element.

For example:

```javascript
<Image
  field={props.fields.sample2}
  srcSet={[{ mw: 300 }, { mw: 100 }]}
  sizes="(min-width: 960px) 300px, 100px"
  className="img-fluid"
/>
```

### The NextImage component

This first example shows how to leverage server-side resizing by providing image size parameters to a `NextImage` component via the `imageParams` property. Specifying the size of the image like this means you also need to set the Next.js `unoptimized` property to `true`.

```typescript
<NextImage
  field={props.fields.image}
  unoptimized={true}
  imageParams={{ mw: 100, mh: 50 }}
  height="50"
  width="94"/>
```

This second example uses `priority` to specify that the image has high priority and must be preloaded rather than lazy-loaded, and the `fill` property to cause the image to fill the parent element instead of having a specific width or height.

```typescript
<NextImage
  field={props.fields.image}
  sizes="(min-width: 960px) 300px, 100px"
  fill={true}
  priority={true}
/>
```