An asexual and pansexual become room-mates and have wacky adventures
The show is called ‘All or Nothing’
Plot twist: the asexual is really super outgoing and is a huge flirt while the pansexual is extremely socially awkward and has trouble ordering coffee let alone getting a date.
my hand slipped
The .jpg algorithm was designed around photography, where there are a lot of gradients, and curves. It’s very good at taking a photograph, and compressing it, where the lossy result is not that much visually different than the original. However, it’s very bad at reproducing fine, important details, especially at certain settings. It shouldn’t be used for things like screenshots of text.
those 8x8 chunks i mentioned before are going to be the crux of how we glitch the .jpg. The glitches will all exist and be visible in these chunks. However get ready to be disappointed.
Your standard .jpg has a large amount of bytes in the beginning that need to stay intact. changing them will result in your picture being completely unreadable in almost all cases.
The lame doesnt stop there. becasue the glitches are all confined to the chunks, most byte replacement glitches (where you are just altering random bytes) are going to just look like this.
But of course that’s not to say that all the results will be lame! No! quite the opposite! Your standard .jpg you download off the internet will probably be less interesting, but if you have access to a image editing software like Paint Shop Pro (what I use), Photoshop, or GIMP, then you can probably find the options that are associated witht he .jpg format.
EVERYONE LOVES OPTIONS, LETS GET TO THE GLITCHY FUNSTUFFS
The pictures here are all glitched using a script i wrote in python. if you are feeling brave, and know what you are doing, feel free to get a copy here.
The most obvious option is the quality slider. In fact, just setting that down to small numbers can give a glitched look in itself.
This example is a compression factor of 99. You can see the picture has been mostly reduced to flat pixels, you will ocassionally find gradiented pixels, but not many. The colors have been reduced, and sloppily so. This image has not been byte replaced, so let’s see an example.
Not particularly different than your standard .jpg’s glitching. Changing the quality will not really result in anything other than a poopy picture. But that is not the only feature. so far, we have been using the Standard Encoding. This refers to the the order in which the data is saved and loaded as it streams to your computer. Let’s switch to Progressive Encoding. It might look like it’s just pixelated, but it’s actually the same size. Remember when I said that the compression algorithm changed the picture into 8 x 8 chunks of different gradients? This glitching actually seems to cause the rebuilding algorithm (the one that changes the data back into a picture) to use the wrong gradients.) This property is really only visible on larger images. smaller images like this one behave differently.
Progressive encoding is actually pretty resistant. Small changes can ruin what the picture looks like up close, but it takes a lot to make the whole thing look crazy. this picture has 10 times the byte editing as the previous example. This picture actually shows off a stronger than normal example of one of the other features of the progressive encoding. I think the most interesting is the seeming ghosting. The chroma, and the values (colors and shading) don’t line up anymore. Also visible are colorful patches like in standard encoding, and the incorrect gradient being applied to squares. This is the same settings, but on a larger image.
There is one more option, Chroma Sub Sampling. I have found that changing this does not result in anything spectacular in .jpg glitches. It does have an affect on the colors used, but it is very subtle. All these above images were made with the max Chroma Sub Sampling.
Well that was boring! Hey…. what’s this? JPEG2000?
Woah hey that’s cool! I am using a smaller image so that tumblr’s upload and resize doesn’t ruin the small details. This looks like a bunch of large noisy squares are invading the picture.
.jpg2000, or .jp2, is the sucessor to the .jpg by the JPEG. It works on a different compression algorithm, and isnt very widely used. It has the option of being lossy, or lossless. Their algorithms use wavelet compression, and are really just very heavy in math. I recommend the Wikipedia article if you are up for flexing your math muscle.
If you have an image editing software that supports .jp2, it is pretty fun to mess around with, but it features less options. Lossy and Lossless don’t seem to differ much in how they glitch, and many times, the output will just look like a blotchier version of the original however, one option, the “save jpg2000 codestream” option, can be turned off for some more frequent intense effects.
Anyway. The .jpg can be goaded into being interesting, with a bit of persuasion! The picture used is The Gleaners, by Jean-François Millet
Here is a sketch comic I made called Ducks, in five parts.
Ducks is about part of my time working at a mining site in Fort McMurray, the events are from 2008. It is a complicated place, it is not the same for all, and these are only my own experiences there. It is a sketch because I want to test how I would tell these stories, and how I feel about sharing them. A larger work gets talked about from time to time. It is not a place I could describe in one or two stories. Ducks is about a lot of things, and among these, it is about environmental destruction in an environment that includes humans. Thank you for taking the time to read it.
I act like such a dope in front of really pretty girls aaAAAGH WHY LEAH WHY THIS
Also called the bit map, it’s that file format that most people encounter in MSPaint. You have probably heard not to use use it, and that’s MOSTLY right. Let’s explore the format, and see what we can do to break it. I will be referring to function in my script, which you can get here. Take a look at the .bmp file format wikipedia page, and try not to be overwhelmed. Don’t worry too much, we don’t need all that technical information, we just need to understand 3 things.
the .bmp stores each pixel as it is, in RGB format.
Every color is represented on your monitor using three colors, the primary additive colors. Red, Green, and Blue. your screen will display these colors using tiny LEDs for each pixel. to know how bright to make each pixel, we give that red, green, or blue LED a number. In 24 bit or higher, that number is one byte big (that’s a value from 0-255). So for each pixel, there are 3 numbers that are used to display it, the red intensity, the green intensity, and the blue intensity. so, for every pixel, there are 3 numbers in the .bmp file to describe what color it is.
The second thing is that the file is a line of values, not a grid.
this just means that when we save the 2-D picture’s pixels, they are going in to one big long string of values. these values are saved in a specific order. .bmp files save the pixel information starting from the bottom row, on the right side, and read right to left, bottom to top.
the last thing to think about with .bmps is that .bmp is uncompressed. this means that the information about the picture is not saved using an algorithm to make the file size smaller, so the save file is not reading it using a special algorithm, it’s just picking up those bytes and converting them to light intensity. Because it is uncompressed, the file sizes are large, which is why people will tell you not to use this format.
ENOUGH TECHNICAL INFORMATION, WHAT DOES THIS HAVE TO DO WITH ANYTHING? Well, since its a long string, and has an order of how it is read, the effects you can get from glitching bytes will be limited to a few specific things.
Because the .bmp is uncompressed, there is no compression algorithm we can confuse to get cool effects. sorry to disappoint you.
however, that doesn’t mean the end of what we can do! using the script provided above, we can try a few things for our desired aesthetic. Because these glitches are manufactured by the script, they are not true glitches. oh well. they still can look cool. The first effect we can do with the script is just edit random bytes.
look at that. That is 40000 bytes that have been randomly changed. it’s barely noticeable unless you zoom in and see that random pixels are now different colors. You might as well apply a noise function.
For the sake of interesting outputs, lets change the values of the striding. Set “everynbytes” to something, like, 14. This will cause the program to only attack certian bytes. Let’s also stride our attacks, so it will hit long groups. This is “maxstride”=2000. Since we are editing in groups of 2000, I will reduced the edited byes to only 100 different ‘attacks’. You can see some interesting diagonal lines from it only doing certian bytes.
Since we know that the file stores the color information in a byte of red, a byte of green, then a byte of blue, then the pattern repeats, we can attack that pattern. Let’s edit only the greens. By setting the value to 9 on this picture, (since 12 is a multiple of 3) we can hit only blue values.
We can change this to green by adding 1 to the “everynbytesoffset” value.
mess around with different values in the offset, and you can get different looking streaks.
Let’s go back and turn off the striding and the every n bytes, so we can focus on another feature. Chunk swapping, and reversing.
Setting the stride values back to 1, lets make the chance of a chunk swap 1.0 and set the other chances to 0.0 so we can just see chunk swapping.
Well that looks pretty! You can also see that the hues in some of these chunk has shifted. thats because in some cases, that set of color intensities has shifted one or 2 colors. What were red intensities, are now green, or blue. This causes the hue to shift into one of 3 options, which are exactly triadic colors. that’s one of the reasons it looks good.
Here, I changed it so that there was a 50% chance that a chunk swap would become a chunk reversal. you will notice there are more colors now. there are now 6 different hues it could shift to. you can also see that some of the chunks are actually upside down. Like I mentioned before, the .bmp is a string of data, not a 2-d image. so it doesnt just mirror it, it just flips it.
Lastly, we have the function of a spliced source. this looks for a 2nd file, and will copy chunks of it into your original image. here i have mixed in chunks of “The Three Musicians” by Picasso. Importing data can have multiple behaviors. in the above picture, both sources have the same width. Below, the spliced source is narrower.
The diagonal lines are caused by the ends of the pixels not looping around to the next line at the same rate. Experiment to get different angles of lines.
Combining everything, we can turn the normally resilient .bmp into something very interesting! The main picture used is “The Birth of Venus” by Sandro Botticelli.
a story about tumblr’s collective ability to fact check
edit: I just noticed that the 2nd half of the audio does not have noise removal. if you want to use it, you can work with either half i suppose :D
As a starter for this tutorial, lets go over some important terms
.png is a file format. Files on your computer are literally just chunks of 1s and 0s on your hard drive. These 1s and 0s, called machine code, are typically read in chunks of 8, called a byte. (Fun fact, a single 1 or 0 is called a bit, and 4 bits is a nibble!)
To actually convert these long strings of bytes into something meaningful, it has to be stored in a predictable way. Your image is broken down into its bytes, and then these bytes are written to the hard drive using a writing algorithm. Which algorithm gets used depends on what file format you use.
To read the file again, the file is changed back into an image using a reading algorithm. How does the computer know which algorithm to use when reading a file? One way the computer uses is the file format extension, that’s what the “.mp3” or the “.png” parts of the filename is.
.png is a lossless compression file format. It’s a long term used to describe the behavior of the reading and writing algorithm of .png. Lossless means that the exact pixel values you put in, are the exact values that get read. This is a super important property for things like artwork, or sensitive images that need to stay intact, like a barcode. You might be thinking, “why would an image file format ever be lossy, and not save exactly what I put in?” Well that brings us to the idea of compression.
Compression is the making of the file smaller than the raw bytes of the image. it makes it more efficient to store on a hard drive, since it will use less space. File formats that are uncompressed are really high quality, but are terribly large sometimes. this is why .png is so useful, it’s high quality, while being smaller!
Some file formats will make smaller image files than others. .jpg is a great compression algorithm, because it makes smaller files, but it is also lossy. to achieve such small files, it will essentially ignore data it considers visually unimportant, and will use a smaller set of data that will approximate the image. Usually, this effect is invisible!
So now we know that the data stored in the .png file, while a 100% accurate representation of the image we saved, doesn’t actually resemble the image at all in the data. the compression algorithm took a bunch of shortcuts to cut down on the files size. This is why its more difficult to break the .png and have it still open. if you mess with the data that the algorithm uses to build your image again, it can break, since it wont have what it needs to continue.
THATS A LOT OF TEXT, SKIP TO BREAKING IT.
The thing is, the .png file actually has a LOT of options. Depending on which options you pick, you can actually get various effects when you are breaking your files. If you have a decent image editing software, it will let you save with options. I used Paint Shop Pro X2. Let’s get down to it.
As a word of warning, most of the time, your images are going to turn out like this:
Lets start our adventure with the palette. The palette is a algorithm that lets you store all of the colors used in the picture in a list. Using a palette can reduce file size because instead of saving the raw color bytes, it saves where in the list of colors a pixel’s color is.
Setting our image to have a palette size smaller than the number of colors in the image though, will cause some data to be lost.
This image has 32 colors in the palette. I’m choosing the colors used in my palette by the optimized octree setting.
This image has some nice features. The image colors used are all matching colors that already exist in the image. These settings will produce images with a lot of offset lines.
Now lets introduce interlacing. Interlacing is a feature of the .png file to be read and displayed as it loads in increasing resolution. It uses the Adam7 interlacing algorithm. Check out the wikipedia article here. The wiki article is very simple to understand. This picture was saved with the same settings, but with interlacing selected. The glitch script I used produced many images like this The interlacing being offset creates a grid like afterimage. Again you can see the colors stay within what the image already uses.
Lets go back and increase the palette size. Let’s set it to the maximum number, 256 (not so coincidently the largest value a single byte can express, if we start counting at 1) With this setup, we get similar lines to the first image, but much more colorful results. these colors are still within the colors palette, creating a colorful, and pleasing image. These palettes have been generated by the optimized octree. lets use a different palette! The websafe palette contains only a few approved colors, rather than picking the ones that are already in the image. This websafe palette was important back in the days of early Internet, and image and color bit depth was a critical thing to think about. Not that much is different, but if you look closely, you will see the thin rainbows of colors are smaller. That’s because its using fewer colors in the websafe palette, and has fewer colors to cycle through. You can also see that using the websafe palette has degradated the image quality overall (Look above her head to compare) Using dithering, it is faking looking better. Its overall not worth using this option.
But we live in the modern age! Things dont have to be THAT compressed. Let’s go full on 24 bit color. Not using palettes anymore, any color is possible. This is pretty obvious in the result. You will notice a few things about this option setup. First, the bands of noise. It actually isn’t noise, you can still see some features through it, like the nose and mouth. Though, that probably isn’t the first thing you noticed. The large bands of rainbow gradients stick out. With this method these rainbow bands do not always appear. In fact, most images will just look like the 2nd image.
But they occasionally do appear. They always go diagonally and they always are a single color(however they can merge together). Typically they will appear in long rows across the image, but sometimes they are single pixels all by themselves. you can see both in the example.
This setup, of using 24 bit .pngs is probably going to be the most common you will use, since the streaks can be so spectacular, and because most .pngs you download or save will default to these settings.
But what happens if we turn on interlacing again? Because of the interlacing, the streaks can appear in the top, or the bottom rows. Depending on where the bits get altered, the interlacing can make the image more visible, since you will see the image through the grid like interlacing. Let’s add in another option, transparency. Since this picture has no transparent pixels to begin with, let’s just see what adding that extra layer of byes does. This essentially makes it a 32 bit .png. huh. Well, not much different in terms of features to the 24 bit .png. PSPX2 allows me to set a certian color to be transparent, So I made it pick the skin highlights as the color. and for giggles, I also turned on interlacing, and screwed with the gamma value (which is some of the meta data in the file header). This was the result:
By exploring even more into the world of .pngs, I found another new and interesting piece of data. the output of the .png glitches is also dependent of the size of the .png! After a certain resolution (about 2048x 2048 (2048 is 2 to the power of 11) and beyond the glitches start being able to display this type of glitching) large waterfalls of color start appearing.
These waterfalls seems to evolve out of those streaks of color int he 24 bit .png glitches. (this image was made using a high resolution 24 bit image) So all and all, glitching the .png will act very different than .jpg, or .bmp or the other formats. each format is different, so if you want to see what is possible with each, you should really explore not just the formats, but the options within the format~!