quant_error.set( oldPixel.sub( newPixel ) );
// pixel[x+1][y ] += 7/16 * quant_error
// pixel[x-1][y+1] += 3/16 * quant_error
// pixel[x ][y+1] += 5/16 * quant_error
// pixel[x+1][y+1] += 1/16 * quant_error
nexterror[x ].add(quant_error.mul(5.0/16.0));
if(x+direction>=0 && x+direction < w) {
error[x+direction].add(quant_error.mul(7.0/16.0));
nexterror[x+direction].add(quant_error.mul(1.0/16.0));
}
if(x-direction>=0 && x-direction < w) {