> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/global-functions/applyimage.md).

# applyImage

```lua
return function()
    wait(2);
    local app = getApp();
    local ob = app.createGameObject(); --create object to attach images to
    applyImage(ob, 'welcomeImage'); --add the image titled 'welcome' to the object
    ob.image.anchor('bottom left', true); --anchors the image to the bottom left... accounting for image dimensions = true
    waitForAnimation(ob.image); --pauses script until finished...
    wait(2);
    applyImage(ob, 'byeImage');
    waitForAnimation(ob.image);
    log('finished playing two animations!');
end
```

{% hint style="info" %}
You must first create an image for it to be used in applyImage()
{% endhint %}

To create an image for the script to use, go back into Bot Commands > under advanced select the Images option button, then click "Create New".

<div><figure><img src="/files/Itg4g2BYieacG8Dl5quA" alt=""><figcaption></figcaption></figure> <figure><img src="/files/xUysnljLdPErtHe2r6pY" alt=""><figcaption></figcaption></figure></div>

After creating the image, select a .png sprite-sheet to be uploaded. If your image is animated, set the width and height values to be a single frame of the sprite-sheet. (this also works with gifs but it is less optimized.)

<figure><img src="/files/lhFlxX7RY3umLHVprjtk" alt=""><figcaption></figcaption></figure>
