DEV Community

Cover image for How To Create Avatar From Photo
DavidRelo for ZEGOCLOUD

Posted on • Updated on • Originally published at zegocloud.com

How To Create Avatar From Photo

What is an AVATAR?

Avatar is an electronic image representing a computer user in the digital world. Major games and social platforms have introduced the virtual character function, in which one can create an avatar from a photo.

The idea behind the users virtually represented on-screen is driven by the intention of creating an interactive experience. This way, people enjoy the content immersively and tend to be more conscious of the game's ethical questions. The same principle now applies to social media.

Avatar Market Outlook

Technological advancement improves mobile phone performance, network bandwidth, screen rendering, and other capabilities. Users have, therefore, higher expectations in their pursuit of immersive experiences. Virtual avatars and metaverse-related applications receive more attention.

According to Allied Market Research, the global metaverse market was worth $41.9 billion in 2020 and will reach $1,237 billion by 2030.
The compound annual growth rate from 2021 to 2030 is 40.4%.

How do we join the metaverse industry and seize the market in such a rapidly developing emerging market?

Make avatar from photo

Facebook, Reddit, Youtube, and other social media have launched the 3D Avatar function. Let users become avatar photo creators.

Let's explore how to quickly integrate the function of creating avatars from a photo in your application so that your customers can have their avatars to enjoy their interactive experience fully.

The ZEGOAvatar SDK launched by ZEGOCLOUD allows you to create your metaverse application quickly.

Create a virtual avatar in three steps

1) Get avatar data from photo

// Extract facial features based on the introduced image.
ZegoFaceFeature faceFeature = ZegoAvatarService.getInteractEngine().detectFaceFeature(bitmap);
Enter fullscreen mode Exit fullscreen mode

2) Set a virtual avatar data

// Create a ZegoCharacterHelper class to simply the implementation process for API call.
// The absolute path of basic resources.
mCharacterHelper = new ZegoCharacterHelper(getFilesDir().getAbsolutePath() + "/assets/base.bundle"); 

// Set the avatar creation coefficient.
mCharacterHelper.applyFaceFeature(faceFeature);
Enter fullscreen mode Exit fullscreen mode
3) Render the virtual avatar
// Get display view
mZegoAvatarView = findViewById(R.id.zego_avatar_view);

// Display the avatar on the screen and call the API on a UI thread.
mCharacterHelper.setCharacterView(mZegoAvatarView);
Enter fullscreen mode Exit fullscreen mode

Make the app experience more realistic

The metaverse doesn't apply only to virtual avatars. It extends to outfits, actions, images, expressions, etc. of real people. Together with the virtual scenes, it makes the metaverse world.

ZEGOAvatar SDK realizes the connection between virtual and real through AI, being able to smoothly replicate the natural expressions and emotions of characters.

1) Facial expression mirroring

Capture and mirror the user's facial expressions to their avatar in real-time. The avatar mimics the same expressions as the user in real-time.

2) Speech simulation

Capture the user's speech to drive the avatar's facial and mouth movements in real-time.

3) Gesture recognition

Recognize the hand gestures of the user and control the avatar to perform the movements and facial expressions.

4) Body pose recognition

Recognize the body poses of the user and control the avatar to perform the movements and facial expressions.

Join us now and create your Avatar from photos with ZEGOAvatar SDK!


Sign up with ZEGOCLOUD, and get 10,000 minutes free every month.

Did you know? 👏

Like and Follow is the biggest encouragement to me
Follow me to learn more technical knowledge
Thank you for reading :)

Learn more

This is one of the live technical articles. Welcome to other articles:

Top comments (0)