The ZegoEffects SDK provides various face beautification features that help users look like their best selves on live video, including skin tone enhancement, skin smoothing, cheek blusher, image sharpening, and more.
Before you begin to use the SDK's face beautification features in your project, make sure you complete the following steps:
ZegoEffects
object with the width and height of the image to be processed.In general, take the following steps to use a face beautification feature:
Use this feature to make the skin tone whiter or tanner.
To use the skin tone enhancement feature, import the related resource file FaceWhiteningResources
first; otherwise, this feature can't take effect. For details, see Import resources and models.
Call the enableWhiten
method to enable the skin tone enhancement feature.
Call the setWhitenParam
method to set the intensity
.
The value range of the intensity
property of ZegoEffectsWhitenParam
is [0, 100], and the default value is 50. As this value gets larger, the skin tone gets whiter.
// Enable the skin tone enhancement feature.
mEffects.enableWhiten(true);
// Set the whitening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsWhitenParam param = new ZegoEffectsWhitenParam();
param.intensity = 100;
mEffects.setWhitenParam(param);
Call the enableSmooth
method to enable the skin smoothing feature.
Call the setSmoothParam
method to set the smoothing intensity.
The value range of the intensity
property of ZegoEffectsSmoothParam
is [0, 100], and the default value is 50. As this value gets larger, the skin looks smoother.
// Enable the skin smoothing feature
mEffects.enableSmooth(true);
// Set the indensity of skin smoothing. The value range is [0, 100], and the default value is 50.
ZegoEffectsSmoothParam param = new ZegoEffectsSmoothParam();
param.intensity = 100;
mEffects.setSmoothParam(param);
For this feature to work correctly, you need to import the related resource files first. For details, see Import resources.
Call the enableRosy
method to enable the cheek blusher feature.
Call the setRosyParam
interface to set the rosy intensity.
The value range of the intensity
property of ZegoEffectsRosyParam
is [0, 100], and the default value is 50. As this value gets larger, the cheek gets rosier.
// Enable the cheek blusher feature
mEffects.enableRosy(true)
// Set the blusher intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsRosyParam param = new ZegoEffectsRosyParam();
param.intensity = 100;
mEffects.setRosyParam(param);
Call the enableSharpen
method to enable the image sharpening feature.
Call the setSharpenParam
method to set the sharpening strength.
The value range of the intensity
property of ZegoEffectsSharpenParam
is [0, 100], and the default value is 50. As this value gets larger, the image looks sharper.
// Enable the image sharpening feature
mEffects.enableSharpen(true);
// Set the sharpening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsSharpenParam param = new ZegoEffectsSharpenParam();
param.intensity = 100;
mEffects.setSharpenParam(param);
Call the enableWrinklesRemoving
method to enable the nasolabial folds removing feature.
Call the setWrinklesRemovingParam
to set the intensity.
The value range of the intensity
property of the ZegoEffectsWrinklesRemovingParam
is [0, 100], and the default value is 50. As this value gets larger, the more thoroughly the nasolabial folds are removed.
// Enable the nasolabial folds removing feature.
mEffects.enableWrinklesRemoving(true);
// Set the instensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsWrinklesRemovingParam param = new ZegoEffectsWrinklesRemovingParam ();
param.intensity = 100;
mEffects.setWrinklesRemovingParam(param);
Call the enableDarkCirclesRemoving
method to enable the dark circles removing feature.
Call the setDarkCirclesRemovingParam
method to set the intensity.
The value range of the intensity
property of the ZegoEffectsDarkCirclesRemovingParam
is [0, 100], and the default value is 50. As this value gets larger, the more thoroughly the dark circles are removed.
// Enable the dark circles removing feature.
mEffects.enableDarkCirclesRemoving(true);
// Set the instensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsDarkCirclesRemovingParam param = new ZegoEffectsDarkCirclesRemovingParam ();
param.intensity = 100;
mEffects.setDarkCirclesRemovingParam(param);
Call the enableAcneRemoving interface to enable the acne and spot removal feature, and use the setAcneRemovingParam interface to set the intensity of the acne and spot removal.
The value range of the "intensity" parameter in the ZegoEffectsAcneRemovingParam object is [0, 100], with a default value of "0". A larger value indicates a stronger acne and spot removal effect, and developers can customize the value according to their needs.
// Enable acne and spot removal
mEffects.enableAcneRemoving(true);
// Set the intensity of acne and spot removal, range [0, 100], default is 0
ZegoEffectsAcneRemovingParam param = new ZegoEffectsAcneRemovingParam();
param.intensity = 0;
mEffects.setAcneRemovingParam(param);
Before using the clarity enhancement feature, please import the corresponding "ClarityResources" resource file, otherwise the feature will not work. For details, please refer to Quick Starts - Import Resources and Models.
Call the enableClarity interface to enable the clarity enhancement feature, and use the setClarityParam interface to set the clarity level.
The value range of the "intensity" parameter in the ZegoEffectsClarityParam object is [0, 100], with a default value of "0". A larger value indicates a clearer image, and developers can customize the value according to their needs.
// Enable clarity enhancement
mEffects.enableClarity(true);
// Set the clarity level, range [0, 100], default is 0
ZegoEffectsClarityParam param = new ZegoEffectsClarityParam();
param.intensity = 0;
mEffects.setClarityParam(param);
Before using the skin color adjustment feature, please import and load the corresponding skin resources file, otherwise the feature will not work. For details, please refer to Quick Starts - Import Resources and Models.
Call the enableSkinColor interface to enable the skin color adjustment feature, use the setSkinColorResPath interface to load the supported skin resources, and then use the setSkinColorParam interface to set the intensity of the skin color effect.
The value range of the "intensity" parameter in the ZegoEffectsSkinColorParam object is [0, 100], with a default value of "0". A larger value indicates a more noticeable change in skin color, and developers can customize the value according to their needs.
// Enable skin color adjustment
mEffects.enableSkinColor(true);
// Load the supported/specified skin resources
String skinResPath = "SkinColorResources/***";
mEffects.setSkinColorResPath(skinResPath);
// Set the intensity of the skin color effect, range [0, 100], default is 0
ZegoEffectsSkinColorParam param = new ZegoEffectsSkinColorParam();
param.intensity = 0;
mEffects.setSkinColorParam(param);