AI Effects
  • iOS : Objective-C
  • Android
  • Overview
  • Release notes
  • SDK downloads
  • Demo app
  • Sample codes
  • Getting started
    • Integrate the SDK
    • Import resources and models
    • Online authentication
    • Implement basic image processing
  • Guides
    • Face beautification
    • Face shape retouch
    • Beauty makeups
    • Background segmentation
    • Face detection
    • Stickers
    • Filters
  • Tutorials
  • Error codes
  • Documentation
  • AI Effects
  • Guides
  • Face shape retouch

Face shape retouch

Last updated:2022-04-19 16:17

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:

  1. Integrate the ZegoEffects SDK into your project. For details, see Integration.
  2. 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:

  1. Enable the feature.
  2. 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.

  1. Call the enableBigEyes method to enable the eyes enlarging feature.

  2. 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];

Face sliming

For this feature to work correctly, you need to import the related model files first. For details, see Import models.

  1. Call the enableFaceLifting method to enable the face slimming feature.

  2. 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];

Mouth shape adjustment

  1. Call the enableSmallMouth method to enable the mouth shape adjustment feature.

  2. 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];

Eyes brightening

  1. Call the enableEyesBrightening method to enable the eyes brightening feature.

  2. 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];

Nose sliming

  1. Call the enableNoseNarrowing method to enable the nose slimming feature.

  2. 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];

Teeth whitening

For this feature to work correctly, you need to import the related resource files first. For details, see Import resources.

  1. Call the enableTeethWhitening method to enable the teeth whitening feature.

  2. 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];

Chin slimming

  1. Call the enableLongChin method to enable the chin slimming feature.

  2. 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];

Forehead shortening

  1. Call the enableForeheadShortening method to enable the forehead shortening feature.

  2. 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];

Mandible slimming

  1. Call the enableMandibleSlimming method to enable the mandible slimming feature.

  2. 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];

Cheekbone slimming

  1. Call the enableCheekboneSlimming method to enable the cheekbone sliming feature.

  2. 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];

Face shortening

  1. Call the enableFaceShortening method to enable the face shortening feature.

  2. 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];

Nose lengthening

  1. Call the enableNoseLengthening method to enable the nose lengthening feature.

  2. 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];
Page Directory