Okay, I am trying to create a two-dimensional gradient in one-bit color (e.g. every pixel is pure black or pure white).

The gradient will always be rectangular; I want to specify the gradient by specifying the desired density (of black pixels) for each of the 4 corners.

I'm sure there's algorithms out there for generating gradients in bitmaps; I'm looking for such an algorithm (I don't need the implementation).

Would a good implementation to be to do the gradient in grayscale (which I know how to do quite easily) then apply a dithering algorithm?