Closed JayronKhong closed 1 year ago
Can you identify what spec the change is following?
Hi.. for this file
I mean, what specification does the change follow to make the color accurate? Why the previous one is not enough?
Previous code is more tend to brightness setting.
I trying to convert image with contrast filter. But the result after converted is more tend to brightness instead of contrast.
How can I tell your code is right? What underlying knowledge you're using when writing the changing code?
maybe try on it, add contrast color option to the image.
factory ColorOption.scale(
double rScale,
double gScale,
double bScale,
double aScale,
) {
final a = List
factory ColorOption.brightness(double brightness) { return ColorOption.scale(brightness, brightness, brightness, 1); }
factory ColorOption.contrast(double contrast) {
final m = List
from what i saw here, brightness and contrast almost similar.
both value from [0], [6], [12]
brightness matrix: bright, 0, 0, 0, 0, 0, bright, 0, 0, 0, 0, 0, bright, 0, 0, 0, 0, 0, 1, 0,
contrast matrix: contrast, 0, 0, 0, 0, 0, contrast, 0, 0, 0, 0, 0, contrast, 0, 0, 0, 0, 0, 1, 0,
correct me if i'm wrong, thanks.
sample for above
Hi @AlexV525 sorry, do you tested any issue for the contrast so far?
Modifying the code is simple.
But Alex means, is there your source for algorithm of contrast color matrix? For example, standard documents, scientific magazines or periodicals, or source code called by the device platform (Android iOS Windows, etc.).
In other words, where is the source connection of your contrast algorithm, rather than whether we use the naked eye to observe whether it is more effective than the current one.
well the solution provided here is wrong, because contrast = 1
should give us identity matrix, keeping the original image intact, but the solution does not.
@AlexV525 @CaiJingLong
However the current contrast algorithm is not really changing the contrast. If you compare it to the ColorOption.brightness
which uses ColorOption.scale
, the resulting matrixes used in both factories are completely identical!
Based on this guide:
https://docs.rainmeter.net/tips/colormatrix-guide/
the correct solution is this:
factory ColorOption.contrast(double contrast) {
final m = List<double>.from(defaultColorMatrix);
final double translate = 255.0 * (1 - contrast) / 2
m[4] = translate;
m[9] = translate;
m[14] = translate;
m[0] = contrast;
m[6] = contrast;
m[12] = contrast;
return ColorOption(matrix: m);
}
Closed by #107.
Hi guys, I found the issue with iOS version. The result only black or white except this value 1.0. Could you check it ?
instead of this:
should change to this: