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:
- Specify the
type
of asset item you want to add.- Enter the
assetId
of the particular image you intend to utilize (We are using a "Powered by Yepic" logo for this example).- Define the variables
xPosition
andyPosition
to specify the position of the image asset in the scene.- Define the asset item's
height
andwidth
.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:
Fields Data Type Required Description type
string Yes The type of the asset overlay, for example, "AvatarOverlay", "ImageOverlay", "TextOverlay", etc. assetId
string Yes The unique identifier of the asset. xPosition
number No The x-coordinate of the asset's insertion position. yPosition
number No The y-coordinate of the asset's insertion position. height
number No The height of the image. If height is specified, the scale value will be ignored. width
number No The width of the image. If width is specified, the scale value will be ignored. scale
number No The scale factor is being applied over the asset's shape, i.e., height and width. angle
number No The 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?![]()
Updated about 2 months ago