BMPTO105

by dvik on 01-03-2006, 09:41
Topic: Software
Tags: Utilities
Languages:

Daniel Vik has optimized and fixed bugs in the tool used to create the 105 color images, as seen in the MSX Unleashed demo. The optimized tool is now released in a package that contains the encoder tool and assembly source for a viewer application. The tool converts Windows .bmp files into 105 color .si2 files that can be assembled with the viewer source and displayed on the MSX.

Relevant link: BMPTO105

Comments (28)

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 09:47

I saw the files in the package are renamed. Thats of course ok but line 71 in I105VIEW.ASM needs to be changed to:
INCLUDE "I105CORE.ASM"

By snout

Ascended (15187)

snout's picture

01-03-2006, 09:49

uploaded a fixed version. Thanks for spotting this so quickly Wink

By anonymous

incognito ergo sum (109)

anonymous's picture

01-03-2006, 09:50

Nice!! Dvik, do you want to present this software in MadriSX & Retro? If you send us some slides we can show them in the big screen Big smile Big smile

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 09:56

That would be very nice Smile I made a small slideshow demo at:

http://www.msx.org/Technicolor.newspost3604.html

By anonymous

incognito ergo sum (109)

anonymous's picture

01-03-2006, 10:00

What about the BMPTO105 software itself. I mean, not to show only the results but the process itself. I know that this program is very cpu intensive, but maybe some slides of the process can be shown before the slideshow in the MSX1.

What do you think?

By viejo_archivero

Paragon (1372)

viejo_archivero's picture

01-03-2006, 10:03

@dvik: great, great, GREAT! Big smile

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 10:06

Ah, you mean like powerpoint slides. Yes I can try to do something and explain the concepts and the algoritm a little bit and how to use the tool.
This version is quite a lot faster than the original. Instead of taking 8 hours to create an image, this version does it in a couple of seconds. So its quite easy to also use the tool in a presentation.

By jltursan

Prophet (2164)

jltursan's picture

01-03-2006, 11:56

Fab!, I'm eager to see the inner workings of the routine! Smile

By KNM

Master (172)

KNM's picture

01-03-2006, 15:05

This is FANTASTIC!!!People will get amazed when we launch the slideshow in MadriSX & Retro! COOOOOOOL!CoolCoolCool

By Ada

Resident (49)

Ada's picture

01-03-2006, 15:14

Great news, dvik! LOL! Can we use it freely? It would be nice to include it in a game! Tongue

By anonymous

incognito ergo sum (109)

anonymous's picture

01-03-2006, 16:00

Dvik, perfect. If you can make the powerpoint slides and a little commentary I can show them in the Big Screen Conferences in the main hall of MadriSX & Retro. I have a math background, so don't worry if you include formulae in your slides TongueTongueTongue

By mars2000you

Enlighted (5497)

mars2000you's picture

01-03-2006, 19:46

This tool is for your PC, not your MSX ... Here's a ZIP file :

http://www.msxblue.com/BMPTO105.zip

By anonymous

incognito ergo sum (109)

anonymous's picture

01-03-2006, 19:53

Yes, I know, but it's a tool related to old computers, like Polka or Vortex Tracker.

I guess that present this tool in a retro-computer fair as MadriSX & Retro is a good idea.

By mars2000you

Enlighted (5497)

mars2000you's picture

01-03-2006, 19:59

My remark had only the following meaning : the ZIP format is the most populair format on a PC. Of course, the pictures that you create with this tool can be used on the MSX ! Smile

By ARTRAG

Enlighted (6238)

ARTRAG's picture

01-03-2006, 20:13

Daniel,
instead of computing MSE in the RGB space, you could compute the error in the YUV space
in in others space that gives better subjective results.
Look at this for example
http://lcavwww.epfl.ch/%7Edragotti/publications/eus98.ps

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 20:30

Yes I was thinking of doing that when I did the original version but didn't remember it now. I already have code to convert back and forth between RGB and YUV in the emulator so it shouldn't take long to do.

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 21:51

Can we use it freely? It would be nice to include it in a game!

Of course, thats why we released it Smile The code and application is under zlib license which is really nice and a lot better than GPL (I think). If you look at the code you'll see the little license note and you are free to do pretty much what you want with it except claim that you wrote it.

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 22:42

I tested using YUV instead of RGB in the MSE and this is the result. First pic uses RGB. Second pic uses YUV. As you can see the result of using YUV is that the colors are quite distorted which I think happens because there are only 15 colors to blend. so the Y component (the light intensity channel) gets too much input.

