$ python spectrogram.py test.jpg
Wrote test.jpg.wav
$ sox test.jpg.wav -n spectrogram
Aphex Twin did it before me.
Uses SoX.