Skip to main content

Face Beauty API

Banuba provides the Beauty API designed to help you integrate face modification and touch-up functionality into your app. The beautification features fit into a variety of use cases, i.e. live streaming, video chats and video conferencing apps to selfie editors and portrait retouching software. It aims to make the user feel comfortable about the camera experience.

Download example

tip

Read more about how to use and combine Makeup API and Face Beauty API features.

The Beauty module allows to enhance the face via the following built-in features:

Teeth Whitening

Allows for a beautiful smile.

  • Teeth.whitening(n) - changes whitening texture intensity, where n - any value from 0 to 1 (including decimal).
/* Feel free to add your custom code below */

// set teeth whitening strength
Teeth.whitening(1)

Preview

Drag

Face morphing

Slims down the cheeks and nose to make it more delicate.

  • FaceMorph.eyes(n) - set eyes enlarge strength
  • FaceMorph.face(n) - set checks slim down strength
  • FaceMorph.nose(n) - set nose slim down strength
  • FaceMorph.lips(n) - set lips enlarge strength
  • FaceMorph.clear()- resets morph
/* Feel free to add your custom code below */

FaceMorph.eyes(0.6)
FaceMorph.face(0.5)
FaceMorph.nose(1)
FaceMorph.lips(1)
// FaceMorph.clear()

Preview

Drag

Photo filters (LUT)

Applies color filters to the entire image.

  • Filter.set("lut_texture.png") - set lut filter texture,
  • Filter.strength(n) - set lut filter strength, where n - any value from 0 to 1 (including decimal), but also larger values may be passed, like 2, 3, etc;
  • Filter.clear()- clears filter.
/* Feel free to add your custom code below */

Filter.set("lut_texture.png")
Filter.strength(1)
Filter.clear()

Preview

Drag

Skin

Skin smoothing (Skin softening)

Makes the skin look younger by smoothing wrinkles.

  • Skin.softening(n) - set softening intensity, where n - any value from 0 to 1 (including decimal).
/* Feel free to add your custom code below */

Skin.softening(1)

Preview

Drag

Skin color

Changes the face and neck skin color.

  • Skin.color("R G B A") - set skin color in R G B A format (separated with space). Each value should be in a rage from 0 to 1 (including decimal),
  • Skin.clear() - clears skin color and softening.
info

Requires Skin segmentation Neural Network.

/* Feel free to add your custom code below */

Skin.color("0.8 0.6 0.1 0.4")
Skin.clear()

Preview

Drag

Background separation

info

Requires Background separation Neural Network.

Background texture

Sets the file as background texture.

  • Background.texture("bg_image.png") - sets an image-file as a background texture.
    • Supported formats: .jpeg, .jpg, .png, .ktx, .gif.
  • Background.texture("bg_video.mp4") - sets the video file as a background texture. Visit technical specification for supported video-formats.
/* Feel free to add your custom code below */

Background.texture("bg_colors_tile.png")

Preview

Drag

Background transparency

Sets the background transparency.

  • Background.transparency(n) - set transperany value from 0 to 1 (including decimal).
/* Feel free to add your custom code below */

Background.transparency(0.5)

Preview

Drag

Background rotation

Rotates the background texture clockwise in degrees.

  • Background.rotation(deg) - set rotation value from 0 360 degrees. Value should be divisible by 90 degrees.
/* Feel free to add your custom code below */

Background.rotation(90)

Background scale

Scales the background texture.

  • Background.scale(n) - multiplies the background texture size on given value.
/* Feel free to add your custom code below */

Background.scale(2)

Background contentMode

Sets the background texture content mode.

  • Background.contentMode("mode") - set mode type, possible values: fill, fit, scale_to_fill.
/* Feel free to add your custom code below */

Background.contentMode("fill")

Background blur

Blurs background behind the user.

  • Background.blur(n) - sets the background blur radius in [0, 1] range.
/* Feel free to add your custom code below */

Background.blur(0.2)

Preview

Drag

Background clear

Removes the background color and texture, resets any settings applied.

/* Feel free to add your custom code below */

Background.clear()

Hair coloring

info

Requires Hair segmentation Neural Network.

Single color

Colors hair with one color.

  • Hair.color("R G B A") - set hair color in R G B A format (separated with space). Each value should be in a rage from 0 to 1 (including decimal),
  • Hair.clear() - clears hair color (including gradient and hair strands).
/* Feel free to add your custom code below */

Hair.color("0.39 0.14 0.14 0.8")
Hair.clear()

Preview

Drag

Hair gradient

Colors hair with 1 to 5 colors.

  • Hair.color("start_color_rgba", "end_color_rgba") - set hair gradient in R G B A format (separated with space). Each rgba value should be in a rage from 0 to 1 (including decimal),
/* Feel free to add your custom code below */

Hair.color("0.19 0.06 0.25", "0.09 0.25 0.38")

Preview

Drag

Hair strands painting

Colors hair strands with 1 to 5 colors.

  • Hair.strands("R G B A", "R G B A", "R G B A", ...) - set hair strands in R G B A format (separated with space) with 5 color maximum.
info

Requires Hair strands painting Add-On.

/* Feel free to add your custom code below */

Hair.strands("0.80 0.40 0.40 1.0", "0.83 0.40 0.40 1.0", "0.85 0.75 0.75 1.0", "0.87 0.60 0.60 1.0", "0.99 0.65 0.65 1.0")

Preview

Drag

Eyes beautification

info

Requires Eye segmentation Neural Network.

Eyes coloring

Changes the color of the iris as in virtual lens try on.

  • Eyes.color("R G B A") - set eyes color in R G B A format (separated with space). Each value should be in a rage from 0 to 1 (including decimal),
  • Eyes.clear() - clears eyes color including flare and whitening.
/* Feel free to add your custom code below */

Eyes.color("0 0.2 0.8 0.64")
Eyes.clear()

Preview

Drag

Eye flare

Makes eyes more expressive adding flare.

  • Eyes.flare(n) - sets the eyes flare strength from 0 to 1.
/* Feel free to add your custom code below */

Eyes.flare("1")

Preview

Drag

Eyes whitening

Makes the look more expressive by whitening eyes.

  • Eyes.whitening(n) - sets the eyes sclera whitening strength from 0 to 1.
/* Feel free to add your custom code below */

Eyes.whitening(1)

Preview

Drag

Eye bags removal

Removes eye bags. Works in offline mode only (for photo or video processing).

info

Requires Eye bags removal Add-On.

  • EyeBagsRemoval.enable() - enables eye bags removal,
  • EyeBagsRemoval.disable() - disables eye bags removal.
/* Feel free to add your custom code below */

EyeBagsRemoval.enable()
EyeBagsRemoval.disable()

Preview

Drag