www.bluemsx.com/demos/Technicolor/image_med2.gif
MSE using RGB values

www.bluemsx.com/demos/Technicolor/image_med2_yuv.gif
MSE using YUV values

By ARTRAG

Enlighted (6238)

ARTRAG's picture

01-03-2006, 23:38

In our paper we used the C.I.E. L*u*v* perceptually uniform space
with the transform as defined in W.K.Pratt, "Digital image processing,''
John Wiley, 1991 and the illuminant C as standard white.

The transform is followed by the equalization procedure :
L_eq = (-0,020186L + 7,971237)L
u_eq = (0,003210u + 0,767563)u
v_eq = (0,001666v + 0,628228)v
which further improves the visual quality after quantization.

I have lost the original C programs and the references...

By dvik

Prophet (2200)

dvik's picture

01-03-2006, 23:43

Here is an interesting one. I do MSE on YRGB and I think this one looks pretty good:

www.bluemsx.com/demos/Technicolor/image_med2_yrgb.gif
MSE using YRGB values

By ARTRAG

Enlighted (6238)

ARTRAG's picture

02-03-2006, 16:52

go here for the RBG to L*u*v* conversion

http://www.engineering.uiowa.edu/~xjiang/aiphwk/hw1/index.htm

By ARTRAG

Enlighted (6238)

ARTRAG's picture

02-03-2006, 19:25

RGB = [ 5; 7; 255]; % generic RGB color pixel at 24 bit (8 bit per component)

RnGnBn = RGB/255; % the same pixel in float in [0 1]

RnGnBn2XYV = [ 0.607 0.174 0.200 ;
0.299 0.587 0.114 ;
0.000 0.066 1.116 ];

XYZ = RnGnBn2XYV * RnGnBn; % the same pixel in float in XYZ coordinates
X = XYZ(1);
Y = XYZ(2);
Z = XYZ(3);

X0Y0Z0 = RnGnBn2XYV * [ 1; 1; 1]; % Standard while in XYZ coordinates
X0 = X0Y0Z0(1);
Y0 = X0Y0Z0(2);
Z0 = X0Y0Z0(3);

up = 4*X/(X+15*Y+3*Z);
vp = 9*Y/(X+15*Y+3*Z);

up0 = 4*X0/(X0+15*Y0+3*Z0);
vp0 = 9*Y0/(X0+15*Y0+3*Z0);

if (Y/Y0>0.008856)
Ls = 25*(100*Y/Y0)^(1/3) - 16;
else
Ls = 903.3 *Y/Y0;
end

us = 13*Ls*(up-up0);
vs = 13*Ls*(vp-vp0);

[Ls,us,vs] % teh original point in L*u*v*

By Ivan

Ascended (9112)

Ivan's picture

02-03-2006, 21:24

Here is an interesting one. I do MSE on YRGB and I think this one looks pretty good:

Yes, this image is the best.

By Manuel

Ascended (15691)

Manuel's picture

03-03-2006, 11:55

Wow, nice results!

Some remarks:
- is technicolor based on the new conversion routines?
- the source doesn't compile on gcc, but all you have to do to get it working is change the return type of main to 'int' and fix the 'return' statements in the main function
- keep up the great work! Smile
- please dont' forget to send a mail to openmsx-devel with that list of glitches of Unleased on openMSX, which I missed.

By dvik

Prophet (2200)

dvik's picture

03-03-2006, 17:58

Thanks manuel, Technicolormania is indeed created by this tool. I'll update the source with the correct return type of main (and If I release an update I'll make sure it compiles with gcc before releasing). We can talk about it on #openmsx. I'm a bit busy this and next weekend but the weekend after I'm all free.

By Manuel

Ascended (15691)

Manuel's picture

03-03-2006, 20:34

I meant specifically the *new* routines you were experimenting with in this reaction thread. They seem to be giving better results (when using the other color space).

By dvik

Prophet (2200)

dvik's picture

03-03-2006, 20:50

Ah, no I haven't updated the demo yet. The difference is not that big though but small improvments are also good so I'll definately release an updated version soon (of course also with your comile fix).

By dvik

Prophet (2200)

dvik's picture

04-03-2006, 01:17

@ARTRAG: I tried the algorithm and the result wasn't too good. Not really sure why but it could be because the Y channel is not linear. I also tried using the eucledian distance in the cost function but the result was similar. Here is a screenshot:

www.bluemsx.com/demos/Technicolor/image_med2_luv.gif

And for reference, here is a screenshot with the original:

www.bluemsx.com/demos/Technicolor/image_med2_orig.png