RGB to MSX Colors

Страница 1/2
| 2

By Rogerup

Resident (39)

Аватар пользователя 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

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By LeandroCorreia

Paladin (963)

Аватар пользователя 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

By LeandroCorreia

Paladin (963)

Аватар пользователя LeandroCorreia

23-03-2019, 03:26

Another one...

Commercial Photography

By wimpie3

Champion (438)

Аватар пользователя wimpie3

23-03-2019, 18:13

Wow! Impressive!

By dumfrog

Resident (45)

Аватар пользователя dumfrog

23-03-2019, 19:16

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

By ericb59

Paragon (1126)

Аватар пользователя ericb59

23-03-2019, 21:22

nice !
Would be cool to share your converter

By LeandroCorreia

Paladin (963)

Аватар пользователя 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.

By LeandroCorreia

Paladin (963)

Аватар пользователя 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

By sd_snatcher

Prophet (3675)

Аватар пользователя sd_snatcher

24-03-2019, 00:47

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

By paulwratt

Supporter (4)

Аватар пользователя 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.

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

You are looking for info in the MSX palettes page.

Cheers

Paul

By Louthrax

Prophet (2496)

Аватар пользователя 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.

Страница 1/2
| 2