JPG Glitch Pattern Generator

Back in January I posted some images of funky patterns. Today I’m formally releasing the script that brought the funk.

JPG Glitch Pattern Generator

JPG Glitch Pattern Generator

Download them from Github.

The first script, pattern_generator.sh, works by exploiting jpg compression on randomly generated images. The script starts by generating a 10px x 10px iamge containing three colours:

100px100px

It then iteratively decreasese the quality of these images from 78 (or whatever quality you change it to) down to 0. It does this a number of times – defined in loop – whilst also scaling the image by 410% at the end of each loop.

If you uncomment line 31 you can save each frame in this process. These have been scaled to a common size to make converting to a gif or video that little bit easier.

jgpggif

The second script, batch_pattern_generator.sh, performs the same process but on an image you specify. Place a jpg in the same directory and it’ll be compressed and scaled. Here’s an image of sculptures by one of my favourite artists, Alexander Calder, as seen at the Museum of Contemporary Art, Chicago:

Chicago

And then processed by the script:

Alexander Calder - JPG Glitch Pattern Generator

Like the first script, if you uncomment line 31 you can save each of the frames to individual files.

J̊̓̌̋̓̐͏̴͕̺̻̱̼̭͞☂̨̇͑͊̑ͯ̿ͦ̄͜͏̶̗̳̠̗̹̖͖̦̰̤̞͓͙ͅ☃̊ͭ̇͑̉ͧ̔̐̅͑̈́ͮ̎ͩ͂ͣ̒̐̀҉͔̮̩̠͝∆̴̬͓͈́ͣ̽ͯ̍̄͐̽͒̐̄͗ͭ̂̆̋̽̀̚͜Ǥ͓͔̹͔̺͕̦̥̪̹̼̺͕͂ͨͤ͗́̏ͬ͊͡╔̢̧̻̟̰̯̰̬̮̟̪ͮ̑͂̅̔̽̅̎̒̔͛ͯ̚͡͡ʓ̐̏ͪͫͩ̓̇̔̏ͫͥ̃̔ͦ̾ͭͫ̉̚͏͏͔̟̰͇̬̯̝̲̪̬̙̜̣͟͢͢ͅ❧̛̤̹̪̯̳͔̼̣͙̞͍͉͔̈̐ͨͧ̉̇̏̾ͦ̐̃͛͗̋͌̽̆̕❃͆ͧͥ̿͑̽͋̏̈҉̳̪͕̪̦̥̬̰̰̕͠Ȉ̷̡̻̹͙̥̺̝̫̟̲͖̪ͩ̑͐͑ͧ͆̉͘͞

If you take a look at the scripts you will see that many of the variables can be easily changed. The loop count could be increasd, which would result in noiser images. Other processing could be done before or during the scaling and quality reduction. It’s all up to you!