color_transfer
color_transfer copied to clipboard
automatic choosing of best `clip` & `preserve_paper` args?
Any interest in including a utility function for choosing the 'truest to source' color transfer?
I've implemented an (unoptimized) auto_color_transfer
function that attempts to choose the best combination of clip
& preserve_paper
by comparing each potential result to the source image in the HSV color space using chi2 distance. ~The mean absolute error is calculated between the channel means of the source & candidate images.~ Since the 'truest' color transfer isn't always the most aesthetically pleasing the function also returns a comparison matrix image (see below).
In this case, the bottom left image is chosen as the truest transfer by the current method.
EDIT: updated distance used to determine 'truest' transfer
Thanks @AdamSpannbauer, this is a really cool tool and utility function but I'm hesitant to include it in the actual library. The library is meant to be compact and a "self explanatory" implementation of color transfer (along with the accompanying blog post, of course).
I'd really like to keep it on the compact side and let the user decide which method they would like to preserve via the clip
and preserve_paper
booleans.
I will keep this issue open though for any other users of the library would like to chime in.
Makes total sense. I'll keep the function code alive in the fork where I was playing around with the idea