so basically, assuming it goes pixel-by-pixel from top left to bottom right, it keeps track of the difference between actual image up to the current position and the resulting image thus far, and adds that to the current pixel.
All of the different dithering methods are just different threshholds and shapes. For example, one dithering method might look at the error of all preceding pixels, while a different one might only look at the pixels left, above and diagonally left-above of the current pixel. Some of them also prioritize closer pixels to pixels that are further away, to limit glow. There's also suuper fancy ones that take hue into account and do a bunch of math to try and keep lines consistent, but I don't think that's widely applied, especially now that dithering is less useful than it used to be.
