-
Notifications
You must be signed in to change notification settings - Fork 1
MostContrastBW
George Plotnikov edited this page Mar 15, 2018
·
1 revision
Generates image with grayscale contrast deviation selection.
ImageBlendingAlgorithms/IBALib/BlendingAlgorithms/MostContrastBW.cs
public override Color Calculate(IEnumerable<Color> colors)
{
var a = colors.ElementAt(0);
var b = colors.ElementAt(1);
var aY = Math.Abs(128 - GetY(a));
var bY = Math.Abs(128 - GetY(b));
return aY > bY ? a : b;
}
static double GetY(Color c) => 0.299 * c.R + 0.587 * c.G + 0.114 * c.B;
the results of handling 3 source images


