compressing audio with image compression formats

by shy ·

~6 minute read


wait a bit for this page to load, there's about 50mb of auditory images

a few months ago i asked my friend to send me a song to test something, and he kept sending these stupid images instead, and so i decided to turn the images into music

to do this i imported it as raw data in audacity and looped amen break over it, and then i thought "what if i export this to pcm and convert it back to an image", and THEN i thought "what if i export pcm to a bmp and compress it with jpeg, then convert it back to audio"

this resulted in a five hour long rabbithole of just compressing music and listening to it because it sounded so interesting, and i've been thinking about writing about it ever since

here's the audio file i'm compressing, it's Hydro by a2k3n1Pwnage

the uncompressed pcm is 24.2 megabytes, outputs from lossy formats will be compared to this

some of these are kind of loud or painful so you should probably turn your volume down before proceeding

experimenting

jpeg

this was the first one i tried and it definitely yielded the most interesting results

100% quality

really only noticeable difference is the audible noise "humming"

24.2mb -> 17mb, 29.38% size reduction

50% quality

i really like the bitcrunch-y sound of this one, i also like that at 0:23 you can hear the jpeg compression audibly

24.2mb -> 1.4mb, 93.88% size reduction

1% quality

the image is VERY noticeably compressed, i'm surprised music can even be pulled out of this

when it struggles, you can very audibly hear it (0:01 and every other place before the drums where that tone goes down) and it sounds very cool

24.2mb -> 134kb, 99.45% size reduction, impressive...ish

webp

not as unique as jpeg but it still produces kinda interesting results

100% quality

almost couldn't tell the difference here but it is a very slight noise hum, kinda like jpeg 100% but quieter

24.2mb -> 20.7mb, 14.81% size reduction

50% quality

this one hurts a little to listen to but it sounds bitcrunchy too

24.2mb -> 1.6mb, 93.17% size reduction

1% quality

similar to jpeg, it struggles when the drums kick in, sounds very interesting almost like it's muffled, you can also kinda hear the compression struggling at some points

24.2mb -> 380kb, 98.43% size reduction

avif

this one hurt

100% quality

high pitched whine in the background, kinda painful to listen to

24.2mb -> 8.1mb, 66.28% size reduction, kind of efficient compared to the others

50% quality

just sounds muffled with bitcrush noises, i think it worked the best out of all of the 50%s so far though

24.2mb -> 1.3mb, 94.37% size reduction

1% quality

i think this is the worst one in terms of audibility, extremely muffled and crushed, i can barely even hear the drums lol

24.2mb -> 70kb, 99.71% size reduction

gif

this is essentially just 256 color music lol

24.2mb -> 7mb, 70.97% size reduction

conclusion

this was one of my favorite little "rabbitholes" i've encountered, you can also mess with this if you want because the program i wrote to do this is open source although it's only the jpeg stuff because i was too lazy to make the other ones Permanent features (but you can easily change "jpeg" to "webp" in the code and achieve the exact same effects)

if i made music myself (and it'd definitely be Noise), i'd have a whole album of image compressed music, i find this way too cool

if you mess with this yourself and produce anything cool, you should email me at shy@shy.rocks or something


↵go home