Auxide is a high-performance Rust CLI tool for image sonification, inspired by the encoding method used on the Voyager Golden Records. It converts images into audio waveforms by mapping pixel data to frequencies and can decode that audio back into the original images.
It leverages parallel processing (via rayon) to handle large batches of images efficiently.
- Encode Images to Audio: Converts pixel intensity to audio frequency.
- Decode Audio to Images: Reconstructs images from WAV files using zero-crossing frequency analysis.
- Color Support: Supports both Grayscale and RGB (interleaved channels) modes.
- Batch Processing: Processes directories of files in parallel.
- Combination: Optionally combines multiple encoded images into a single audio track with spacers.
Ensure you have Rust and Cargo installed.
cargo build --releaseThe binary will be located at ./target/release/auxide.
By default, Auxide runs in encoding mode. It resizes images to the specified dimensions and generates a WAV file.
Basic Grayscale Encoding:
auxide --input ./images --output ./audioColor Encoding: To encode Red, Green, and Blue channels sequentially:
auxide --input ./images --output ./audio --colorCombine into Single File: To merge all processed images into one long audio file (useful for transmission or creative effects):
auxide --input ./images --output ./audio --combine --spacer 2.0To convert the audio back into an image, use the --decode flag.
Note: You must provide the same
--width,--height,--duration-per-pixel, and--colorsettings used during encoding to reconstruct the image correctly.
auxide --decode --input ./audio --output ./reconstructed --width 512 --height 512| Flag | Description | Default |
|---|---|---|
-i, --input |
Input directory or file path. | . |
-o, --output |
Output directory path. | ./output |
--width |
Target width for resizing/reconstruction. | 512 |
--height |
Target height for resizing/reconstruction. | 512 |
--color |
Enable RGB color mode. If omitted, uses Grayscale. | false |
--duration-per-pixel |
Duration of the tone for each pixel (in seconds). | 0.01 |
--min-frequency |
Minimum frequency for pixel mapping (Hz). | 200.0 |
--max-frequency |
Maximum frequency for pixel mapping (Hz). | 20000.0 |
--combine |
Combine all encoded outputs into a single WAV file. | false |
--spacer |
Silence duration between combined images (in seconds). | 1.0 |
--decode |
Switch to decode mode (Audio -> Image). | false |
-
Encoding:
- The image is resized to the target dimensions.
- Pixels are read (either as Luma or RGB).
- Pixel value (0-255) is mapped to a frequency range (default 200Hz - 20000Hz).
- A sine wave is generated for the duration specified by
--duration-per-pixel. - For RGB, the channels are encoded sequentially: Red, then Green, then Blue.
-
Decoding:
- The audio is read in chunks corresponding to the pixel duration.
- The frequency of each chunk is estimated using zero-crossing analysis.
- The frequency is mapped back to a pixel value (0-255).
- Pixels are assembled into the final image.