Posted: Sat, Jan 11, 2025
My friend over at HumanRaccoon links to a very nifty site called Game Boy Yourself. It’s a client-side image processor, which just means when you upload an image, it’s messed about with in your browser rather than being sent to some server somewhere. This also means the code is available in your browser to dig and play about with too - in fact, it’s right here.
I had a mooch around in there, and saw some bits I thought I’d tinker around with myself. First off, get rid of jQuery. Fuck that noise. It can be rewritten in vanilla JavaScript just fine without all the extra rubbish. There’s also some bits we can make a bit more efficient - some expensive calculations in there (like square roots) can be reworked to avoid them, and redundant arrays can be lopped out too. I’ve also extended it so you can choose your own colour palette - just hard-refresh the page to reset the colours.
Have a play around with it below, if you like.
Click a colour to change it, and when done, click ‘apply palette’:
Now choose an image:
Image generation is triggered each time the chosen file is changed.