Example from assignment. Seems to turn bear blue

Example of merging a real picture into a painting. At this low resolution, you may not notice the extreme texture difference between the target and patch. This example benefits from finding backgrounds that are an approximate match for structure, with a subject on grass with the observer positioned at person height.

This is my failure case. In this example the structure of the background of the target image and the patch we're transplaning are quite different. The background of the target includes a wall that is just blurred out, instead of ending. There is also a gray haze that seems to be added between King Kong's hand and head. Perhaps most interesting, an artifact appears below his raised arm, which was part of his background.

Bells and Whistles - Color to gray

In the section below, see one approach to the color shift preserving color2gray problem. In my approach, I chose an alternative colorspace, since HSV is actually nonlinear, and in my opinion, overrated I convert the image in to ycbcr, then try to preserve gradients in all of the dimensions.

I wasn't able to do better than this. So I took the approach of trying to mix the results of the naive grayscale with the value channel. This performs worse and does something strange to the '3' in the corner.