In the following image, I set the red and green channels to 0 to make the image blue.
My blending function takes in a background and a foreground image. The foreground image has to be taken in blue screen. The blend function then creates a mask from the bluescreen image and blend the two image together.
I write a function that can scale an image down to a specified ratio. I do the scaling by down-sampling the image.