Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

scanner: added special recognition for blue pixels

  • Loading branch information...
commit bce46edb4277f4844295f17dac6b0649f9e1e48d 1 parent d2126c3
Andrew Tridgell authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 image/scanner.c
14 image/scanner.c
View
@@ -410,9 +410,17 @@ static void quantise_image(const struct rgb *in,
}
for (i=0; i<size; i++) {
- out[i].b = btab[in[i].b];
- out[i].g = gtab[in[i].g];
- out[i].r = rtab[in[i].r];
+ if (in[i].b > in[i].r+5 &&
+ in[i].b > in[i].g+5) {
+ // special case for blue pixels
+ out[i].b = (1<<HISTOGRAM_BITS_PER_COLOR)-1;
+ out[i].g = 0;
+ out[i].r = 0;
+ } else {
+ out[i].b = btab[in[i].b];
+ out[i].g = gtab[in[i].g];
+ out[i].r = rtab[in[i].r];
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.