RGB color conversion

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

By Grauw

Ascended (10720)

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

29-09-2015, 00:28

hit9918 wrote:

But it hasn't yet taken into acount the nonlinear DAC levels Big smile
In the below code I got them in that l() function, I forgot from where I got them?

Ha, nice Smile. I guess these levels should be in the openMSX source code somewhere?

By ARTRAG

Enlighted (6933)

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

23-10-2017, 23:18

So in the end, what are the 24bit RGB values for the screen 8 colors?

By ARTRAG

Enlighted (6933)

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

23-10-2017, 23:50

These values:
red = [ 0, 43, 82, 118, 153, 188, 222, 255];
green = [ 0, 43, 82, 118, 153, 188, 222, 255];
blue = [ 0, 82, 153, 255];
improve red and green, but still there is something strange on the blue levels...

Are you sure that blue is just a subset of levels of the other colors?

By Grauw

Ascended (10720)

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

24-10-2017, 00:01

Yes. The V9938 DAC is 3-bit, so it can only produce those eight values, and the 2-bit blue values can’t be reproduced linearly. Easy to check for yourself in the emulator; screen 8:color 255,1,2:cls: i$=input$(1):screen 1:color=(1,0,0,2):color=(2,0,0,4). Screenshot and compare.

By ARTRAG

Enlighted (6933)

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

24-10-2017, 08:24

You are right,level 1 and 2 look the same of 2 and 4 on openmsx. I will try your test on real HW this weekend

By DanySoft

Champion (452)

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

29-10-2017, 11:54

For SCREEN 8: I can suggest that you can store the colors defined with DIM:

dim p(15),g(7),r(7),b(3)

for j=0 to 7
g(j)=j*32
r(j)=j*4
next j
for j=0 to3
b(j)=j
next

Or you can use all 256 redefines with DIM!

dim p(256),g(7),r(7),b(3)

You can add an alternate color with an RGB and
save to P (16,17,18,...256).

p(16)=r(2)+g(6)+b(0)

And you can collect all the favorite colors. In this case, do not forget to store all the palette table in the source (in ASM or other language).
Greetings
DanySoft

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