Add an Image

🖼️ Add any image as an asset to your videos.

For more information about overlay ordering, please refer to this page.

Our API provides you with the ability to include any images you want in the video. The images you intend to utilize must be registered as assets with a unique assetId. To add images to a scene, follow these steps:

  1. Specify the type of asset item you want to add.
  2. Enter the assetId of the particular image you intend to utilize (We are using a "Powered by Yepic" logo for this example).
  3. Define the variables xPosition and yPosition to specify the position of the image asset in the scene.
  4. Define the asset item's height and width.

🚧

Caution:

Don't forget to replace the placeholder "YOUR_API_KEY" with your unique API key in the header. If you haven't obtained one yet, please contact us at [email protected], and we will provide one as soon as possible.

A request example to specify an image as an asset is as follows:

curl --request POST \
     --url https://api.yepic.ai/v1/videos \
     --header 'X-Api-Key: YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data @- <<EOF
{
     "slides": [
          {
               "overlays": [
                    {
                         "type": "ImageOverlay",
                         "assetId": "00f03601-8f2e-4c45-bec4-4d4c3c1fd778",
                         "xPosition": 1615,
                         "yPosition": 870,
                         "height": 305,
                         "width": 216
                    },
                    {
                         "type": "AvatarOverlay",
                         "assetId": "1a901a33-8783-418e-af6a-a66dae945673",
                         "script": "Well done! This is your first video using Yepic's API.",
                         "voiceId": "en-US-JennyMultilingualNeural",
                         "xPosition": 448,
                         "yPosition": 56,
                         "width": 1024,
                         "height": 1024
                    }
               ],
               "backgroundColor": "#fc0a41"
          }
     ],
     "videoTitle": "My first video"
}
EOF

For details of the image asset fields, refer to the table below:

FieldsData TypeRequiredDescription
typestringYesThe type of the asset overlay, for example, "AvatarOverlay", "ImageOverlay", "TextOverlay", etc.
assetIdstringYesThe unique identifier of the asset.
xPositionnumberNoThe x-coordinate of the asset's insertion position.
yPositionnumberNoThe y-coordinate of the asset's insertion position.
heightnumberNoThe height of the image. If height is specified, the scale value will be ignored.
widthnumberNoThe width of the image. If width is specified, the scale value will be ignored.
scalenumberNoThe scale factor is being applied over the asset's shape, i.e., height and width.
anglenumberNoThe rotation angle is to be applied over the asset.

The following video will be generated along with the image you just specified.

✅Congratulations! You have successfully added an image to your video using our API!

📌 Need help?

If you require assistance or encounter any issues, we recommend referring to our FAQ page first. If you are still unable to resolve your issue, please don't hesitate to contact us for further support.