Search⌘ K
AI Features

Applying Blush

Explore how to apply virtual blush on facial images with Python. Understand core functions for detecting cheeks, creating blush masks, and blending effects using MediaPipe and OpenCV to create natural-looking makeup enhancements.

Introduction

Blush is a makeup product that is used to add a flush of color onto the apple of the cheeks and create a rosy, natural-looking glow. It can also take your makeup game to the next level.

A few swipes of blush are able to:

  • Enhance face shape
  • Soften cheekbones

Add a rosy tint to the cheeks

Objective

Adding virtual blush can give photos a glamorous look. This lesson describes the steps required for developing this kind of utility in the Python programing language.

Dependencies

The following Python libraries are must-have for our utility:

Library

Version

mediapipe

0.8.9

opencv-python

4.4.0.46

numpy

1.19.4

scipy

1.5.4

filetype

1.0.7

Let’s code the utility!

Let’s look at the main functions of this utility.

The apply_vignette function

This function creates a vignette filter to emphasize the blush area. The vignette filter is an image part with higher brightness and saturation. Let’s define this function.

  • Line 5 selects the image dimensions.

  • Lines 7–11 generate a vignette mask using Gaussian kernels. The OpenCV function ...