Created a little software that process the pixels on a image and choose between some colors in a pre-setted palette.
To use the code properly, you have to set the size function with {size((width of the image * 2),( height of the image));},
The var called factor, sets the color for being darker or brighter,
A var called Scale, that sets the size of the pixels, 1 being the same size, 2 being half, 4 being 1/4 and so on,
I have used the Luis Miguel Maldonado's SLSO8 palette, https://lospec.com/palette-list/slso8
Feel Free to use!