Skip to content

MostBright

George Plotnikov edited this page Mar 15, 2018 · 2 revisions

MostBright

Generates image with the selecting the most bright pixels

Path

ImageBlendingAlgorithms/IBALib/BlendingAlgorithms/MostBright.cs

Essential code

public override Color Calculate(IEnumerable<Color> colors )
{
    var a = colors.ElementAt(0);
    var b = colors.ElementAt(1);
    return (a.R + a.G + a.B) / 3f >= (b.R + b.G + b.B) / 3 ? a : b;
}

Examples

the results of handling 3 source images

d9b3a3fb-2fea-4f04-845b-2d781b1796a9


2a7b508b-8125-49eb-9b26-d866162ace40


a6bc1c17-5030-4e31-9721-af4fd9b4c692

Clone this wiki locally