karansher / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
1 stars 0 forks source link

Desaturated lighter than expected #79

Open yi1z opened 1 year ago

yi1z commented 1 year ago

image My output for desaturated has a lighter colour than the one expected, any potential problem that could lead to this? Thank you so much!

MicheleMassa802 commented 1 year ago

Think of it this way, if they give you a desaturation factor of 0.25 (like the example in the assignment), what should you do with the S value (which is in a [0, 1] range)? Remember from the .h file for desaturate, the closer this factor is to 1, the closer the image should be to grayscale, and the closer to 0 the closer the image should be to the original, so what does this tell you about the way S is affected?

Y-blok commented 1 year ago

Think of it this way, if they give you a desaturation factor of 0.25 (like the example in the assignment), what should you do with the S value (which is in a [0, 1] range)? Remember from the .h file for desaturate, the closer this factor is to 1, the closer the image should be to grayscale, and the closer to 0 the closer the image should be to the original, so what does this tell you about the way S is affected?

I also have this issue of being lighter than expected (pretty much exactly the same as @yi1z) and I am unsure how to affect s correctly. I have tried all the basic operations (+, -, *, /) and none are close to correctly desaturating; they either desaturate too much or oversaturate it. I am unsure if my approach is correct here in that I don't know whether the issue is with changing the line of s = someFunction(factor) or if it is something else.

Edit: I believe I have just found the issue. My advice without giving things away would be to do something simple to something that is related to the factor.