AI Effects Beta
  • Platform
  • Framework / Engine
  • iOS
  • Android
  • macOS
  • Windows
  • Linux
  • Web
  • WeChat Mini Program

Face beautification

Update Time:2021-08-18 11:00

1 Introduction

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.

2 Prerequisites

Before you begin to use the SDK's face beautification 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.
  3. Initialize the ZegoEffects object with the width and height of the image to be processed.

3 Implementation steps

In general, take the following steps to use a face beautification feature:

  1. Enable the feature.
  2. Specify the parameters of the beautification feature as needed. If not specified, the SDK uses the default settings.

3.1 Skin tone enhancement

Use this feature to make the skin tone whiter or tanner.

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

  1. Call the enableWhiten method to enable the skin tone enhancement feature, passing in the absolute path of the corresponding LUT (color lookup table) directory as the lookUpTablePath parameter.

  2. Call the setWhitenParam method to set the intensity.

    The value range of the intensity property of ZegoEffectsWhitenParam 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, passing in the absolute path of the corresponding LUT (color lookup table) directory.
mEffects.enableWhiten(true, "xxx/whitening_lookup_1.0.0.1.png")

// Set the whitening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsWhitenParam param = new ZegoEffectsWhitenParam();
param.intensity = 100;
mEffects.setWhitenParam(param);

3.2 Skin smoothing

  1. Call the enableSmooth method to enable the skin smoothing feature.

  2. Call the setSmoothParam method to set the smoothing intensity.

    The value range of the intensity property of ZegoEffectsSmoothParam is [0, 100], and the default value is 50. As this value gets larger, the skin looks smoother.

// Enable the skin smoothing feature
mEffects.enableSmooth(true);

// Set the indensity of skin smoothing. The value range is [0, 100], and the default value is 50. 
ZegoEffectsSmoothParam param = new ZegoEffectsSmoothParam();
param.intensity = 100;
mEffects.setSmoothParam(param);

3.3 Cheek blusher

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

  1. Call the enableRosymethod to enable the cheek blusher feature.

  2. Call the setRosyParam interface to set the rosy intensity.

    The value range of the intensity property of ZegoEffectsRosyParam is [0, 100], and the default value is 50. As this value gets larger, the cheek gets rosier.

// Enable the cheek blusher feature
mEffects.enableRosy(true)

// Set the blusher intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsRosyParam param = new ZegoEffectsRosyParam();
param.intensity = 100;
mEffects.setRosyParam(param);

3.4 Image sharpening

  1. Call the enableSharpen method to enable the image sharpening feature.

  2. Call the setSharpenParam method to set the sharpening strength.

    The value range of the intensity property of ZegoEffectsSharpenParam is [0, 100], and the default value is 50. As this value gets larger, the image looks sharper.

// Enable the image sharpening feature
mEffects.enableSharpen(true);

// Set the sharpening intensity. The value range is [0, 100], and the default value is 50.
ZegoEffectsSharpenParam param = new ZegoEffectsSharpenParam();
param.intensity = 100;
mEffects.setSharpenParam(param);