shithub: ifilter

Download patch

ref: 0042570b78469f2f70fb8357df42db68b42117d1
parent: 67107b61b644fa2fe1376ff34dd928b70e1fdda8
author: phil9 <[email protected]>
date: Mon Sep 6 01:14:39 EDT 2021

fix factors applied to the wrong color components in grayscale filter

--- a/ifilter.c
+++ b/ifilter.c
@@ -16,7 +16,7 @@
 void
 grayscale(uchar p[3])
 {
-	uchar v = 0.2126*p[0] + 0.7152*p[1] + 0.0722*p[2];
+	uchar v = 0.2126*p[2] + 0.7152*p[1] + 0.0722*p[0];
 	p[0] = p[1] = p[2] = v;
 }