Photoshop Truncating Glitch

by Daniel Temkin 13. December 2008 15:17  

This is a tutorial on producing glitched images, by exploiting a bug in older versions of Photoshop.

PLEASE NOTE: I've only completed this successfully with Photoshop 6. Recent versions of Photoshop (like CS3, CS4) have been tested and do not have this "problem". If anyone tries this method with other versions of Photoshop, or other image editing programs, please let me know how it turned out, and I'll post updates here.
UPDATE: Only works in Photoshop 6 (and perhaps earlier versions). Thanks stAllio!, for testing version 7.

You'll also need a program to directly edit binary data. I use XVI32, which is freeware, and can be downloaded here.

Here's an overview of this glitch process. We'll go through each of these steps individually:

1) Truncate a JPEG.
2) Open the truncated file in Photoshop.
3) Save many copies of the truncated file. Photoshop will fill in the missing data with distorted versions of the image in the cache, creating the mosaic-like effect.
4) View the saved images, selecting the ones with the most interesting results.


So, let's go through each of these steps.

Step 1) First, select the JPEG you want to use. When selecting an image, keep in mind that only the top of the image (I usually use the top third to top half) will appear in the final image. Here is the file I'm starting with:

This is not the most exciting image in the world, so let's run it through the glitching process and see if we end up with something more interesting.

If you're using XVI32 to truncate the file, these are the steps:

∙ Open XVI32, and open the file (File / Open).

∙ Select Edit / Block <n> Chars. Choose an arbitrary amount, about 20% to 50% of the file (judge how much to use by which part of the image [from the top] you want to use). Keep in mind that 1kb is 1024 bytes. My example file was 2733k, which is equivalent to 2798592 bytes. I selected 1000000, which is ~27% of the file. It's best to experiment with this, try different values, until you come up with as much of the image as you'd like to use.

∙ With these bytes selected (the selected values will show in red), choose Edit / Clipboard / Copy

∙ Then create a new file with File / New

Edit / Clipboard / Paste (pasting these values into the new document)

File / Save As

∙ Provide a new file name, ending with .jpg extension.

Step 2) Next, open the truncated file in Photoshop. You'll get a warning: "The document may be damaged (the file may be truncated or incomplete). Continue?". Click OK.

You'll see an incomplete image. Most of the image (everything after where it was truncated) is black. However, if you move the window around, you can see Photoshop filling in the rest of the image.

Be aware that what you see on the screen is not how the file will actually look when you save it out. In fact, each time you save it, that missing part of the image will be filled with a random, mosaic-like distortion of whatever is sitting in the cache, different each time.

Step 3) Save the file. I suggest you save many copies before closing (I usually save at least 20). Save each as a JPEG. Hang onto the truncated copy of the image, so can re-open it and save out more copies, if you're not happy with the first set of images.

Step 4) Now reopen each one in Photoshop to see the results.

Here are several images produced from my truncated image:

Combining two images together

The example below shows another approach, effectively combining two images together. This is done by truncating one image, and combining it with a second, complete image. You'll open both images in Photoshop. In the example, I've truncated the cemetery image, and am leaving the gas pump complete. Click on the complete image, to make it the active window, then click on the truncated image and immediately save it out. Since the complete image (in this case, the gas pump) was the last image loaded before saving out the other file, it is in the cache. Effectively, I've combined the two images together:



And that's it. For those who experiment with this technique, or find ways to take it further, let me know how it turns out.