Apply image statistics from other image? Levels-node

The levels-node outputs standard-deviation or mean from an image. I think one way to make images appear similar is to use these values is like the math below.
gain=sd2/sd1
bias=mean2-mean1*gain

With the levels-node this should be possible, right? But how do you apply these values (to image 1)? I tried with a Brightness / Contrast node but does not really do much.
Thanks

Gain is multiply and bias (or offset/lift/pedestal/black level) is an add operation. Use Mix node with appropriate operation.

Then post the result here as it sounds really cool!

Heres my hack version. I’m dubious about the resulting curve, but I did get a similar curve.

Attachments


I agree, it does sound cool! Interesting results.
Heres the node-setup I’ve been toying with, trying to make the lower img similar to the upper. For simplicity only one channel for now. It does make the image lighter which should be correct, but the contrast is way too low - so not really working

Attachments


Does the node-setup make sense in theory? Did I get the add and multiply right?
Thanks