Browse Source

* do equalizing on grayscale image.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@417 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 20 years ago
parent
commit
87a7c38bde
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/filters.c

+ 3
- 1
src/filters.c View File

@@ -216,11 +216,13 @@ struct image *filter_equalize(struct image *img, int threshold)
threshold = -threshold;
}

threshold *= 3;

for(y = 0; y < img->height; y++)
for(x = 0; x < img->width; x++)
{
getpixel(img, x, y, &r, &g, &b);
if(r < threshold)
if(r + g + b < threshold)
setpixel(dst, x, y, min, min, min);
else
setpixel(dst, x, y, max, max, max);


Loading…
Cancel
Save