Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic choosing of best clip & preserve_paper args? #6

Open
AdamSpannbauer opened this issue Jun 20, 2018 · 2 comments
Open

automatic choosing of best clip & preserve_paper args? #6

AdamSpannbauer opened this issue Jun 20, 2018 · 2 comments

Comments

@AdamSpannbauer
Copy link
Contributor

AdamSpannbauer commented Jun 20, 2018

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.

image

EDIT: updated distance used to determine 'truest' transfer

@jrosebr1
Copy link
Owner

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.

@AdamSpannbauer
Copy link
Contributor Author

Makes total sense. I'll keep the function code alive in the fork where I was playing around with the idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants