1
0

average blend method

This commit is contained in:
2022-05-02 13:25:50 +02:00
parent 3d7fc1b2d3
commit 6d4148f4ef
3 changed files with 25 additions and 1 deletions

View File

@ -195,6 +195,10 @@ func filter(pixel color.Color) color.Color {
return pixel
}
func average(fc uint8, bc uint8, fa uint8) float64 {
return (float64(fc)/2 + float64(bc)/2)
}
func darken(fc uint8, bc uint8, fa uint8) float64 {
return math.Min(float64(fc), float64(bc))
}
@ -214,6 +218,8 @@ func blend(fc uint8, bc uint8, fa uint8, ba uint8) float64 {
switch ConfigRegister.Method {
case "darken":
newValue = darken(fc, bc, fa)
case "average":
newValue = average(fc, bc, fa)
case "ligten":
newValue = lighten(fc, bc, fa)
case "fuckyfun":