Change the way diff images highlight differences.

Previously it was using the equation 128+diff/3, which results in
lots of gray and de-emphasized difference.  Now it's using
MIN(255,diff*4) which more emphasizes the real difference.
This commit is contained in:
Behdad Esfahbod 2006-08-01 15:20:39 -04:00
parent d85f30e789
commit 5a23fd70a0

View file

@ -92,9 +92,12 @@ buffer_diff_core (unsigned char *_buf_a,
for (channel = 0; channel < 4; channel++) {
unsigned char value_a = (row_a[x] >> (channel*8));
unsigned char value_b = (row_b[x] >> (channel*8));
double diff;
unsigned char diff;
diff = value_a - value_b;
diff_pixel |= (unsigned char)(128 + diff / 3.0) << (channel*8);
diff *= 4; /* emphasize */
if (diff > 255)
diff = 255;
diff_pixel |= diff << (channel*8);
}
pixels_changed++;