- Documentation
- AI Effects
- Guides
- Face shape retouch
Face shape retouch
The ZegoEffects SDK provides various face shape retouch features, including face slimming, eyes enlarging, mouth shape adjustment, teeth whitening, and more.
Prerequisites
Before you begin to use the SDK's face shape retouch 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.
Implementation steps
In general, take the following steps to implement a face shape retouch feature:
- Enable the feature.
- Specify the parameters of the face shape retouch feature as needed. If not specified, the SDK uses the default settings.
Eyes enlarging
For this feature to work correctly, you need to import the related model files first. For details, see Import models.
Call the
enableBigEyes
method to enable the eyes enlarging feature.Call the
setBigEyesParam
method to set the extent of eyes enlarging.The value range of the
intensity
property ofZegoEffectsBigEyesParam
is [0, 100], and the default value is 50. As this value gets larger, the eyes get bigger.
// Enable the eyes enlarging feature.
[self.effects enableBigEyes:YES];
// Set the extent of eyes enlarging. The value range is [0, 100], and the default value is 50.
ZegoEffectsBigEyesParam *param = [[ZegoEffectsBigEyesParam alloc] init];
param.intensity = 100;
[self.effects setBigEyesParam:param];
Face sliming
For this feature to work correctly, you need to import the related model files first. For details, see Import models.
Call the
enableFaceLifting
method to enable the face slimming feature.Call the
setFaceLiftingParam
method to set the extent of face slimming.The value range of the
intensity
property ofZegoEffectsFaceLiftingParam
is [0, 100], and the default value is 50. As this value gets larger, the face gets slimmer.
// Enable the face slimming feature.
[self.effects enableFaceLifting:YES];
// Set the extent of face slimming. The value range is [0, 100], and the default value is 50.
ZegoEffectsFaceLiftingParam *param = [[ZegoEffectsFaceLiftingParam alloc] init];
param.intensity = 100;
[self.effects setFaceLiftingParam:param];
Mouth shape adjustment
Call the
enableSmallMouth
method to enable the mouth shape adjustment feature.Call the
setSmallMouthParam
method to set the extent of mouth shape adjustment.The value range of the
intensity
property ofZegoEffectsSmallMouthParam
is [-100, 100], and the default value is 50. As this value gets larger, the mouth gets smaller.
// Enable the mouth shape adjustment feature.
[self.effects enableSmallMouth:YES];
// Set the extent of mouth shape adjustment. The value range is [-100, 100], and the default value is 50.
ZegoEffectsSmallMouthParam *param = [[ZegoEffectsSmallMouthParam alloc] init];
param.intensity = 100;
[self.effects setSmallMouthParam:param];
Eyes brightening
Call the
enableEyesBrightening
method to enable the eyes brightening feature.Call the
setEyesBrighteningParam
method to set the extent of eyes brightening.The value range of the
intensity
property ofZegoEffectsEyesBrighteningParam
is [0, 100], and the default value is 50. As this value gets larger, the eyes get brighter.
// Enable the eyes brightening feature.
[self.effects enableEyesBrightening:YES];
// Set the extent of eyes brightening. The value range is [0, 100], and the default value is 50.
ZegoEffectsEyesBrighteningParam *param = [[ZegoEffectsEyesBrighteningParam alloc] init];
param.intensity = 100;
[self.effects setEyesBrighteningParam:param];
Nose sliming
Call the
enableNoseNarrowing
method to enable the nose slimming feature.Call the
setNoseNarrowingParam
method to set the extent of nose slimming.The value range of the
intensity
property ofZegoEffectsNoseNarrowingParam
is [0, 100], and the default value is 50. As this value gets larger, the nose gets slimmer.
// Enable the nose slimming feature.
[self.effects enableNoseNarrowing:YES];
// Set the extent of nose slimming, The value range is [0, 100], and the default value is 50.
ZegoEffectsNoseNarrowingParam *param = [[ZegoEffectsNoseNarrowingParam alloc] init];
param.intensity = 100;
[self.effects setNoseNarrowingParam:param];
Teeth whitening
For this feature to work correctly, you need to import the related resource files first. For details, see Import resources.
Call the
enableTeethWhitening
method to enable the teeth whitening feature.Call the
setTeethWhiteningParam
method to set the extent of teeth whitening.The value range of the
intensity
property ofZegoEffectsTeethWhiteningParam
is [0, 100], and the default value is 50. As this value gets larger, the teeth get whiter.
// Enable the teeth whitening feature.
[self.effects enableTeethWhitening:YES];
// Set extent of teeth whitening. The value range is [0, 100], and the default value is 50.
ZegoEffectsTeethWhiteningParam *param = [[ZegoEffectsTeethWhiteningParam alloc] init];
param.intensity = 100;
[self.effects setTeethWhiteningParam:param];
Chin slimming
Call the
enableLongChin
method to enable the chin slimming feature.Call the
setLongChinParam
method to set the extent of chin slimming.The value range of the
intensity
property ofZegoEffectsLongChinParam
is [0, 100], and the default value is 50. As this value gets larger, the chin gets slimmer.
// Enable the chin slimming feature.
[self.effects enableLongChin:YES];
// Set the extent of chin slimming. The value range is [0, 100], and the default value is 50.
ZegoEffectsLongChinParam *param = [[ZegoEffectsLongChinParam alloc] init];
param.intensity = 100;
[self.effects setLongChinParam:param];
Forehead shortening
Call the
enableForeheadShortening
method to enable the forehead shortening feature.Call the
setForeheadShorteningParam
method to set the intensity.The value range of the
intensity
property of theZegoEffectsForeheadShorteningParam
is [-100, 100], and the default value is 50. The value gets larger, the forehead gets shorter.
// Enable the forehead shortening feature.
[self.effects enableForeheadShortening:YES];
// Set the intensity, the value range is [-100, 100], and the default value is 50.
ZegoEffectsForeheadShorteningParam*param = [[ZegoEffectsForeheadShorteningParam alloc] init];
param.intensity = 100;
[self.effects setForeheadShorteningParam:param];
Mandible slimming
Call the
enableMandibleSlimming
method to enable the mandible slimming feature.Call the
setMandibleSlimmingParam
method to set the intensity.The value range of the
intensity
property of theZegoEffectsMandlbleSlimmingParam
is [0, 100], and the default value is 50. The value gets larger, the mandible gets slimmer.
// enable the mandible slimming feature.
[self.effects enableMandibleSlimming:YES];
// Set the intensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsMandibleSlimmingParam*param = [[ZegoEffectsMandibleSlimmingParam alloc] init];
param.intensity = 100;
[self.effects setMandibleSlimmingParam:param];
Cheekbone slimming
Call the
enableCheekboneSlimming
method to enable the cheekbone sliming feature.Call the
setCheekboneSlimmingParam
method to set the intensity.The value range of the
intensity
property of theZegoEffectsCheekboneSlimmingParam
is [0, 100], and the default value is 50. The value gets larger, the cheekbone gets slimmer.
// Enable the cheekbone sliming feature.
[self.effects enableCheekboneSlimming:YES];
// Set the intensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsCheekboneSlimmingParam*param = [[ZegoEffectsCheekboneSlimmingParam alloc] init];
param.intensity = 100;
[self.effects setCheekboneSlimmingParam:param];
Face shortening
Call the
enableFaceShortening
method to enable the face shortening feature.Call the
setFaceShorteningParam
method to set the intensity.The value range of the
intensity
property of theZegoEffectsFaceShorteningParam
is [0, 100], and the default value is 50. The value gets larger, the face gets shorter.
// Enable the face shortening feature.
[self.effects enableFaceShortening:YES];
// Set the intensity, the value range is [0, 100], and the default value is 50.
ZegoEffectsFaceShorteningParam* param = [[ZegoEffectsFaceShorteningParam alloc] init];
param.intensity = 100;
[self.effects setFaceShorteningParam:param];
Nose lengthening
Call the
enableNoseLengthening
method to enable the nose lengthening feature.Call the
setNoseLengtheningParam
method to set the intensity.The value range of the
intensity
property of theZegoEffectsNoseLengtheningParam
is [-100, 100], and the default value is 50. The value gets larger, the nose gets more lengthened.
// Enable the nose lengthening feature.
[self.effects enableNoseLengthening];
// Set the intensity, the value range is [-100, 100], and the default value is 50.
ZegoEffectsNoseLengtheningParam* param = [[ZegoEffectsNoseLengtheningParam alloc] init];
param.intensity = 100;
[self.effects setNoseLengtheningParam:param];