RGB to MSX Colors

Page 1/2
| 2

By Rogerup

Resident (38)

Rogerup's picture

22-03-2019, 14:22

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

Login or register to post comments

By LeandroCorreia

Paladin (944)

LeandroCorreia's picture

23-03-2019, 03:21

I did a converter in the past, just for fun. I implemented the CIEDE2000 routine for color distance and results were pretty impressive IMHO...
Commercial Photography

By LeandroCorreia

Paladin (944)

LeandroCorreia's picture

23-03-2019, 03:26

Another one...

Commercial Photography

By wimpie3

Master (248)

wimpie3's picture

23-03-2019, 18:13

Wow! Impressive!

By dumfrog

Resident (38)

dumfrog's picture

23-03-2019, 19:16

@LeandroCorreia : where is your converter downloadable ? It would be very useful !

By ericb59

Paladin (842)

ericb59's picture

23-03-2019, 21:22

nice !
Would be cool to share your converter

By LeandroCorreia

Paladin (944)

LeandroCorreia's picture

23-03-2019, 21:42

Not available for download (yet). I did just as a test in Blitz Basic. I'll try to clean my crappy code (I'm a designer, not a programmer) to make it more readable and I'll let the source code available soon.

By LeandroCorreia

Paladin (944)

LeandroCorreia's picture

23-03-2019, 21:51

And BTW, don't overestimate it. I use some tricks to make images more suitable for conversion first, such as increasing contrast and using a sharpen filter to compensate the loss of resolution. Wink

By sd_snatcher

Prophet (3014)

sd_snatcher's picture

24-03-2019, 00:47

AFAIK, MIFui has CIEDE2000 as one of its conversion algorithms.

By paulwratt

Supporter (4)

paulwratt's picture

24-03-2019, 10:00

A while ago I started writing a set of tools exactly for this occasion. It is called programmers palettes and its is mennt to suppliment @denilsonsa's gimp-palettes.

https://paulwratt.github.io/programmers-palettes/

You are looking for info in the MSX palettes page.

Cheers

Paul

By Louthrax

Prophet (2051)

Louthrax's picture

24-03-2019, 12:01

sd_snatcher wrote:

AFAIK, MIFui has CIEDE2000 as one of its conversion algorithms.

Hi Snatcher,
I sent you several test versions with CIEDE2000 and other color-distance methods, but I have not made that public yet... I had the feeling something was weird, still need to check. Maybe the sources released above by Rogerup will help.

Page 1/2
| 2