Introduction - If you have any usage issues, please Google them yourself
Matlab code using the ordered dithring (Bayer D4 and D8 matrix) to generate the binary images
Matlab code using the error diffusion algorithm (Floyd-Steinberg filter) to create a binary image