Image color quantization procedure (FAD)
I have two purposes for quantisation: For the Spec256 Emulator (256 colors out of 24 Bit palette), where I can use the faked octree, that is damn slow but offers excellent quality of choosen palette.El_Choni wrote:The 24 bit values are in first instance reduced to 15 bit for that purpose. I use 5-5-5 for RGB, but you can use 6-4-5 if that suits you best, or any other combination. Sorry for the badly commented code. I'll try to clean it a bit when I return to Spain.
The second quantisation is to SAM Coupe Palette (64 colours in 2 bright levels=128 colors, 16 on screen without using line interupt), which works very good. I also have the possibility to choose the percentage of error distribution, because the results can be improved significantly for less colours if I choose for example 70-80% of the error for distribution.
Oh yes, don't worry about the comments too much, I just cannot speak very good spain language
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10

