How to render one TeX equation to an image using plain TeX and dvipng

First, put this in a new TeX file. It has the equation, and does some sneaky things:

\hsize 0pt
\vsize 0pt
\nopagenumbers
\overfullrule 0pt
\noindent
$$X(\omega_k) = \sum_{n=0}^{N-1} x(t_n)e^{-j\omega_k t_n}$$
\bye

Then, run TeX to generate the DVI.

Run dvipng to convert the DVI file to PNG. Using the "-o" flag will set the output file to be name of your choosing.

With any luck, the resulting image should look like the one attached.