# Dynamic Images & Dithering

{% hint style="info" %}
In retail applications, it is often necessary to update images dynamically by changing advertisements. This requires using the "Dynamic Image" feature, which allows you to dynamically replace the images you want to update by uploading them to the **Gallery**. Additionally, due to the nature of ePaper displays, which present images using a limited color palette, there may be a limitation in the display of full-color advertisements. To address this, techniques such as "Dithering Treatment" and "Brightness Enhancement" are used to represent subtle colors through pixel processing, enhancing the visual quality of the images.
{% endhint %}

## Dynamic Images

**Step 1. Navigate to the Item Data Page**: Access the **Item Data** page in your DeviceOn/ePaper platform.

**Step 2. Create a Data Source**: Click on the option to create a new data source.

**Step 3. Create data**: Open a text editor, and create data like below.

{% file src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FbmCCGjQYsg9KoEDJSq1I%2FChipOrder.csv?alt=media&token=9f5e856f-3dac-455d-af22-f9d5e664cb86" %}

**Step 4. Upload Item Data**: Upload your item data file. Ensure this file contains a column named “**file**” with data entries that are strings of _file names_. These file names should match exactly with the names of images stored in the **Gallery**. This will link the item data with the corresponding images for display.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FSGbgVkWxho3imKsf0TFh%2Fimage.png?alt=media&#x26;token=ce9be916-38fb-4d95-9088-d26d787fedb8" alt=""><figcaption></figcaption></figure>

**Step 5. Navigate to the Gallery Page**: Access the **Gallery** page in your DeviceOn/ePaper platform.

**Step 6. Select the Data Source**: Choose the data source you created in the previous step.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FMAIKLuil0uj23kWv36DH%2Fimage.png?alt=media&#x26;token=53c43d92-ab2f-41bd-935c-f97e06d5dc9e" alt=""><figcaption></figcaption></figure>

**Step 7. Upload Images**: Upload the images to the FTP storage. Ensure that the file names of these images match the file names specified in the "file" column of your item data. This allows the images to be displayed or changed dynamically based on the item data.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2F9KC1hel2hExlo7VTTI5w%2Fimage.png?alt=media&#x26;token=f68c7a90-85f1-4c9f-8deb-b786ee91f764" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FfP4ux4bhpXZZIBfiXGoZ%2Fimage.png?alt=media&#x26;token=06bd753b-6132-4779-9385-dbcd619053c1" alt=""><figcaption></figcaption></figure>

Sometimes, an image might exceed the 2MB size limit. When this happens, the system will automatically prompt you, asking whether you want to compress and convert the image. If you select "OK," the system will resize and convert the image format. It is recommended to select "OK" because the system will perform lossless scaling based on the largest ePaper size, ensuring that the image remains distortion-free on the ePaper display.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2Fbr70RhdxJ91sKTNcPTJG%2Fimage.png?alt=media&#x26;token=6d539e33-2693-48a0-b362-e37ecb5a02be" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FQMzjgBgRZeQx96cxElwB%2Fimage.png?alt=media&#x26;token=3e50935d-0862-4e20-8c4b-8eaed8869a2e" alt=""><figcaption></figcaption></figure>

Upload Images successfully.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FOKmyjSUO5mbfGnPeepzn%2Fimage.png?alt=media&#x26;token=40de4031-281c-44e6-bcc1-98d702ca4d24" alt=""><figcaption></figcaption></figure>

**Step 8. Navigate to the Template Page**: Access the **Template** page in your DeviceOn/ePaper platform.

**Step 9. Select the Template**: Choose the template you created in the previous steps.

**Step 10. Add an Image Component**: Drag and drop an **image** component into the template layout.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FSmQFj1rUJaSNO4mhDOUM%2Fimage.png?alt=media&#x26;token=992101af-3477-46dd-9e5d-31d7d518e716" alt=""><figcaption></figcaption></figure>

**Step 11. Set Image Value**: Set the value of the image component to “file,” which corresponds to the "file" column in your item data containing the image file names.

**Step 12. Enable Dithering Mode**: Since it is a colorful image, enable the dithering mode if available. This will often result in better display quality on the ePaper device.

**Step 13. Save the Template**: Save the template with the changes.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FSnounMSDH0PcmjWz5QLW%2Fimage.png?alt=media&#x26;token=9d816e82-3e67-44fa-9c87-880486c7d976" alt=""><figcaption></figcaption></figure>

**Step 14. Navigate to the EPD Controller Page**: Access the **EPD controller** page in your DeviceOn/ePaper platform.

**Step 15. Change Binding Data**: Select the binding data that corresponds to your item group and template.

**Step 16 (Optional). Edit the File Name in Data**: Modify the file name entries in your item data to link to different images, if needed.

**Step 17. Preview Changes**: Use the preview function to see how the changes in the file names or data affect the display on the ePaper device.

By following these steps, your ePaper device will be able to dynamically display the images based on the item data, ensuring high-quality visuals even for colorful images.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2F89wwGJ04aRW5LudXqisA%2Fimage.png?alt=media&#x26;token=6d1612ea-80d4-4005-8dca-47b27a15adb2" alt=""><figcaption></figcaption></figure>

## Dithering

**Step 1. Navigate to the Template Page**: Access the **Template** page in your DeviceOn/ePaper platform.

**Step 2. Select an Image Component**: Drag and drop an **image** component into the template layout. Select it by left-clicking on the mouse. Enable both the **Brightness Enhancement** and **Dithering Treatment** options.

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2Fe3ZVKlu5kVMa6DDysEc8%2Fimage.png?alt=media&#x26;token=8a4a9302-279c-4db0-abb9-49d152ce228f" alt=""><figcaption></figcaption></figure>

* **Brightness Enhancement:** Adjust image colors according to E-ink recommendation.&#x20;
* **Dithering Treatment:** Apply the [Floyd–Steinberg dithering](https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering) method to process the image.

Step 3. **Save this template and preview.** You will see the output differences between dithering and no-dithering.

* Dithering + Brightness enhancement:

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FsDhu2keQHLkL6i5AHuX3%2Fimage.png?alt=media&#x26;token=e3ead36b-8c3d-4896-b1b9-2b21b89de84a" alt=""><figcaption></figcaption></figure>

* Dithering:

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FNFxeSwxmark5rn2E9c6x%2Fimage.png?alt=media&#x26;token=477540d9-0e92-4811-906e-48dd7116ccef" alt=""><figcaption></figcaption></figure>

* No Treatment:

<figure><img src="https://3356936024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvoLI0hSi2PAK59nEdFUh%2Fuploads%2FPZXzU5SftXOuSMLoPFbM%2Fimage.png?alt=media&#x26;token=8b39669a-deb0-46f3-9760-45d6b115ae62" alt=""><figcaption></figcaption></figure>
