The ZegoEffects SDK provides various face shape retouch features, including face slimming, eyes enlarging, mouth shape adjustment, teeth whitening, and more.
Before you begin to use the SDK's face shape retouch features in your project, make sure you complete the following steps:
In general, take the following steps to implement a face shape retouch feature:
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 of ZegoEffectsBigEyesParam
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];
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 of ZegoEffectsFaceLiftingParam
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];
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 of ZegoEffectsSmallMouthParam
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];
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 of ZegoEffectsEyesBrighteningParam
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];
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 of ZegoEffectsNoseNarrowingParam
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];
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 of ZegoEffectsTeethWhiteningParam
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];
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 of ZegoEffectsLongChinParam
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];
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 the ZegoEffectsForeheadShorteningParam
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];
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 the ZegoEffectsMandlbleSlimmingParam
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];
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 the ZegoEffectsCheekboneSlimmingParam
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];
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 the ZegoEffectsFaceShorteningParam
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];
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 the ZegoEffectsNoseLengtheningParam
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];