- Documentation
- AI Effects
- Guides
- Face beautification
Face beautification
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.
Prerequisites
Before you begin to use the SDK's face beautification features in your project, make sure you complete the following steps:
- Integrate the ZegoEffects SDK into your project. For details, see Integration.
- Implement the basic image processing functionality. For details, see Implementation.
- Initialize the
ZegoEffects
object with the width and height of the image to be processed.
Implementation steps
In general, take the following steps to use a face beautification feature:
- Enable the feature.
- Specify the parameters of the beautification feature as needed. If not specified, the SDK uses the default settings.
Skin tone enhancement
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 theintensity
.The value range of the
intensity
property ofZegoEffectsWhitenParam
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.
[self.effects enableWhiten:YES];
// Set the whitening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsWhitenParam *param = [[ZegoEffectsWhitenParam alloc] init];
param.intensity = 100;
[self.effects setWhitenParam:param];
Skin smoothing
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 ofZegoEffectsSmoothParam
is [0, 100], and the default value is 50. As this value gets larger, the skin looks smoother.
// Enable the skin smoothing feature
[self.effects enableSmooth:YES];
// Set the intensity of skin smoothing. The value range is [0, 100], and the default value is 50.
ZegoEffectsSmoothParam *param = [[ZegoEffectsSmoothParam alloc] init];
param.intensity = 100;
[self.effects setSmoothParam:param];
Cheek blusher
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 ofZegoEffectsRosyParam
is [0, 100], and the default value is 50. As this value gets larger, the cheek gets rosier.
// Enable the cheek blusher feature.
[self.effects enableRosy:YES];
// Set the blusher intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsRosyParam *param = [[ZegoEffectsRosyParam alloc] init];
param.intensity = 100;
[self.effects setRosyParam:param];
Image sharpening
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 ofZegoEffectsSharpenParam
is [0, 100], and the default value is 50. As this value gets larger, the image looks sharper.
// Enable the image sharpening feature.
[self.effects enableSharpen:YES];
// Set the sharpening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsSharpenParam *param = [[ZegoEffectsSharpenParam alloc] init];
param.intensity = 100;
[self.effects setSharpenParam:param];
Nasolabial folds removing
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 theZegoEffectsWrinklesRemovingParam
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.
[self.effects enableWrinklesRemoving:YES];
// Set the instensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsWrinklesRemovingParam *param = [[ZegoEffectsWrinklesRemovingParam alloc] init];
param.intensity = 100;
[self.effects setWrinklesRemovingParam:param];
Dark circles removing
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 theZegoEffectsDarkCirclesRemovingParam
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.
[self.effects enableDarkCirclesRemoving:YES];
// Set the instensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsDarkCirclesRemovingParam *param = [[ZegoEffectsDarkCirclesRemovingParam alloc] init];
param.intensity = 100;
[self.effects setDarkCirclesRemovingParam:param];