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 Integrate the SDK.
- Implement the basic image processing functionality. For details, see Implement basic image processing.
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 FaceDetectionModel
model files first. For details, see Import resources and models.
-
Call the enableBigEyes method to enable the eyes enlarging feature.
-
Call the setBigEyesParam method to set the intensity 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.
mEffects.enableBigEyes(true);
// Set the intensity of eyes enlarging. The value range is [0, 100], and the default value is 50
mEffects.setBigEyesParam({ intensity: 100 });
Face sliming
For this feature to work correctly, you need to import the FaceDetectionModel
model files first. For details, see Import resources and models.
-
Call the
enableFaceLifting
method to enable the face slimming feature. -
Call the
setFaceLiftingParam
method to set the intensity 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.
mEffects.enableFaceLifting(true);
// Set the intensity of face slimming. The value range is [0, 100], and the default value is 50
mEffects.setFaceLiftingParam({ intensity: 100 });
Mouth shape adjustment
-
Call the enableSmallMouth method to enable the mouth shape adjustment feature.
-
Call the setSmallMouthParam method to set the intensity 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.
mEffects.enableSmallMouth(true);
// Set the intensity of mouth shape adjustment. The value range is [-100, 100], and the default value is 50
mEffects.setSmallMouthParam({ intensity: 100 });
Eyes brightening
-
Call the enableEyesBrightening method to enable the eyes brightening feature.
-
Call the setEyesBrighteningParam method to set the intensity 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.
mEffects.enableEyesBrightening(true);
// Set the intensity of eyes brightening. The value range is [0, 100], and the default value is 50
mEffects.setEyesBrighteningParam({ intensity: 100 });
Nose sliming
-
Call the enableNoseNarrowing method to enable the nose slimming feature.
-
Call the setNoseNarrowingParam method to set the intensity 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.
mEffects.enableNoseNarrowing(true);
// Set the intensity of nose slimming. The value range is [0, 100], and the default value is 50
mEffects.setNoseNarrowingParam({ intensity: 100 });
Teeth whitening
For this feature to work correctly, you need to import the related resource files first. For details, see Import resources and models.
-
Call the enableTeethWhitening method to enable the teeth whitening feature.
-
Call the setTeethWhiteningParam method to set the intensity 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.
mEffects.enableTeethWhitening(true);
// Set the intensity of teeth whitening. The value range is [0, 100], and the default value is 50
mEffects.setTeethWhiteningParam({ intensity: 100 });
Chin lengthening
-
Call the enableLongChin method to enable the chin lengthening feature.
-
Call the setLongChinParam method to set the intensity of chin lengthening.
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 longer.
// Enable the chin lengthening feature.
mEffects.enableLongChin(true);
// Set the extent of chin lengthening. The value range is [0, 100], and the default value is 50
mEffects.setLongChinParam({ intensity: 100 });
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 ZegoEffectsForeheadShorteningParam is [-100, 100], and the default value is 50. The value gets larger, the forehead gets shorter.
// Enable the forehead shortening feature.
mEffect.enableForeheadShortening(true);
// Set the intensity, the value range is [-100, 100], and the default value is 50.
mEffects.setForeheadShorteningParam({ intensity: 100 });
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 ZegoEffectsMandibleSlimmingParam is [0, 100], and the default value is 50. The value gets larger, the mandible gets slimmer.
// Enable the mandible slimming feature.
mEffect.enableMandibleSlimming(true);
// Set the intensity, the value range is [0, 100], and the default value is 50.
mEffects.setMandibleSlimmingParam({ intensity: 100 });
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 ZegoEffectsCheekboneSlimmingParam is [0, 100], and the default value is 50. The value gets larger, the cheekbone gets slimmer.
// Enable the cheekbone sliming feature.
mEffect.enableCheekboneSlimming(true);
// Set the intensity, the value range is [0, 100], and the default value is 50.
mEffects.setCheekboneSlimmingParam({ intensity: 100 });
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 ZegoEffectsFaceShorteningParam is [0, 100], and the default value is 50. The value gets larger, the face gets shorter.
// Enable the face shortening feature.
mEffect.enableFaceShortening(true);
// Set the intensity, the value range is [0, 100], and the default value is 50.
mEffects.setFaceShorteningParam({ intensity: 100 });
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 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.
mEffect.enableNoseLengthening(true);
// Set the intensity, the value range is [-100, 100], and the default value is 50.
mEffects.setNoseLengtheningParam({ intensity: 100 });