Beauty

The page describes the main parameters of the Beauty effect and how they affect the image.

Beauty effect examples:

Beauty example 1 Beauty example 2

Beauty parameters

Color correction

Can be changed with the two options

  • final_color_correction_str: final color correction strength from 0 to 1
  • final_color_correction_tex: texture index

Work example

Drag

Eyebrows

Can be changed with the two options

  • eyebrows_tex: texture index
  • eyebrows_alpha: strength of eyebrows alpha channel from 0 to 1

Work example

Drag

Eyes

Can be changed with the two options:

  • eye_flare_alpha: strength of eye flare alpha channel from 0 to 1
  • eyes_coloring_str: eyes coloring strength from 0 to 1

Work example

Drag

Lashes

Can be changed with the two options:

  • lashes_tex: texture index
  • lashes_alpha: strength of lashes alpha channel from 0 to 1

Work example

Drag

Morph

Can be changed with the three options:

  • morph_cheeks_str: strength of cheeks morph.
  • morph_eyes_str: strength of eyes morph.
  • morph_nose_str: strength of nose morph.

Morphing values are unbounded, however, the values higher than 1.0 make the face look unnatural.

Work example

Drag

Skin

Can be changed with the three options:

  • skin_soft_str: strength of skin softness from 0 to 1
  • softlight_alpha: strength of soflight alpha channel from 0 to 1
  • softlight_tex: texture index

Work example

Drag

Teeth

Can be changed with the option:

  • teeth_whitening_str: strength of teeth whitening from 0 to 1

Work example

Drag

Effect API

To set the beautification parameters, call onDataUpdate method. onDataUpdate method is overloaded with 2 types of arguments:

  • float [0;1]
  • JSON string

When onDataUpdate function receives float argument, all beautification parameters are set in this value. When onDataUpdate function receives JSON string, every beautification parameter brings the value set in its name property in JSON object. To avoid errors JSON string should have all beautification parameters set.

JSON string example:

{
morph_cheeks_str: 0.0,
morph_eyes_str: 0.0,
morph_nose_str: 0.0,
skin_soft_str: 0.0,
softlight_alpha: 0.0,
softlight_tex: 0,
eye_flare_alpha: 0.0,
eyes_coloring_str: 0.0,
teeth_whitening_str: 0.0,
lashes_tex: 0,
lashes_alpha: 0.0,
eyebrows_tex: 0,
eyebrows_alpha: 0.0,
final_color_correction_str: 0.0,
final_color_correction_tex: 0,
}

Usage example:

The following example shows how to submit the Beauty Effect example for Java/Android. For more information about the effect refer to beauty example.

BanubaSDKManager.getEffectPlayer().callJSMethod("onDataUpdate", "0.5"); //for set all parameters to 0.5
Map <String, float> parametrs = new Map <String, float>();
parametrs.put("morph_cheeks_str", 1.0);
parametr.put("morph_eyes_str", 0.1);
parametrs.put("morph_nose_str", 0.22);
parametrs.put("skin_soft_str", 0.75);
parametrs.put("softlight_alpha", 0.35);
parametrs.put("softlight_tex", 0);
parametrs.put("eye_flare_alpha", 0.0);
parametrs.put("eyes_coloring_str", 0.3);
parametrs.put("teeth_whitening_str", 0.0);
parametrs.put("lashes_tex", 0.0);
parametrs.put("lashes_alpha", 0.0);
parametrs.put("eyebrows_tex", 0.0);
parametrs.put("eyebrows_alpha", 0.2);
parametrs.put("final_color_correction_str", 0.4);
parametrs.put("final_color_correction_tex", 0.0);
JSONObject JSONparams = new JSONObject(paparametrs);
BanubaSDKManager.getEffectPlayer().callJSMethod("onDataUpdate", JSONparams.toString());

To add a texture to the parameter, call addEffectDataPropertyTexture function. This function receives string with 2 words written with a space:

  • first element - the property where the texture name is added;
  • second element - the texture name added to the property.

Usage example:

BanubaSDKManager.getEffectPlayer().callJSMethod("addEffectDataPropertyTexture", "eyebrows_tex brows.png");

To enable the Makeup API, call enableMakeupChanging function. You'll have the following methods available:

  • addMakeup(makeupData) - add makeup to the makeup map. Receives string with 2 words written with a space:

    • first word โ€” the name of the key in the makeup map.
    • second word - the makeup texture name stored in the effect directory.
  • applyMakeup(name) - change and apply the makeup texture. Receives string with the makeup texture name.

  • setMakeupMultiplyingColor(rgba) - sets the color which will be multiplied with the makeup color (changes the makeup color). Receives string with 4 float numbers between [0;1] written with a space:

    • first number โ€” the red channel value.
    • second number โ€” the green channel value.
    • third number โ€” the blue channel value.
    • fourth number โ€” the alpha channel value.

To disable the Makeup API, call disableMakeupChanging function.

Usage example:

BanubaSDKManager.getEffectPlayer().callJSMethod("enableMakeupChanging", "");
BanubaSDKManager.getEffectPlayer().callJSMethod("addMakeup", "shadows shadows.png");
BanubaSDKManager.getEffectPlayer().callJSMethod("applyMakeup", "shadows");
BanubaSDKManager.getEffectPlayer().callJSMethod("setMakeupMultiplyingColor", "1 0 0 1"); // sets red color

To enable the Lips Coloring API, call enableLipsColoring function. You'll have the following methods available::

  • setLipsColor - sets lipstick color. Receives string with 4 float numbers between [0;1] written with a space:
    • first element โ€” the red channel value.
    • second element โ€” the green channel value.
    • third element โ€” the blue channel value.
    • fourth element โ€” the alpha channel value.

To disable the Lips Coloring API, call disableLipsColoring function.

Usage example:

BanubaSDKManager.getEffectPlayer().callJSMethod("enableLipsColoring", "");
BanubaSDKManager.getEffectPlayer().callJSMethod("setLipsColor", "0 1 0 1"); // sets green color
Last updated on