Databending Images in Audacity
It’s easy, but there are a few steps involved. Only uncompressed images can be databent, so I tend to stick to .BMP files as a safe pick. I’ve quickly whipped up a .BMP image in GIMP and have Audacity open.
Under “File” in Audacity’s toolbar, find “Import” > “Raw Data…” and click that. Browse to the location of your image file and select it. The “Import Raw Data” window will appear. In the Encoding drop-down menu, choose either “U-Law” or “A-Law.” I do not know what the difference is and usually just pick “U-Law.” Remember which one you picked. The rest of the settings can be left alone.
Your image will appear as a waveform because Audacity is interpreting your image as an audio file. If you play it, it might hurt to listen to, so watch your volume. Click and drag along it to select a large portion of the waveform, but make sure to leave the first little bit of it alone. That’s the file header, and if it’s edited, it can’t be rebuilt into a functioning image file. Below is my image’s waveform, and you can see how much of it I’ve selected directly above it.
With part of your waveform selected, find “Effect” in the toolbar. Note that some effects will break your image (effects that change the length are particularly prone to doing this). Trustworthy picks are “Echo,” “Phaser,” “Reverb,” and “Wahwah” but feel free to experiment. If you know music terminology, you might have a clearer idea about what effects these might have on an image. You can also layer on multiple effects. For this example, I’m picking “Echo” and keeping the default settings.
Under “File” in the toolbar, go to “Export” and select “Export Audio.” The Export Audio window will appear. In the “Save as type” drop-down, select “Other uncompressed files,” This will enable some settings in the “Format Options” section at the bottom of this window. There, set “Header” to “RAW (header-less)” and set Encoding to “U-Law” if you picked “U-Law” encoding earlier, and “A-Law” if you picked “A-Law” encoding earlier. Change your file’s name so that it ends in .bmp instead of .raw, but I wouldn’t recommend overwriting your original file. Export your image, ignoring the windows that follow.
Your image should be databent now! The change in mine isn’t super substantial because I just added a small echo, but you can get some wild and neat results. I tend to crop and edit mine further afterwards.
Troubleshooting: Exporting databent images sometimes results in transparent sections. If you don’t want that, further editing will be necessary. If your image exports and it’s completely broken and unopenable no matter what you do, make sure you selected the same encoding method in the beginning that you did in the end. Also make sure you’re selecting “Export Audio” and not “Export Selected Audio.” Still not working? Try exporting the image without applying effects. If simply exporting the image from Audacity breaks it, there’s an issue with the way your source image file was exported. Here are my .BMP export settings in GIMP.
If you are concerned about Audacity’s recent introduction of telemetry, be aware that they reversed that decision as of 2021 May 16.