I'd like to know if there is some software for linux which would allow me to edit the frequency spectrum of given audio data or even generate the sound from sonogram image (bitmap).
From those which can work with sonograms (snd, mxv, baudline, audacity, LAoE) only LAoE allows modyfing the spectrum, but it is just the simple filter.
note: I use "spectrogram" and "sonogram" as synonyms in this posting.
I don't know of any software, but...
Even a very accurate spectral analysis doesn't contain all the information from the original sound. There's no phase information, and though the human ear is quite insensitive to phase, it's kind of useful if you think of the spectrogram as the amplitude of a series of FFTs of the signal: you need the phase component as well to be able to inverse the FFT process and get back to the time-domain waveform.
So, that's one approach: use an inverse FFT. Just make up the phase information!
A better approach (at least for some sonograms - i/e the high contrast black + white kind you see printed in text books, not the multi-graduation spectrogram you get from Cool Edit etc) would be to take each near-horrizontal mark on the sonogram as representing a sine wave. Track the frequency, and generate the sine waves (with continuous phase). This is possible.
Sounds like a fun coding challange, if it hasn't already been done?
There was a thread a while ago (about three months) about an Aphex Twin track with faces in the sonogram. "Mathematical Equation" I think. Search for Aphex Twin and you may find the link to some PC software (Windows not Linux, but it might work in a wine emulation window)
Sorry, this is only for windows: Coagula (http://hem.passagen.se/rasmuse/Coagula.htm)
They offer a light version which is free for personal use. If you just want to draw strange sounds, then it's fine. There is an import function, but I think it's limited to short intervals. Stereo is color coded.
There have been mentions of a software called "Granulab", but I'm too lazy right now to do the googling for you.