---
title: "Image Overlay API — Dynamic images in templates | Imejis"
description: "Place photos, logos or screenshots in a template and point the URL at a new image on every API call — fit, crop, round and frame. Start generating free."
url: "https://www.imejis.io/components/image"
---

# Image Overlay API — Dynamic images in templates | Imejis

Displays an image from a URL with object-fit sizing, positioning, borders, rounding and shadows. Swap the URL at render time to personalize every image.

## Use cases

- Product cards that pull each item photo from your catalog URL
- OG images featuring the author avatar or article hero image
- E-commerce promo visuals with the featured product swapped per render
- Certificates and badges stamped with a partner or event logo

## Authoring notes

- The image URL lives in the component-level `image` field, not in properties.

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `image` | `string` | — | Image URL (stored on the component's top-level image field; overridable via config). |
| `imageSize` | `'cover' \| 'contain' \| 'fill' \| 'none' \| 'scale-down'` | `"cover"` | How the image fits its box (CSS object-fit). |
| `imagePosition` | `string` | `"center"` | Focal point of the image within its box (CSS object-position). |
| `backgroundColor` | `color` | `"transparent"` | Background color visible behind/around the image. |
| `padding` | `string` | `"0"` | CSS padding between the box edge and the image. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Sample design JSON

```json
{
  "title": "Image sample",
  "description": "A rounded dynamic photo",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-image",
      "key": "photo",
      "type": "image",
      "position": {
        "x": 250,
        "y": 60
      },
      "rotation": 0,
      "size": {
        "width": 300,
        "height": 300
      },
      "dynamic": true,
      "image": "https://picsum.photos/600/600",
      "properties": {
        "imageSize": "cover",
        "borderRadius": 16,
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### E-commerce product hero

A wide cover-cropped product photo filling the card, corners rounded.

API overrides that reproduce this example:

```json
{
  "photo.imageSize": "cover",
  "photo.borderRadius": 16
}
```

### Article thumbnail with soft shadow

A blog-post thumbnail lifted off the canvas by a deep drop shadow.

API overrides that reproduce this example:

```json
{
  "photo.borderRadius": 24,
  "photo.boxShadow": "0 20px 40px rgba(0,0,0,0.2)"
}
```

## API overrides

Point '<key>.image' (or just '<key>') at any image URL per render; opacity, borders and padding can be overridden too.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "photo.image": "https://picsum.photos/600/600",
  "photo.imageSize": "cover",
  "photo.borderRadius": 16,
  "photo.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "photo.image": "https://picsum.photos/600/600",
    "photo.imageSize": "cover",
    "photo.borderRadius": 16,
    "photo.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Frequently Asked Questions

### Can I change the image on every API call?

Yes — point '<key>.image' (or just the key) at any publicly reachable image URL in the modifications JSON and each render fetches that image.

### How is the image fitted inside its box?

imageSize maps to CSS object-fit (cover, contain, fill, none, scale-down) and imagePosition sets the focal point, so you control cropping precisely.

### Can I make circular avatars or rounded thumbnails?

Yes. borderRadius rounds the corners — set it to half the box size for a perfect circle — and border width, color, style and shadows are configurable too.

### Where can the images come from?

Any URL the renderer can fetch — your CDN, storage bucket or API. The URL lives on the component and is overridable per render like any other property.

## Variants

- [Contain](https://www.imejis.io/components/image/contain.md) — The full image letterboxed inside its box on a neutral background.
- [Circle avatar](https://www.imejis.io/components/image/circle-avatar.md) — Fully-rounded crop with a ring border — profile photos and avatars.
- [Polaroid](https://www.imejis.io/components/image/polaroid.md) — Padded frame with a soft shadow for a printed-photo feel.

All components: https://www.imejis.io/components.md
