dither
pub fn clamp_f64_to_u8(n: f64) -> u8
clamp a f64 to the closest u8, rounding non-integers.
assert_eq!(clamp_f64_to_u8(255.2), 255); assert_eq!(clamp_f64_to_u8(2.8), 3);