Jekyll2021-03-28T17:32:46-04:00https://momo.software/blog/feed.xmlThe Peach Pit - MomoSoft Dev BlogAn amazing website.Jesse Hamiltonhello@momo.softwareCreating glitch art via databending in Audacity!2021-03-28T17:13:09-04:002021-03-28T17:13:09-04:00https://momo.software/blog/tutorial/techniques-for-glitch-art-and-databending<aside class="sidebar__right">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-file-alt"></i> On this page</h4></header>
<ul class="toc__menu" id="markdown-toc">
<li><a href="#what-is-databending" id="markdown-toc-what-is-databending">What is “Databending”?</a> <ul>
<li><a href="#getting-our-image-into-audacity" id="markdown-toc-getting-our-image-into-audacity">Getting our image into Audacity</a> <ul>
<li><a href="#importing" id="markdown-toc-importing">Importing</a></li>
</ul>
</li>
<li><a href="#databending-our-image" id="markdown-toc-databending-our-image">Databending our image</a></li>
<li><a href="#exporting-our-image" id="markdown-toc-exporting-our-image">Exporting our image</a></li>
<li><a href="#next-steps-and-ideas" id="markdown-toc-next-steps-and-ideas">Next Steps and Ideas</a></li>
</ul>
</li>
</ul>
</nav>
</aside>
<h1 id="what-is-databending">What is “Databending”?</h1>
<p>Databending is a method for producing glitch art by using software intended for one media format, and using it for others. In doing so, you can achieve cool effects with minimal effort and knowledge. While there are many ways of achieving this (and many others for creating glitch art outside of databending), we’ll take a look at a simple and accessible way of doing it with the <a href="https://www.audacityteam.org/">free, cross-platform, open source audio editing software Audacity</a>.</p>
<p>First, though, let’s take a look at some of the effects you can achieve!</p>
<figure class="third ">
<a href="/blog/assets/images/glitch/girls.jpg" title="Original image">
<img src="/blog/assets/images/glitch/th/girls.jpg" alt="Original image" />
</a>
<a href="/blog/assets/images/glitch/echo.jpg" title="After applying an echo filter">
<img src="/blog/assets/images/glitch/th/echo.jpg" alt="After applying an echo filter" />
</a>
<a href="/blog/assets/images/glitch/noisereduction.jpg" title="After applying a noise reduction filter">
<img src="/blog/assets/images/glitch/th/noisereduction.jpg" alt="After applying a noise reduction filter" />
</a>
<a href="/blog/assets/images/glitch/reverb.jpg" title="After applying reverb">
<img src="/blog/assets/images/glitch/th/reverb.jpg" alt="After applying reverb" />
</a>
<a href="/blog/assets/images/glitch/pitchup.jpg" title="After pitching up the image">
<img src="/blog/assets/images/glitch/th/pitchup.jpg" alt="After pitching up the image" />
</a>
<a href="/blog/assets/images/glitch/phaser.jpg" title="After applying a phaser filter">
<img src="/blog/assets/images/glitch/th/phaser.jpg" alt="After applying a phaser filter" />
</a>
<a href="/blog/assets/images/glitch/glitch1.jpg" title="After after applying multiple effects">
<img src="/blog/assets/images/glitch/th/glitch1.jpg" alt="After after applying multiple effects" />
</a>
<a href="/blog/assets/images/glitch/glitch2.jpg" title="After after applying multiple effects">
<img src="/blog/assets/images/glitch/th/glitch2.jpg" alt="After after applying multiple effects" />
</a>
<figcaption>Examples of some of the many effects possible via <em>databending</em>
</figcaption>
</figure>
<p>You can create glitch art simply by using these techniques, or combine them with traditional image editors to combine them into even more unique pieces!</p>
<h2 id="getting-our-image-into-audacity">Getting our image into Audacity</h2>
<p>Before we begin making modifications, first we need to get our image into Audacity. Take your image, and save it as a bitmap (.bmp) file. You could potentially use other image formates, but BMP works especially well due to:</p>
<ul>
<li><strong>Predictable header length</strong>
When we import our image in, we must be careful not to modify the header that defines the size of the image, its color space, and other metadata. BMP files have a header size of 14 bytes positioned at the beginning of the file, which is easy enough to avoid!</li>
<li><strong>Simple file encoding</strong>
BMP files are formatted as a pixel array, with each element of the array describing one pixel’s color value. When we apply different effects, this is ideal as each pixel could be modified individually if we wished.</li>
<li><strong>Wide support</strong>
You can create a BMP from most any image with the built-in image editing software on your computer.</li>
</ul>
<h3 id="importing">Importing</h3>
<p>After we have converted our file to a BMP, we’ll need to import it into Audacity. In a new Audacity project, go into the <code class="language-plaintext highlighter-rouge">File</code> menu, followed by <code class="language-plaintext highlighter-rouge">Import > Raw Data</code>. Open your bitmap image and you’ll be presented with an “Import Raw Data” window. In here, change your Encoding to either “U-Law” or “A-Law” and note down which one you chose. Both work equally well, but you’ll need to use the same encoding for both the Import and Export process or the resulting image will be corrupted.</p>
<p>You can also choose how many “tracks” you’d like to import the image as. Each additional track divides the image’s rows between them. For instance, if you import it as stereo, the left and right channels will take “every other” row. In essence, your left channel would get all odd-numbered rows while the right would get all even-numbered rows. 3 tracks would result in each having every third row, and so on. If you aren’t looking to do effects on individual rows (and instead on the image as a whole) then it is suggested to import it as mono.</p>
<p>Click ok and you’ll see your image imported as a waveform. It’s at this time that it would be a good idea to duplicate the track, and rename one to “backup” in case you need you pull the header information from it later.</p>
<figure class="third ">
<a href="/blog/assets/images/glitch/0-before.jpg" title="Our starting image we'll be making modifications to">
<img src="/blog/assets/images/glitch/th/0-before.jpg" alt="Our starting image we'll be making modifications to" />
</a>
<a href="/blog/assets/images/glitch/1-fileImportRaw.jpg" title="Import our image via the File > Import > Raw Data menu">
<img src="/blog/assets/images/glitch/th/1-fileImportRaw.jpg" alt="Import our image via the File > Import > Raw Data menu" />
</a>
<a href="/blog/assets/images/glitch/2-rawImportOptions.jpg" title="Import our file with U-Law encoding as a single track">
<img src="/blog/assets/images/glitch/th/2-rawImportOptions.jpg" alt="Import our file with U-Law encoding as a single track" />
</a>
<a href="/blog/assets/images/glitch/3-dupeAndMute.jpg" title="Duplicate the waveform, rename it to backup, and mute it.">
<img src="/blog/assets/images/glitch/th/3-dupeAndMute.jpg" alt="Duplicate the waveform, rename it to backup, and mute it." />
</a>
<figcaption>Demonstration of importing the image into Audacity.
</figcaption>
</figure>
<h2 id="databending-our-image">Databending our image</h2>
<p>Finally, we can start making art! At this point, we can start clipping, editing, and running filters on the image, so long as we don’t modify the file header. In most cases, if you avoid modifying the first 0.25 seconds of the waveform, you’ll avoid breaking the file. If you do make such a mistake, copy the first 0.25s from the backup we had made. You can try different effects by selecting a portion of the waveform, and then applying a filter from the <code class="language-plaintext highlighter-rouge">Effect</code> menu. For the sake of demonstration, let’s apply the <code class="language-plaintext highlighter-rouge">Phaser</code> effect.</p>
<p>Once we’ve finished applying our modifications, we can export the image!</p>
<figure class="half ">
<a href="/blog/assets/images/glitch/4-choosePhaser.jpg" title="Find the phaser effect in the Effects menu">
<img src="/blog/assets/images/glitch/th/4-choosePhaser.jpg" alt="Find the phaser effect in the Effects menu" />
</a>
<a href="/blog/assets/images/glitch/5-applyPhaser.jpg" title="Change the settings and apply the effect. Play around with it!!">
<img src="/blog/assets/images/glitch/th/5-applyPhaser.jpg" alt="Change the settings and apply the effect. Play around with it!!" />
</a>
<figcaption>Applying effects to our imported image
</figcaption>
</figure>
<h2 id="exporting-our-image">Exporting our image</h2>
<p>Just like before, we’re going to go into the <code class="language-plaintext highlighter-rouge">File</code> menu, but this time we’ll click <code class="language-plaintext highlighter-rouge">Export Audio</code>. Rename your file to something new with the <code class="language-plaintext highlighter-rouge">.bmp</code> extension, and choose <code class="language-plaintext highlighter-rouge">Other uncompressed files</code> in the <code class="language-plaintext highlighter-rouge">Save as type</code> dropdown. In the options at the bottom, set your <code class="language-plaintext highlighter-rouge">Header</code> to <code class="language-plaintext highlighter-rouge">RAW (header-less)</code>, and choose the <code class="language-plaintext highlighter-rouge">Encoding</code> that you imported the file as earlier. Click save, and your image will be exported to the specified file. Open it up and check it out!!</p>
<figure class="third ">
<a href="/blog/assets/images/glitch/6-exportAudio.jpg" title="Find the Export Audio option in the File menu">
<img src="/blog/assets/images/glitch/th/6-exportAudio.jpg" alt="Find the Export Audio option in the File menu" />
</a>
<a href="/blog/assets/images/glitch/7-rawExportOptions.jpg" title="Export our image using the same U-Law encoding we imported with">
<img src="/blog/assets/images/glitch/th/7-rawExportOptions.jpg" alt="Export our image using the same U-Law encoding we imported with" />
</a>
<a href="/blog/assets/images/glitch/8-after.jpg" title="Take a look at the image we modified!">
<img src="/blog/assets/images/glitch/th/8-after.jpg" alt="Take a look at the image we modified!" />
</a>
<figcaption>Exporting our image back to BMP format
</figcaption>
</figure>
<h2 id="next-steps-and-ideas">Next Steps and Ideas</h2>
<p>Now that you’ve learned this technique, play around a bit with other effects!
Some suggested ideas include:</p>
<ol>
<li>Find out what happens when you fade different parts in or out</li>
<li>Try your hand at importing the image as multiple tracks, and modifying each track differently!</li>
<li>Use software like Photoshop to composite your databent pictures with others, or to combine multiple images built from the same source.</li>
</ol>
<p>Once you are feeling confident in this technique, try the following:</p>
<ol>
<li>Using software like Photoshop, GIMP, or ImageMagick, try splitting an image into three images, one for the red, blue, and green color channels. Apply effects on each channel individually, and then combine them again in your chosen software.</li>
<li>Using ffmpeg or virtualdub, split a video into individual frames. Apply effects on these frames, and then combine them into a video again!</li>
</ol>
<p>As you can see, this technique is a great jumping off point for new pieces, or tool to add a bit ~more~ to an existing piece. Give it a try and show me what you come up with on Twitter at <a href="https://twitter.com/momosoftjesse">@momosoftjesse</a></p>Jesse Hamiltonhello@momo.softwareCreating glitch art and databending can be super fun, and is easily done with free tools