The Color Pop(aka Color splash) effect makes the subject(usually a person) stand out from the rest of the image. The subject remains in color, but the background is made black and white. This gives a pleasant look in most cases.
This app applies color pop effect on human subjects and supports images with many people.
Here's an article
that I wrote explaining the working of this project at a basic level.
Original left, Color pop right.
Original left, Color pop right.
It uses Tensorflow.js and the BodyPix model to create segmentation masks around people in images.
It can be accessed using the colorpop
cloud function once the project is deployed on Firebase.
Instructions to deploy this project on Firebase
The colorpop
is an HTTP cloud function which can be accessed by making a POST
request with the binary image data
as the body of the request, along with following optional query params
Param | Expected data | Description |
---|---|---|
model | mobilenet (default) or resnet |
The model to use for segmentation. Mobilenet is faster but less accurate. Resnet is slower but more accurate |
curl --location --request POST 'http://{CLOUD_FUNCTION_HOST_URL}/colorpop?model=mobilenet' \
--header 'Content-Type: image/jpeg' \
--data-binary 'test.jpg' \
--output 'output.jpeg'
Achieving this effect manually is quite simple. It involves creating a mask around the subject and dropping the color of the background (Example using Photoshop). While it is simple, doing this manually has the following issues:
- Tedious and time-consuming.
- Poor results for complex subjects.
- Not all applications(especially mobile apps) support masking.
Google announced the color pop effect for its Photos app in Google IO 2018 and although it does an incredible job of detecting the subject and applying the effect, it applies it automatically only to some images. Certain conditions have to be met before the color pop effect even shows up in the editing options of the Photos app.
This inspired me to build this tool which makes it as easy as Google Photos to apply the color pop effect on photos with people in it, without needing any manual work.