Statistics for Optimal Dither and Noise Shaping in Image Processing