@neauoire @levibeach Biskwit, NeuQuant and Wu's Quantizers are also worth a look. While they focus on colour the techniques work on greys too. I use NeuQuant and Wu for converting between 24-bit and fixed palette spaces on Amiga:
Also Graphics Gems II is a hell of a book for this sort of thing: http://index-of.co.uk/Game-Development/Programming/Graphics%20Gems%202.pdf
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!