> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic Images

> Learn how to generate and automate personalized images per contact with dynamic text, avatar, and QR code layers in ChatbotX.

**Dynamic Images** allows you to design custom graphic templates that automatically merge personalized contact information (social media profile picture, name, phone number, loyalty points, or unique QR code) into a final image before sending it via chatbot conversations.

This feature is ideal for issuing VIP membership cards, event tickets, personalized discount vouchers, birthday greetings, or order delivery confirmations across Messenger, Instagram, and WhatsApp.

<CardGroup cols={3}>
  <Card title="Contact Avatar Overlay" icon="user">
    Automatically insert the recipient's Facebook, Instagram, or WhatsApp profile photo into your canvas.
  </Card>

  <Card title="Dynamic Text Variables" icon="font">
    Populate names, order numbers, balance points, or any custom contact fields dynamically.
  </Card>

  <Card title="Personalized QR Codes" icon="qrcode">
    Generate unique QR codes containing custom URLs or contact IDs with your brand logo in the center.
  </Card>
</CardGroup>

## Create a new Dynamic Image

<Steps>
  <Step title="Open Dynamic Images">
    From the left sidebar in ChatbotX, go to **Tools** and select the **Dynamic Images** card.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_images_tool_location.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=c8a9e15ea715befcf29ae60cca68aa3e" alt="Dynamic Images Tool Location" width="2971" height="1562" data-path="images/dynamic_images_tool_location.png" />
    </Frame>

    On the Dynamic Images manager page, click the **+ Create Dynamic Image** button in the upper-right corner.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_images_list_view.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=ad344d233feaf5f2b87a6f2477894966" alt="Dynamic Images List View" width="2512" height="769" data-path="images/dynamic_images_list_view.png" />
    </Frame>
  </Step>

  <Step title="Configure basic settings">
    In the editor view, configure the initial template settings:

    * **Name**: Enter a descriptive name for your template (for example, `VipCard` or `EventTicket`).
    * **Custom Field (optional)**: Select a Custom Field if you want ChatbotX to automatically save the generated image URL into the contact's profile.
    * **Width & Height**: Set the canvas width and height in pixels (for example, `500` x `320`).

    <Frame>
      <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_editor_overview.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=b96b19fe0a15cdc9eb21d72e597cc109" alt="Dynamic Image Editor Overview" width="2422" height="1572" data-path="images/dynamic_image_editor_overview.png" />
    </Frame>
  </Step>

  <Step title="Choose a pre-made template (Optional)">
    If you want to quickly start from a pre-designed layout, click the blue **Template** link below the Name field.

    The **Choose a template** modal displays pre-built graphic cards (such as gold VIP cards, event passes, or gift certificate frames). Selecting a template applies its background and styling to your canvas.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_choose_template.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=d2a865307c087cb19252cc5675015c29" alt="Dynamic Image Choose Template" width="1931" height="1700" data-path="images/dynamic_image_choose_template.png" />
    </Frame>

    <Note>
      Selecting a template replaces all current layers on your canvas.
    </Note>
  </Step>

  <Step title="Add and customize layers">
    Click the **+ Add element** button to add layers to your canvas:

    * **Add image**: Add static background graphics, contact avatars, or images from Custom Fields.
    * **Add text**: Add dynamic text layers with personalized contact attributes.
    * **Add QR code**: Add a dynamic QR code layer.

    You can drag and position elements directly on the canvas or reorder them in the **Layers** list on the left.
  </Step>

  <Step title="Save and copy the Public URL">
    Once your design is ready, click **Save** in the bottom-right corner. The system provides a **Public URL** for automating image delivery in your chat flows.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_public_url_copy.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=9602461620d925d646904b14a2fbf28e" alt="Dynamic Image Public URL Copy" width="2421" height="1613" data-path="images/dynamic_image_public_url_copy.png" />
    </Frame>
  </Step>
</Steps>

## Configure layer elements

### Image Element

When selecting an Image layer in the Layers panel, you can choose from three data sources under **Image type**:

#### Image URL (Static image from URL or upload)

