yet another graphics converter (Cross-development MSX Forum)MSX Resource Center               
              
English Nederlands Espa�ol Portugu�s Russian French         

MSX Forum


MSX Forum

Cross-development - yet another graphics converter

Author

yet another graphics converter

DamageX
msx freak
Posts: 183
Posted: January 25 2010, 11:15   
similar to this old thread: http://www.msx.org/forumtopic7311p75.html

I have been working on a multi-platform converter that aims to support as many wierd features as possible that exist on old computers/consoles (like screen 2 for instance...)

There is no utility included to display images on MSX or any other system yet, but BMPs are generated (hopefully) as they would appear. Check out the example pics: http://www.hyakushiki.net/bmptool.htm
Metalion

msx addict
Posts: 343
Posted: January 25 2010, 11:22   
How do you specify the output palette ?
And the chosen SCREEN ?

LeandroCorreia
msx professional
Posts: 570
Posted: January 25 2010, 23:10   
Tip for future versions: include sliders for brightness and contrast and a real time conversion while adjusting these sliders... From personal experience, I discovered that many image conversions to screen 2 look much better if their brightness and contrast are adjusted first.
DamageX
msx freak
Posts: 183
Posted: January 26 2010, 10:24   
For screen 8 pick RGB 332 (although the blue isn't scaled exactly the same as MSX) and a palette size of 256. Screen 5/7 - RGB 333 and 16 colors. For Screen 2, pick option 15 and load TMS9918.PAL, then divide the screen into multiple palettes of 8x1 pixels and 2 colors per palette.

A nicer interface with preview would definitely help matters. Brightness/contrast adjustment is a good idea.
Metalion

msx addict
Posts: 343
Posted: January 26 2010, 13:17   
Thanks for the answer, but all I have when I run your program is a DOS window asking me for the bmp file.
I have got no choice to make nor any option to choose ... How do you do that ?

DamageX
msx freak
Posts: 183
Posted: January 26 2010, 21:43   
Maybe you started the wrong program, run TENSAI6.EXE for color reduction. XSIZEQ.EXE is for resizing.
ARTRAG
msx guru
Posts: 2226
Posted: January 28 2010, 08:31   
hummm, for msx it is not that good...
for msx1 this is better
http://www.msx.org/modules.php?op=modload&name=Downloads&file=index&req=visit&lid=859

whose online version is here
http://msx.jannone.org/conv/

look at your test image with msx1 palette
http://picasaweb.google.com/lh/photo/J6MjQwe2bBqWs2Bv8NApnw?feat=directlink

and with msx2 adapted palette (screen4)
http://picasaweb.google.com/lh/photo/MRPVhZuXaXqmdK2Ol8WzMQ?feat=directlink
sd_snatcher
msx freak
Posts: 169
Posted: January 29 2010, 00:26   
Quote:

I have been working on a multi-platform converter that aims to support as many wierd features as possible that exist on old computers/consoles (like screen 2 for instance...)



Excellent idea!!! It wold be very good to have an option to convert to screen-10, as currently there's absolutely no good conversion tool for that. Giving the screen-10 mixed YJK+RGB complexity, the algorithm should comply with with the following requirements:

1) Know how to deal with the YJK and RGB color systems simultâneously, using the RGB colors to "patch" the most obvious color bleeds
2) Choose very carefully where the RGB colors will be used, as there are only 16 of them available
3) The RGB colors should only be used to draw small details (similar of what programmers do with sprites on screen-2), as large areas will be very obvious because of the flat aspect it will have
4) Allow the use of dithering correctly while taking both the YJK and RGB colors into account
5) Allow the user to choose the maximum amount of RGB colors will be used. After all, if the algorithm allocates all the RGB colors it will be very difficult to use the converted image inside games.

sd_snatcher
msx freak
Posts: 169
Posted: January 29 2010, 02:17   
Quote:

hummm, for msx it is not that good...
for msx1 this is better
http://www.msx.org/modules.php?op=modload&name=Downloads&file=index&req=visit&lid=859



I can't make this one work with TGA files saved by GIMP (I'm selecting "no compression" and "From top-left" as options). What kind of TGA file does this tool expect? It always complains about "Unsupported file format!" on TGA files saved by GIMP.

<edit>
Worked with "Bottom-left" and no RLE compression.

DamageX
msx freak
Posts: 183
Posted: January 29 2010, 09:22   
At low color depths currently my results are not so good huh? Just now I looked at the source code for Screen 2 converter and the wikipedia article on Floyd-Steinburg dithering. It's easier than I imagined. I will have to try it.

Screen 10 is definitely an unusual case but it should be doable. I will check it out sometime.
ARTRAG
msx guru
Posts: 2226
Posted: January 29 2010, 23:24   
sd_snatcher
should you know some othe format for images and i'll be happy to extend the code to it
sd_snatcher
msx freak
Posts: 169
Posted: January 30 2010, 03:03   
Hi Artrag!

First I have to thank you for this excellent tool!

About the file format, The-Gimp has the following options when saving the TGA file:

- With or without RLE compression (checkbox)
- Origin: "Bottom left" or "Top Left" (combo box)

Maybe it's not even necessary to code the support for the other variations, but only add a readme file explaining the TGA requirements for the converter: No RLE compression and origin = "Bottom Left".

The algorithm of your tool outputs impressive results. It seems very possible to adapt it for screen-12 conversion too. What do you think about this? OTOH, screen-10 conversion, as I was talking with DamageX seems much more complicated. The mixed YJK+RGB colorsystem itself is a great challenge, but also the rest of the requirements I listed to allow the generated images to be used on gaming.

Last, I hope I'm not asking too much, but could you please generate Mac OS-X binaries of your tool too?


ARTRAG
msx guru
Posts: 2226
Posted: January 30 2010, 08:57   
hi sd_snatcher

about a Mac OS-X version, I do not have that sytem but
if you have any C compiler, try yourself to compile my sources
with gcc i do

GCC scr2floyd.c -oscr2floyd.exe -O3 -s

any other C compiler should work

sadly i do not have skilld to support other input formats, so I'll add your remarks on the format to teh downoload page

About extending the code to other video modes (screen 10 or 12), I'd like to integrete it with palette optimization first (fulls creen 4)
but for luck of time and lazyness it is not a priority atm





sd_snatcher
msx freak
Posts: 169
Posted: January 30 2010, 19:55   
DamageX,

What do you think about using the Spatial Color Quantization algorithm? It's said to yield the best results for this kind of very restricted color conversion as required by 8-bit systems.



DamageX
msx freak
Posts: 183
Posted: February 10 2010, 11:01   
updated: http://www.hyakushiki.net/bmptool.htm

I made some progress, adding the Floyd-Steinberg dithering (option 2) and some other features. MSX1 conversion continues to be inferior to ARTRAG's program because there is no brute-force search of color combinations. I made a utility to simulate screen 10/12 but there is no use of RGB colors so far. I spent a lot of time on the automatic palette combining routine but was not very successful

@sd_snatcher do you have a pic demonstrating color bleed in screen 10 that can be improved with RGB colors? As for the spatial color quantization, I can't say much about it. The code looks complicated and the link to the paper was broken.
 
 







(c) 1994 - 2010 MSX Resource Center Foundation. MSX is a trademark of MSX Licensing Corporation.