I had this idea about five years ago to write my own pixel sorting scripts. What’s pixel sorting I hear you say? In it’s most basic form, it’s taking the pixels in an image and resorting them according to values such as brightness, saturation, colour etc..

If you think of pixels in an image existing in columns and rows, a simple script would say: go from column to column, top to bottom, when you hit a pixel that has a brightness value of 150 (pixels have a brightness value of 1-255), take the next 10 pixels, and put them in an ascending order according to their brightness. This creates cool glitchy trailing pixel effects. There are lots of pixel sorting scripts that people have shared out there on the web, so it’s not like you need to know how to code to do it. But I wanted more control and I could see how I could add layers of complication if I could just fucking code. So I started learning Python; quickly gave up.

It’s super interesting, coding. Using logic in that way scratches a lot of itches for me in terms of problem solving, but I just don’t have the brain for it. Sometimes you have to admit defeat, move on with your life. Fast forward to 2025.

I still don’t know how I feel about AI (you can see where this is going). I found the initial wave of generative image stuff fascinating, like completely enthralling. Not just because of its eerie weirdness, the horrible fingers, the faces of horror; it just blew me a way. I had a lot of fun running a fake instagram account that was a parody of myself using generated images. But what was fun about it was the captions I was writing, it gave me an outlet for some creative writing, the images themselves quite quickly lost their appeal, their sense of wonder. Then the internet became flooded with AI dross, and I didn’t feel like contributing more to it, so I put it on pause. Now I feel like I can’t walk down the street without an AI generated human with extenuated features maniacally grinning at me from every poster. I hate the fuckers.

There are of course lots of concerns around AI, copyright, energy use, job losses. I actually lost a small illustration gig I had with a microbrewery to AI generated versions of what i was doing. So yeah, it’s real. But it’s also here for good, and I think it’s worth trying to understand what we are dealing with through, er, indulging in a bit of AI implementation ourselves.

SO, armed with the latest ChatGPT model, I was finally able to write the python scripts I dreamed about five years ago. And wow, as a tool, it is very very useful and powerful.

I started with basic scripts, I don’t think it has ever given me a script that worked perfectly off the bat, but with my very basic knowledge of Python I was able to either spot the problem and correct it, or tell it what was wrong and get it to correct it. Through using ChatGPT to write these scripts I’ve grown to understand Python on a level I couldn’t before, even though I’m not sure I’ve learned any extra code, which is interesting. I’ve been able to build up the layers of complexity and, well, here are some of the results. These are still just experiments, but I get very engrossed in making them, the element of chance that is introduced into the composition is somehow like taking photos, you’re never sure of the results until they’ve been processed but you’re ever-present as you’re hunting for that image.

-select pixels based on brightness, left to right, sort the following pixels in descending brightness order

-same script but with a nice glitch from uploading and downloading the image, sometimes you get lucky
– select pixels by brightness, copy the pixel up, down, left, right, increase saturation
– tried to create spirals from selected pixels, didn’t work but got this
-use edge detect to select pixels, switch pixel blocks of a defined size with random pixel blacks in the rest of the image
-same as above
– same I think, I really like this one
– edge detect, insert text along edge, use the colour of the selected pixel for text colour, increase saturation
– insert images along edge detect
-same
-same
– same
– the scripts generally convert the image to grayscale to do the processing and parse the image in different ways before putting it back together, when the putting back together goes wrong you get these guys

Leave a Reply

Your email address will not be published. Required fields are marked *