Use this option for static card backgrounds, badge graphics, decorative frames, or company logos. You can paste a direct image link into the **Image URL** field or click **Upload image** to upload a file from your computer.

Configurable options include dimensions (**Width**, **Height**), frame shape (**Square** or **Circle**), and a **Priority** toggle to bring this layer to the front.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_layer_image_url.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=2145203bad1ac9e60e1609fdd67ac85e" alt="Dynamic Image Layer Image URL" width="2506" height="1784" data-path="images/dynamic_image_layer_image_url.png" />
</Frame>

#### Contact avatar (Recipient profile picture)

Automatically fetches the recipient's live profile avatar from the connected messaging channel (Facebook Messenger, Instagram, or WhatsApp).

You can specify custom dimensions (for example, `80` x `80` px) and set the **Image style** to **Circle** for a clean circular avatar.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_layer_contact_avatar.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=72f266900a8ca24937e731bd062a26e0" alt="Dynamic Image Layer Contact Avatar" width="2493" height="1766" data-path="images/dynamic_image_layer_contact_avatar.png" />
</Frame>

#### Custom field (Dynamic image from contact attribute)

Reads a dynamic image URL stored in a contact's custom attribute (for example, a previously uploaded portrait photo, digital signature, or certificate).

Select the target Custom Field from the **Custom field (optional)** dropdown.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_layer_custom_field_image.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=f72d942bee3f78531645e894d375a2ca" alt="Dynamic Image Layer Custom Field Image" width="2493" height="1768" data-path="images/dynamic_image_layer_custom_field_image.png" />
</Frame>

### Text Element

Text layers display static text combined with dynamic contact placeholders:

* **Text content**: Enter your text string. Click the `</>` code button to insert Custom Field variables (such as `{{first_name}}`, `{{phone}}`, `{{qrcode}}`) or the smiley icon to insert emojis.
* **Font size**: Font size in pixels.
* **Font family**: Select font family (Arial, Roboto, etc.).
* **Alignment**: Text alignment options (**Left**, **Center**, **Right**).
* **Color**: Select a color or enter a hex color code (e.g., `#000000`).
* **Text formatting**: Toggle switches for **Bold**, **Italic**, or **Uppercase**.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_layer_text_config.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=b191d873db296e5fc231022d196d9432" alt="Dynamic Image Layer Text Config" width="2489" height="1768" data-path="images/dynamic_image_layer_text_config.png" />
</Frame>

### QR Code Element

QR code layers generate scannable codes on the fly:

* **QR code content**: Enter the data to encode. This can be a static website link, voucher code, or dynamic variables like `{{user_id}}`.
* **Size**: Dimensions of the QR code in pixels.
* **Color**: Foreground color of the QR code dots.
* **Logo**: Click **Upload logo** to place your brand logo at the center of the QR code.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_layer_qr_config.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=fd5233c78272cf8542fb0a31072b3663" alt="Dynamic Image Layer QR Config" width="2484" height="1765" data-path="images/dynamic_image_layer_qr_config.png" />
</Frame>

## Use Dynamic Images in Chatbot Workflows

After saving your template, ChatbotX generates a **Public URL** with the following format:

```text theme={null}
https://app.chatconnectx.com/dynamic-images?dynamicImageId=[IMAGE_ID]&userId={{user_id}}
```

The `userId={{user_id}}` parameter ensures that whenever the message is delivered, ChatbotX dynamically resolves the recipient's user ID and renders their personalized graphic in real time.

### Send via Flow Builder message blocks

You can deliver personalized graphics in your automated flows using two methods: pasting the direct **Public URL** or referencing a **Custom Field** attribute.

This capability is supported across all image-enabled message blocks:

* **Image**: Delivers the personalized graphic as a standalone image message.
* **Card**: Displays the graphic as a card banner along with a title, subtitle, and interactive buttons.
* **Carousel**: Embeds personalized graphics across multiple carousel slides.

#### Method 1: Paste the Public URL directly

