Okay, here’s my write-up about my little project, sbgy013. Buckle up, it’s a bit of a ride!

So, I kicked things off with this idea kinda brewing in my head for a while. I wanted to mess around with image manipulation. Nothing crazy, just basic stuff, but I wanted to do it in a way that felt… hands-on, you know? Like, really digging into the pixels.
First thing I did was grab a suitable image. Just a random picture of a cat from Unsplash. Cute, fluffy, perfect for experimentation. I downloaded it and then I had to figure out how to actually get to the pixel data. I ended up using Pillow (PIL) in Python. Super straightforward, loaded the image right up.
Next step: The fun part! I decided I wanted to try and create a sort of “glitch” effect. Basically, shifting some color channels around. I wrote a loop that went through a section of the image, and for each pixel, I swapped the red and blue values. Simple as that.
- Load image with Pillow
- Create nested loops to iterate through a region of the image
- For each pixel in that region:
- Store the original red value.
- Set the red value to the original blue value.
- Set the blue value to the stored original red value.
- Save the modified image.
Ran the script… and… yeah, it worked! But it looked kinda…meh. Just a small rectangular area with swapped colors. Not the cool glitch I was imagining.
So I went back to the drawing board. I thought, “Okay, what if I made the area random? And the amount of shift random too?”. I imported the random
module and tweaked the code. Now, instead of a fixed rectangle, it would pick random starting points, and random sizes for the affected areas. And instead of just swapping red and blue, I added a chance to also shift the green channel around.

This time, when I ran it… woah! That was way better. It looked like the image was actually broken in a cool, digital way. Definitely closer to what I was aiming for.
But still, it wasn’t perfect. The random chunks were too uniform, too blocky. So I tried adding a blur effect after the color shifting. Pillow has a bunch of built-in filters, so I just used the `*` filter. A little blur smoothed things out, making the glitches look more natural and less like just random squares.
I played around with the parameters – the size of the random areas, the amount of color shift, the blur radius – until I got something I was happy with. It’s all about tweaking and experimenting, seeing what looks cool.
The final step was to just run it on a bunch of different images, seeing how the effect translated. Some images worked better than others, depending on their colors and composition. But overall, I was pretty stoked with the result. It was a fun little project, and I learned a bunch about image manipulation along the way. Plus, I got some cool, glitched-out cat pictures!
Would I use this for anything practical? Probably not. But it was a great way to spend an afternoon, hacking around with pixels and learning new stuff. And that’s what it’s all about, right?
