@Ayyoub ESSADEQ Thanks for getting back. To answer to your question:
Could you please clarify whether real-time synthesis supports customization for the background, allowing either a solid color or a transparent one?
The avatar real-time synthesis API currently supports setting a solid-color background, without transparent background support. However, there's an alternative way to implement background customization on the client side, following these guidelines:
- Set the background color to green (for ease of matting), which the avatar real-time synthesis API supports.
- Create a canvas element with the same size as the avatar video.
- Capture each frame of the avatar video and apply a pixel-by-pixel calculation to set the green pixel to transparent, and draw the recalculated frame to the canvas.
- Hide the original video.
With this approach, you can get an animated canvas that plays like a video, which has a transparent background. Here's the sample code to demonstrate such an approach. After you have a transparent-background avatar, you can set the background to any image or video by placing the image or video behind the canvas. More info ***here.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.*