Edit in GitHubLog an issue

Using Images

Importing Images into the page

Add-ons are hosted in an iframe within the Adobe Express UI, and can load images as <img> elements like any other web application. But in order to add images into an Adobe Express document, you need to use the addImage() method of the addOnUISdk.app.document object.

It expects a Blob object as the first argument, and an optional MediaAttribute object with the image's title and author.

Example

Copied to your clipboard
// sandbox/code.js
import addOnUISdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
addOnUISdk.ready.then(async () => {
try {
const imageUrl = "https://placehold.co/600x400.png";
const image = await fetch(imageUrl);
const imageBlob = await image.blob();
await addOnUISdk.app.document.addImage(
imageBlob, // 👈 Blob object
{
title: "Placeholder image", // 👈 Optional MediaAttributes
author: "Adobe Developer",
}
);
} catch (e) {
console.error("Failed to add the image", e);
}
});

Please note that you can use fetch() also to get images that are local to the add-on; in this case, you can use paths relative to the add-on's root.

Copied to your clipboard
// sandbox/code.js
import addOnUISdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
addOnUISdk.ready.then(async () => {
try {
const imageUrl = "./600x400.png"; // 👈 Local image
const image = await fetch(imageUrl);
// ... same as before

Importing Animated images

Importing a GIF via addImage() won't work as expected, as the method converts the animation into a static image before adding it to the document. You should use the addAnimatedImage() method instead.

Example

Copied to your clipboard
// sandbox/code.js
import addOnUISdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
addOnUISdk.ready.then(async () => {
try {
const gifImageUrl = "https://path/to/a/file.gif"; // 👈 a GIF image
const gifImage = await fetch(gifImageUrl);
const gifImageBlob = await gifImage.blob();
await addOnUISdk.app.document.addAnimatedImage(
// 👈
gifImageBlob, // 👈 Blob object
{
/* ... */
} // 👈 Optional MediaAttributes
);
} catch (e) {
console.error("Failed to add the image", e);
}
});
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.