Inherit color from one image to another

I’m currently experimenting with having one image inherit the colour from one image to another. I’ve done it before, but unfortunately I forgot how I did it. (In PSD there is a function called match colour, so I want to do something similar to that)

I’m taking this conceptual route with two images:

  1. Blur images slightly to reduce noise and garbage.
  2. Calculate mean of rgb.
  3. inherit mean to the other image
  4. calculate amount of “paint” above mean value and amount of “paint” below mean value.
  5. inherit amount of paint above and below new mean.

Am I forgetting something?