RGB to MSX Colors

Pagina 1/2
| 2

Door Rogerup

Resident (38)

afbeelding van Rogerup

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

Aangemeld of registreer om reacties te plaatsen

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

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

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

23-03-2019, 03:26

Another one...

Commercial Photography

Van wimpie3

Champion (368)

afbeelding van wimpie3

23-03-2019, 18:13

Wow! Impressive!

Van dumfrog

Resident (43)

afbeelding van dumfrog

23-03-2019, 19:16

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

Van ericb59

Paragon (1046)

afbeelding van ericb59

23-03-2019, 21:22

nice !
Would be cool to share your converter

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

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.

Van LeandroCorreia

Paladin (955)

afbeelding van LeandroCorreia

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

Van sd_snatcher

Prophet (3471)

afbeelding van sd_snatcher

24-03-2019, 00:47

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

Van paulwratt

Supporter (4)

afbeelding van paulwratt

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.


You are looking for info in the MSX palettes page.



Van Louthrax

Prophet (2406)

afbeelding van Louthrax

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.

Pagina 1/2
| 2