In the previous post we discussed how to use different mixing level for foreground and background, and the example worked really nicely. However, when the foreground and background has a huge contrast, mixing foreground and background can be challenging. Let's take a look at an example. This is a wedding photo taken at sunset.
We want to make it more artistic, and we chose this style:
With low mixing level, the result looks like this. It looks quite nice at first sight, but if you look more carefully, you will see that there are some noisy patterns in the people and in the dark ground. Those noisy patterns don't look nice.
We actually want to use the people and the dark ground in the original photo, so we created the following mask:
By simply overlaying the original photo and the stylized photo using the mask above, we get the following image:
Unfortunately because the contrast and color in the original image and the stylized image look too different, you can see that there is a clear "cut line" near the dark ground, which looks awkward. Fortunately, we can use the image pyramid technique to create a smooth transition between the original photo and the stylized image. We are using this script to make the image-pyramid based blending. The result looks like this. This actually looks quite nice and smooth!