Round when converting to 8 bits (#3429)

This commit is contained in:
Flössie
2016-09-21 21:54:46 +02:00
parent 309b823f93
commit 1e7b8035c4
5 changed files with 21 additions and 21 deletions

View File

@@ -74,7 +74,7 @@ void Image8::setScanline (int row, unsigned char* buffer, int bps, float *minVal
unsigned short* sbuffer = (unsigned short*) buffer;
for (int i = 0, ix = row * width * 3; i < width * 3; ++i, ++ix) {
data[ix] = sbuffer[i] / 257;
data[ix] = (sbuffer[i] + 128) / 257;
}
break;