Img2spr converterMSX Resource Center MSXdev 2008 - MSX1 development bonanza!              
              
English Nederlands Español Português Russian         
 News
   Frontpage
  News archive
  News topics

 Resources
   MSX Forum
  Articles
  Reviews
  Fair reports
  Photo shoots
  Fairs and meetings
  Polls
  Links
  Search

 Software
   Downloads
  Webshop

 MRC
   Who we are
  Join our team
  Donate
  Policies
  Contact us
  Link to Us
  Statistics

 Search
 
  

  

 Login
 

Username

Password




Don't you have an account yet? Become an MSX-friend and register an account now!.


 Statistics
 

There are 158 guests and 2 MSX friends online

You are an anonymous user.
 

Img2spr converter

Utilities - Img2spr converter

 Saturday, March 29, 2008 - 22:43
 Submitted by: andrear1979
 Topic: Utilities
 
A new command line utility for Windows is available at the MSX Software section of andrear's website. With this new tool one can extract sprite patterns from a color 16x16x24bit PNG image (other image formats may work as well), upon which they will be converted to -for instance- MSX-BASIC.

Though very simple, this utility may be of use to the MSX contestants coding for the current MSX contests (among others: 2KBOS, the 25th MSX anniversary BASIC contest and the upcoming MSXdev'08). Source code is included (C language, compiled in Windows with gcc-MinGW).

Relevant link: andrear's website - software section
 
 


By Google

By ARTRAG on March 30 2008, 10:23
nice work, but of limited use.
Andrea, what about a screen 2 converter that automatically tries to add details using sprites ?
That is a true challenge, isn't it ?
By andrear1979 on March 30 2008, 13:29
Hi Artrag, yes your suggestion is challenging, though I guess it's *not* a one evening task like img2spr ; but don't want to promise anything ...

By the way, a reminder to other MSX users (and to myself): you may download ARTRAG's nice scr2converter utility, here at MRC. Source code is included.


By wolf_ on March 30 2008, 13:31
I think adding sprites at user-defined locations may work out better than letting an 'AI' decide on that.
By Grauw on March 30 2008, 16:16
Idea for something even more challenging: a convertor that takes an image, and creates an optimal set of sprites out of it. E.g. when there are regions of transparency, don’t create a sprite for that region. And when a region contains more than 1 on a line, add a second sprite. And all this without fixed sprite positions of multiples of 16, but variable positions, so that it can determine the positions where the sprites are most effective.

That would be nice . For Guru Logic, we could’ve definitely used such a thing. Because of the variable optimised positions it’s very tricky to create, though.
By andrear1979 on March 30 2008, 19:46
Friends, thanks for all your future development suggestions. In the meantime, I improved a bit img2spr by adding a transparent-color parameter, please have a look at my website if you wish.
By ARTRAG on March 31 2008, 13:24
IMHO a possible algorithm to introduce sprites in the screen 2 conversion is to compute a "local" SNR on a 16x16 sliding window.
After screen 2 conversion, (use your favourite conversion strategy - note that dithering can make things more difficult),
slide the window pixel by pixel on the whole screen and pick up the 32 positions where the "local" SNR is worst (lowest).
Than, you define a sprite in each of the windows in order to to improve the SNR.

There are at least 2 problems with this solution:
1) the 4 sprites per line limit is not guaranteed
2) the use of colour dithering implies that the SNR has to be computed in a special way, i.e. doing spatial filtering before computing the SNR, (the sprite optimization in the selected windows has to be done using the same metric).

Problem 1) needs some solution apart, e.g. some manual refinement, while problem 2) adds only a bit of complications to the development of the code, but it is conceptually straightforward.




 Recent news
 
MSXart'08 - #2 Head over Heels 
MSX Info Update 2008 reminder 
Sound extensions articles on MSX Café 
Hideo Kojima on the future of games 
ViewMSX 0.06b 
Vampire Killer article 
Interview with Manuel Pazos 
Bitwise presents three new Shockware titles 
Bonami Retro fair - October 2008 
Bottle of wine poll down, SCUMM poll up 

[ News archive ]

 Latest forum posts
 
Gradius, Parodius, Ganbare and more for sale
Build my own megarom-cartridges...
Caos Begins: not anymore a chaos :)
OpenMSX, BlueMSX and fMSX are far from being perfect...
Project MOAM - Moon over Arba Minch
Tank game
want to to implement multiplayer how's obsonet 2 doing, anyone?
More info on Zemina rare games...
bload "A:" & SDCC
GFX9000 photo

[ View MSX forum ]

 Poll
 
Will we ever see a SCUMM-like point and click game on MSX?

Yes
No

[ View results ]

 Latest reactions
 
Interview with Manuel Pazos
MSX Info Update 2008 reminder
Sound extensions articles on MSX Café
ViewMSX 0.06b
Hideo Kojima on the future of games
Will we ever see a SCUMM-like point and click game on MSX?
Vampire Killer article
With whom would you like to celebrate MSX25?
MOAM - Portal Cave mp3 added to downloads
Bottle of wine poll down, SCUMM poll up
 Affilates
 
WOOMB.net
Play-Asia
eBay
 Sponsored Links
 

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