[TUTORIAL] Editing Images With Audacity

Discussion in 'Photo Manipulation (Photoshop, Gimp, etc)' started by 607, Mar 15, 2020.


Had you ever heard of the technique of editing images as audio?

Yes. 1 vote(s) 25.0%
No. 3 vote(s) 75.0%
  1. Hi, it's me again!

    Yesterday I checked someone's Facebook and noticed their profile picture (last updated in 2016) looked quite interesting. She said she had edited it with Audacity, in combination with some HEX editing. "Audacity?", I thought, "That's for audio, right?", which is also what somebody else commented. She replied and explained how it worked.
    I wanted to try as well! :D
    It was a bit trickier to find out how exactly to do it well, though, so I figured I'd write a tutorial for you, so you can try too! It's quite cool. :D

    Note: You don't need to be extremely technical to use this tutorial, but if you do not have any experience with Audacity you might have trouble. This is a tutorial for how to use Audacity to edit images assuming you have some experience with editing audio in Audacity, not for how to use Audacity in general.

    Step 1: choose a picture and open and resave it as a BMP in Paint.NET or GIMP (or something else).

    If asked for any settings, the default should be perfect (at least in all my tests :p).
    Step 2: open Audacity.
    Step 3: Click File -> Import -> Raw Data...

    Step 4: Double-click the file you want to edit and wait a few seconds.
    Step 5: Put Encoding to 'A-Law', Byte order to 'Little-endian' and Channels to '1 Channel (Mono)', and click Import.

    Step 6: You will now see your image as sound. Try playing part of it back. :D

    Step 7: You can now apply audio effects to your image. However, there is one part that you should not edit. Zoom in on the very left part of the file, until you can see the individual samples, represented by dots. You should not edit anything that comes before the second dot before the 0.00080 mark. The samples before this make up the file header, and if you change this, you will not be able to open your image anymore.

    If you want to edit your entire image, start your selection from that dot. It is sample 34.

    Advanced Tip (you can skip these at first) 1: When making your selection start at sample 34 or when attempting to merge multiple pictures, you have to be really precise. To make this easier, you can change the options at the bottom of the window to display values in samples instead of hours, minutes, seconds and milliseconds. Also change "Start and End of Selection" to "Start and Length of Selection", which will make it possible to experiment with replacing data of one image by data from another (the length of the file should stay the same, this is why you need such precision). You can change "Snap-To" to "Nearest" or "Prior" to more easily be precise with the mouse, but it is probably better to manually enter in the values with the keyboard.

    Advanced Tip 2: Editing specific parts of the image can be tricky. There are ways to calculate what's where in the file, probably, but I haven't gotten so advanced myself yet. :p Good to know however is the following: the image is made up from right to left, from bottom to top (so the opposite of reading direction). Thus, if you want to change the top of the picture but not the bottom, you should edit the latter half of the file.

    Step 8: Apply audio effects! There are plugins for Audacity adding more effects, but the basic effects should be quite enough to play around with already. For this example I will be amplifying the entire image (besides the header, the first 33 samples!) by 3 decibel.
    Step 9: Press Ctrl + Shift + E (you can also use the toolbar but this is faster :p). Now here are lots of settings that need to be right: set "Save as type" to 'Other uncompressed files', set "Header" to 'RAW (header-less)' and set "Encoding" to 'A-Law'. Give your file a name and end it with ".bmp".

    Step 10: Click 'Save', 'Yes' and 'OK'. :D

    You can now check out your image in any image viewer!

    After exporting your image, you can press Ctrl + Z to undo your changes and try again, or restart from step 1 or 3.

    Here are some demonstrations of what an effect might do to your image! For these examples I have used one of the pictures from when I met Dufne at the Van Gogh Museum.
    Here is the original picture, saved as bmp (but now not a bmp anymore, as imgur converts it back to save on storage space):

    Here is the result of my example effect above, the image amplified by 3 dB:

    A similar effect occurs when you lower the volume of the image, although the colours react differently; for this next one, I decided to lower it by 50 dB, which makes it so silent that in Audacity it will look like there's no data there anymore (although if you turn up the volume of your speakers a lot you will probably still be able to hear it), but apparently enough of the image data remains to make the image quite distinguishable still!

    Now I wonder what would happen if instead of altering the volume over the entire image, I apply a fade-out to the image. Actually, make that a fade-in, because as the image is built up from bottom to top, that will make the effect increase when you look at the image from top to bottom. I used a plugin that allows advanced fades to apply a logarithmic fade instead of a linear one.

    Oh, I like that!
    How about some effects that don't change only the volume? Applying a Wahwah effect gives quite an interesting result. :D

    Wow, that's heavy! :cool: I could try adjusting the parameters to make it less extreme, but I'll leave that up to you to try.
    Lastly, one that ought to be quite interesting: let's apply an Echo to our image! There are two parameters here to configure, I went with a delay time of 0.2 and a decay of 0.3.

    Isn't that cool?!? :D

    Lastly, I'll create one picture where I apply a bunch of effects, to different parts of the image, probably also applying effects to certain sections multiple times. I could play around for an hour with this, testing how each change affects the picture and tweaking parameters, but I want to have lunch soon and post this thread before that, so I'll just do whatever and post the result. :p

    Well, that got worse than expected... it looks like I also accidentally started from above image, instead of from the clean image, so I have the echo in here too. :p

    And I'm sorry for my head... xD I can't even remember what I did to that part of the picture. :rolleyes:

    It's cool, isn't it? :D I hope some of you will try for yourself, and share the results! I'll probably play around more myself too, as it sounds fun to learn about what effect causes what, and how to create the most impressive results. :)
  2. Moved to the photo manipulation subforum by request. :)
  3. My sister wondered what would happen when you'd reverse the image, and I'm intrigued!

    I mean, I'm not surprised it's upside-down, but the colours! I tried achieving the original colours by hue-shifting this image in Paint.NET, but I couldn't, so I guess it isn't a linear hue-shift. It obviously also isn't an inversion, which was my first thought, as bright colours are still bright and dark colours are still dark.


    The Phaser effect is also fun to play around with. :) You can choose how much of the effect to mix into the picture by changing the 'Dry/Wet' parameter.
  4. No but I'm heard of editing audio as images. ;)
    607 likes this.
  5. Maybe you can make a tutorial for that, as I haven't done that before!
  6. I just played with this a bunch more. It's so cool! :D
    Dufne likes this.
  7. I like editing pictures and making movies and stuff. I don’t got photoshop and that gibber gaber. But on Mac we have a preview software and you can do some cool stuff in there so I something mess around, I created maps and travel routes. About my family imagination routes. I’ve wanted to grow up to be a professional editor of movies and make advanced commercials I know this got nothing to do with sound but. I just put it in here for fun. I also like editing with sound. Cool thread
    607 likes this.