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

Beauty

Update Time:2021-05-27 15:20

1 Introduction

ZegoEffects SDK provides beauty functions to present users with a good skin condition and create unique and natural beauty effects.

Developers can adjust the intensity of whitening, smoothing, sharpening, etc. according to their needs to achieve the beauty function.

2 Prerequisites

Before using the beauty function of ZegoEffects SDK, please make sure:

  • ZegoEffects SDK has been integrated into the project to realize basic image processing functions. For details, please refer to Quick Starts.
  • The width and height of the uploaded image to be processed.

3 Implementation Steps

Beauty includes functions such as whitening, smoothing, sharpening, and rosy.

After enabling the beauty function, the developer can customize the beauty parameters according to actual needs. If it is not customized, the SDK will use the default parameter values ​​to achieve the beauty function.

3.1 Whitening

Before using this function, please import the corresponding resource file, otherwise the function will not take effect. For details, please refer to Quick Starts - Import Resources and Models.

Call the enableWhiten interface to enable the whitening function, and pass in the absolute path of the corresponding LUT (color lookup table) directory, and call the setWhitenParam interface to set the whitening intensity.

ZegoEffectsWhitenParam The value range of the object's whitening intensity parameter "intensity" is [0, 100], and the default is "50". The greater the value, the greater the degree of whitening, and developers can customize the value according to their needs.

// Turn on the whitening function and pass 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 range is [0, 100], the default is 50
ZegoEffectsWhitenParam param = new ZegoEffectsWhitenParam();
param.intensity = 100;
mEffects.setWhitenParam(param);

3.2 Smoothing

Call the enableSmooth interface to enable the dermabrasion function, and call the setSmoothParam interface to set the dermabrasion intensity.

ZegoEffectsSmoothParam The value range of the object's microdermabrasion intensity parameter "intensity" is [0, 100], and the default is "50". The larger the value, the greater the degree of dermabrasion, and developers can customize the value according to their needs.

// Turn on the microdermabrasion function
mEffects.enableSmooth(true);

// Set the intensity of microdermabrasion, range [0, 100], default is 50
ZegoEffectsSmoothParam param = new ZegoEffectsSmoothParam();
param.intensity = 100;
mEffects.setSmoothParam(param);

3.3 Rosy

Before using this function, please import the corresponding resource file, otherwise the function will not take effect or the effect will be abnormal. For details, please refer to Quick Starts - Import Resources and Models.

Call the enableRosy interface rosy function, and call the setRosyParam interface to set the rosy intensity.

ZegoEffectsRosyParam The value range of the object's ruddy intensity parameter “intensity” is [0, 100], and the default is “50”. The larger the value, the greater the degree of redness, and developers can customize the value according to their needs.

// Turn on the rosy function
mEffects.enableRosy(true)

// Set rosy intensity, range [0, 100], default is 50
ZegoEffectsRosyParam param = new ZegoEffectsRosyParam();
param.intensity = 100;
mEffects.setRosyParam(param);

3.4 Sharpening

Call the enableSharpen interface to enable the sharpening function, and call the setSharpenParam interface to set the sharpening strength.

ZegoEffectsSharpenParam The object's sharpening intensity parameter "intensity" ranges from [0, 100], and the default is "50". The greater the value, the greater the sharpness, and developers can customize the value according to their needs.

// Turn on the sharpening function
mEffects.enableSharpen(true);

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