Image2Spectrogram is a lightweight Python tool that encodes images into audio files. When the generated .wav file is viewed through a spectrogram analyzer, the original image is visually reconstructed within the frequencies.
Status: This project is currently in Beta and under active development.
- Visual Encoding: Converts 2D pixel data into frequency-domain audio.
- High-Quality Output: Generates standard 16-bit PCM WAV files at a 44.1 kHz sample rate.
- Frequency Mapping: Encodes visual data within the human-audible range (300Hz - 8000Hz).
To run this project, you will need:
- Python 3.x
- External Libraries:
numpy,scipy, andPillow(PIL). - Spectrogram Viewer: An application like Audacity to visualize the output.
- Clone the repository:
git clone https://github.com/SirAtilotty/Image2Spectogram.git
cd Image2Spectogram
- Install dependencies:
pip install numpy scipy pillow
- Prepare your image:
- The image must be named
message.png. - It must be placed in the same folder as the script.
- For best results, use a high-contrast black and white image (white subject on a black background).
- Note: The current version automatically resizes input images to 64x16 pixels.
- Run the script:
python spectrogram_text.py
- View the result:
Open
output.wavin Audacity, click on the track name, and select Spectrogram view to see your image.
- Sample Rate: 44100 Hz
- Duration per Pixel Column: 0.05s
- Frequency Range: 300 Hz to 8000 Hz
- Intensity Threshold: > 0.5 (for pixel-to-frequency triggering)
This project is licensed under the MIT License - see the LICENSE file for details. Copyright (c) 2026 Atilla İlhan.