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.

/* Feel free to add your custom code below */
// set teeth whitening strength
TeethWhitening.strength("1")

Preview

Drag

Face morphing#

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

/* Feel free to add your custom code below */
// set eyes enlarge strength
FaceMorph.eyes("0.6")
// set checks slim down strength
FaceMorph.face("0.5")
// set nose slim down strength
FaceMorph.nose("1")
// resets morph
FaceMorph.clear()

Preview

Drag

Photo filters (LUT)#

Applies color filters to the entire image.

/* Feel free to add your custom code below */
// set lut filter texture
LutFilter.set("lut_texture.png")
// set lut filter strength
LutFilter.strength("1")
// reset lut filter
LutFilter.clear()

Preview

Drag

Skin smoothing (Skin softening)#

Makes the skin look younger by smoothing wrinkles.

/* Feel free to add your custom code below */
// Sets skin softening strength from 0 to 1
SkinSoftening.strength("1")

Preview

Drag

Skin color#

Changes the face and neck skin color.

info

Requires Skin segmentation Neural Network.

/* Feel free to add your custom code below */
// Set skin color
Skin.color("0.8 0.6 0.1 0.4")
// Reset skin color
Skin.clear()

Preview

Drag

Background separation#

info

Requires Background separation Neural Network.

Background texture#

Sets background behind the user to a texture.

/* Feel free to add your custom code below */
// Sets the file as background texture
BackgroundTexture.set("bg_colors_tile.png")
// Sets background content mode. Available options are: "aspect_fill" (default), "aspect_fit", "scale_to_fill".
BackgroundTexture.setBGContentMode("aspect_fill")
/** Sets the initial background texture angle in degrees (used for photos with angle !=0 in metadata) */
BackgroundTexture.setInitialRotation(270)
// Rotates the background texture clockwise in degrees (only values divisible by 90)
BackgroundTexture.rotate(90)
// Scales the background texture
BackgroundTexture.scale(0.9)
// Removes the background texture, resets background rotation and scaling
BackgroundTexture.clear()

Preview

Drag

Background video/gif#

Sets background behind the user to a video/gif. Available formats are .mp4 and .gif.

/* Feel free to add your custom code below */
// Sets the file as background texture
BackgroundVideo.set("video.mp4")
// Sets background content mode. Available options are: "aspect_fill" (default), "aspect_fit", "scale_to_fill".
BackgroundVideo.setBGContentMode("aspect_fill")
/** Sets the initial background texture angle in degrees (used for photos with angle !=0 in metadata) */
BackgroundVideo.setInitialRotation(270)
// Rotates the background video/gif clockwise in degrees (only values divisible by 90)
BackgroundVideo.rotate(90)
// Scales the background texture
BackgroundVideo.scale(0.9)
// Removes the background texture, resets background rotation and scaling
BackgroundVideo.clear()

Preview

Drag

Bokeh effect#

Blurs background behind the user with Bokeh effect as in professional photography.

/* Feel free to add your custom code below */
// Enables background blur with bokeh effect
BackgroundBokeh.enable()
// Disables background blur with bokeh effect
BackgroundBokeh.disable()

Preview

Drag

Background blur#

Blurs background behind the user.

/* Feel free to add your custom code below */
// Enables background blur
BackgroundBlur.enable()
// Sets blur radius in [0.,1.] range
BackgroundBlur.radius(0.1)
// Disables background blur
BackgroundBlur.disable()

Preview

Drag

Background transparent#

Makes background behind the user fully or partly transparent.

/* Feel free to add your custom code below */
// Enables transparent background
BackgroundTransparent.opacity(0.)
// Disables transparent background
BackgroundTransparent.opacity(1.)

Preview

Drag

Hair coloring#

Colors hair with one color.

info

Requires Hair segmentation Neural Network.

/* Feel free to add your custom code below */
// set hair color
Hair.color("0.39 0.14 0.14 0.8")
// reset hair color
Hair.clear()

Preview

Drag

Hair strands painting#

Colors hair strands with 1 to 5 colors.

info

Requires Hair strands painting Add-On.

/* Feel free to add your custom code below */
// Sets hair strands color
HairStrand.color("0.7 1 1 0.8")
// Sets hair strands multiple colors (up to 5 colors)
HairStrand.color([
"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"])
// Resets hair strands colors
HairStrand.clear()

Preview

Drag

Hair gradient#

Colors hair with 1 to 4 colors.

/* Feel free to add your custom code below */
// Sets hair gradient color (up to 4 colors)
HairGradient.color(["1 0.4 0.4 0.7", "0.5 0.1 0.7 0.7"]) // half of hair is green and another one is blue
// Resets hair gradient color
HairGradient.clear()

Preview

Drag

Eyes beautification#

Eyes coloring#

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

info

Requires Eye segmentation Neural Network.

/* Feel free to add your custom code below */
// set eyes color
Eyes.color("0 0.2 0.8 0.64")
// reset eyes color
Eyes.clear()

Preview

Drag

Eye flare#

Makes eyes more expressive adding flare.

/* Feel free to add your custom code below */
// set eye flare strength
EyesFlare.strength("1")

Preview

Drag

Eyes whitening#

Makes the look more expressive by whitening eyes.

/* Feel free to add your custom code below */
// set eyes whitening strength
EyesWhitening.strength("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.

/* Feel free to add your custom code below */
// Enables eye bags removal
EyeBagsRemoval.enable()
// Disables eye bags removal
EyeBagsRemoval.disable()

Preview

Drag

Skin smoothing PRO (Coming Soon...)#

info

Requires Skin smoothing Neural Network.

Neck smoothing (Coming Soon...)#

info

Requires Neck smoothing Neural Network.

Acne removal (Coming Soon...)#

info

Requires Acne removal Add-On.

Last updated on