Copy the **Public URL** from your Dynamic Image template configuration (which includes `userId={{user_id}}`) and paste it directly into the image URL field of an Image, Card, or Carousel block. When the message is sent, ChatbotX automatically detects the contact's `user_id` and renders the personalized image in real time.

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_flow_blocks_options.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=6f521b00176d7e4b0e7e80d8529f916b" alt="Dynamic Image Flow Blocks Options" width="3098" height="1812" data-path="images/dynamic_image_flow_blocks_options.png" />
</Frame>

#### Method 2: Use a Custom Field attribute

If you selected a Custom Field under **Custom Field (optional)** when creating your template (or stored the image URL in a contact attribute):

1. In the Image or Card block within Flow Builder, click the image URL input field.
2. Enter the attribute tag directly using `{{attribute_name}}` syntax (such as `{{vipcard}}`) or click the `</>` code icon on the right side of the input field to select your Custom Field.
3. When the flow executes, the system dynamically retrieves the image URL stored in that contact attribute and renders the corresponding image.

<Frame>
  <img src="https://mintcdn.com/chatbotx/uh92DsZz87dwEx7r/images/dynamic_image_flow_custom_field.png?fit=max&auto=format&n=uh92DsZz87dwEx7r&q=85&s=877a19e31c25b152eecb14d44de19fb5" alt="Dynamic Image Flow Custom Field" width="3102" height="1820" data-path="images/dynamic_image_flow_custom_field.png" />
</Frame>

### Send via WhatsApp Template Messages

For outbound notifications outside the 24-hour window on WhatsApp, you can include Dynamic Images in pre-approved **Template Messages**:

<Steps>
  <Step title="Select a template with Media Header">
    Select or create a WhatsApp Template with a Media Header set to **Image**.
  </Step>

  <Step title="Paste the Public URL">
    In the Header media URL field, paste the **Public URL** of your Dynamic Image.
  </Step>

  <Step title="Configure dynamic parameters">
    Fill in the required body parameters (`{{1}}`, `{{2}}`...).
  </Step>

  <Step title="Preview template delivery">
    Preview the personalized image rendering directly inside the WhatsApp template preview card.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/chatbotx/QKEObxTKejMFe8-A/images/dynamic_image_whatsapp_template_usage.png?fit=max&auto=format&n=QKEObxTKejMFe8-A&q=85&s=56d0e70c469495f42b5b400142cfdfc8" alt="Dynamic Image WhatsApp Template Usage" width="3100" height="1816" data-path="images/dynamic_image_whatsapp_template_usage.png" />
</Frame>

To learn more about creating and submitting templates for Meta approval, see the [WhatsApp Template Messages](/docs/channels/whatsapp/whatsapp-template-messages) guide.

## Practical Example: Automated VIP Card Distribution

Here is a common scenario for delivering personalized VIP cards:

<Steps>
  <Step title="Design the VIP Card template">
    Upload a gold card background (500 x 320 px). Add a **Contact avatar** image layer with **Circle** style on the left. Add a **Text** layer containing `{{first_name}}` formatted in bold uppercase. Add a **QR code** layer pointing to `https://example.com/vip?id={{user_id}}` with your company logo centered. Click **Save** and copy the **Public URL**.
  </Step>

  <Step title="Attach Public URL to your Flow">
    Create a greeting or loyalty reward Flow. Add a **Send Image** or **Send Card** block and paste the Public URL into the Image URL field. Add call-to-action buttons below the card.
  </Step>

  <Step title="Verify delivery in live chat">
    When a contact triggers the flow, ChatbotX instantly generates their personalized card featuring their own avatar, name, and QR code, delivering it straight to their inbox.
  </Step>
</Steps>

## Best Practices

<Note>
  * **Preserve the `{{user_id}}` parameter:** Always ensure `userId={{user_id}}` remains in the Public URL when pasting into Flows or WhatsApp Templates so the system can resolve contact attributes correctly.
  * **Optimize background file sizes:** For static background images, use compressed PNG or JPG files under 1MB to ensure fast loading times.
  * **Account for variable text lengths:** If dynamic text fields (like names) vary significantly in length, choose an appropriate font size and alignment to prevent text clipping.
</Note>
