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

The saturation formula in chroma key #146

Open
xiangcong opened this issue Feb 22, 2017 · 1 comment
Open

The saturation formula in chroma key #146

xiangcong opened this issue Feb 22, 2017 · 1 comment

Comments

@xiangcong
Copy link

xiangcong commented Feb 22, 2017

Thanks a lot for the project~! The chroma key algorithm works quite well!
However, I'm curious about the saturation formula in the chroma key function, which is
pixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);
the function is not the same as the saturation formula I found in the website(like http://www.rapidtables.com/convert/color/rgb-to-hsl.htm for example)
I wonder why the saturation is like this in this project.
Thanks a lot!

@xiangcong
Copy link
Author

secondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);
secondaryComponents is the sum of two channels with are not the max of rgb.
while formulas I found that convert rgb to saturation are only related to max and min of rgb.

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

1 participant