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

Saturation module acting weird #1845

Open
jywarren opened this issue Mar 12, 2021 · 3 comments
Open

Saturation module acting weird #1845

jywarren opened this issue Mar 12, 2021 · 3 comments
Labels

Comments

@jywarren
Copy link
Member

I think this doesn't look right - can anyone confirm?
Screenshot_20210311-233332

@jywarren jywarren added the bug label Mar 12, 2021
@waridrox
Copy link
Member

I think this doesn't look right - can anyone confirm?

When we go past 1.0 that's when the functionality gets hindered
Screenshot 2021-03-12 at 2 21 09 PM

@waridrox
Copy link
Member

It's very uncertain as the filter works perfectly for saturation values <= 1.
I tried to get it to work by converting the image to HSV format from RGB and then explicitly changing the saturation value in the S parameter, before it can be converted to RGB again, but still I only could get it to work till value = 1.

function changePixel(r, g, b, a) {
var hsv = RGBtoHSV ([r,g,b]);
hsv[1] *= parseFloat(options.saturation);
var rgb = HSVtoRGB([hsv[0], hsv[1], hsv[2]]);
return [Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2]), a];
}

@jywarren
Copy link
Member Author

jywarren commented Mar 18, 2021 via email

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

No branches or pull requests

2 participants