Looking for how to convert RGB colors to MSX1 colors (with no dithering), I wanted to find the color on the palette closest to the original RGB color, I found the CIEDE2000 algorithm very interesting.
The image is an example of the conversion, this conversion is just the graphical part of a project that will run on MSX, games written in PuzzleScript.
I made available the C code that transforms an RGB color into one of the MSX1 colors, with several algorithms, including the CIE2000 which would be the most modern and complex method and that managed to generate the closest colors.
It would be cool if someone who made a screen-converter without this method, tried the CIEDE2000 method to see the results. My program does not convert the entire images, only 8x8 sprites.
To use the code just call:
cMSX1SetPalette (); // to initialize
cMSX1Compare (R, G, B, CLAB_CIE2000); // return color 1 to 15
C Code
H Code
it's very easy to change the c code for other palettes.
Create a palette and call:
cPaletteFill( palette, num_of_colors );
then use:
cPaletteCompare(R, G, B, cmethod); // it returns the palette position