woke up at midnight to add a single line of code which fixed my latest programming project.
I've been playing for no reason with image editing on a pixel level, and just finished writing my own "dithering" algorithm.
This basically reduces the number of colours used (i.e. palette) but tries to preserve gradients through pointilism basically. Without this step you would get visible bands of different colours in gradients and so on, and details can get lost more easily.
I read this article a long time ago and always wanted to write my own code to do this since forever.
https://en.wikipedia.org/wiki/Dither#Digital_photography_and_image_processingFor those incredibly interested, I specifically used a simplified version of this algorithm here:
https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_ditheringHere's an example of before and after.

The processed image below uses only 27 colours maximum to create the effect of every colour in the photo. Large photos actually dont even look changed when viewing at less than 100% zoom, which is a testament to how well it works.

You can see how it deals with solid colours like the purple background and the skin/blush areas with just 2 colours, but changing the spacing of them to control which colour looks dominant/the resulting colour.
normal

zoomed, click to enlarge more

I really like this robin head render

For some reason it's really addictive to see how the images change and how different bands of dot colours can combine to give a completely different colour, especially when I get interesting patterns of pixels or artefacts (sometimes from a not so perfect algorithm!)
I can't think of too many uses although I want to try and see if I can't make some real life plastic "pixel art" basically 1cm dots or something that combine to show an image when viewed from far away, using a limited colour choice of the acrylic colours that I have available at work.