fixed rounding error in graysale