gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Bitmap to Tiles in either 8-bit or 8-bit split into 16 4-bit

#54623 - DiscoStew - Tue Sep 20, 2005 11:29 pm

My subject may seem hard to understand, so I'll go into detail of what I'm asking.

What I'm looking for is a program that can take a bitmap (no matter what the color depth is, as long as it can convert down to either 4 or 8-bit), and split it up into unique tiles, of which then the tiles can have either an 8-bit palette amongst the entire group of tiles, or be split into up to 16 (or less, depending on choice) 4-bit palettes of which each tile points to a certain palette.

I have successfully made a program that takes a 4 or 8-bit bitmap, and converts it to tiles that are either 4 or 8-bit, depending on it's original color depth, but everything else is still in the planning stages, cause I have never done anything like this before.

I have a demo I want to make (of a pre-existing game on an older console) that I want to release within the next 2 or so months, and I've already been gathering the necessary backgrounds and sprites, as well as having converted the music and SFX used in it. The backgrounds are full screenshots of each area, and are 8-bit, but I know the tiles themselves are 4-bit. Because I'm limited on time that I want to get this done, I was hoping that someone can point me to a program that can do what I asked, or even a group of programs that do the same thing. That way, I don't have to spend this time (the next 2 months) on making a program to do this, when I can get started on the game itself.

Any have any suggestions?
_________________
DS - It's all about DiscoStew

#54657 - FluBBa - Wed Sep 21, 2005 8:52 am

What "old console" are we speaking of here?
For most consoles there are at least one emulator that can dump the actuall tiles instead of taking several screenshots of every screen in the game.
_________________
I probably suck, my not is a programmer.

#54706 - DiscoStew - Wed Sep 21, 2005 8:58 pm

For the "old console" I'm referring to, it is the SNES.

My method for getting screenshots is to use SNESAdvance with the game, running under VisualBoy Advance, and with Map View, save each screenshot, and put them together to form the entire image of one area. Even though SNESAdvance does a somewhat good job at emulating the game, this whole deal with the demo is mainly for my benefit at programming an actual game, and seeing how things run.

Now, I know I could always use Tile View to get the tiles at their 4-bit level, but the images are saved as 24-bit, and even with using a program like Photoshop to reduce the colors back to just 4-bit, matching tiles together of the same 4-bit palette order would seem difficult, especially if some of the same tiles use different palettes in different situations (I can't recall if the game I'm demo'ing does this), of which I would also have to match up palettes the same way. It just seems like too much work. Because VisualBoy Advance saves in 24-bit, there really is no palette, and Photoshop, when reducing the colors, would order the palette by whatever color comes first on each line and not by tile, most likely ordering the palette to not be the same as the game uses. There are just to many turns when all I want is a straight path. =P

You said that most likely there is an emulator that can dumb the actual tiles. If so (for the SNES), would this also dumb the palette in the same order as the game uses it? If so, that would save me a load of time in working this out. As for the map layout, I can just refer myself to the screenshots I made, and make the maps manually, which shouldn't be too hard.


(**If you are wondering what game I'm demo'ing, I'd rather not say at the moment. I kind of like to keep these things secret until I'm ready to let it out. I know that other people have made demos of already-made games, but I feel that the situation with this particular game is different.**)
_________________
DS - It's all about DiscoStew

#54708 - thegamefreak0134 - Wed Sep 21, 2005 9:13 pm

With photoshop, although I can't remember exactly how at the moment, there is a way to record the actions taken on a picture, and then batch the same effects on multiple pictures. I want to say the record option is on the actions menu, but I'm not sure. If no one else responds in the same way, i'll get back to you with proper instructions.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#54709 - headspin - Wed Sep 21, 2005 9:31 pm

Just because Visualboy Advance saves the image as a 24-bit file it dosn't mean it's adding colour to any of the pixels does it. So just convert the image in Photoshop to an 8-bit Indexed image. That way if multiple 4-bit palettes are used, you retain those colours.

Then use a converter like gfx2gba (not sure if it can handle multiple 4-bit palettes) and let the converter do all the work for you.

There is no simple way to do this, you need a program that will split the 8-bit (256 colours) up into separate 16 colour (4-bit palettes), generate palettes based on some algorithm then go through each tile and decide which palette it uses.

If gfx2gba can't do that, there should be a program out there that does. Or keep working on your own tool. There would be a little bit of maths involved in processing an image in such a way, but if you break it down into steps it should be quite easy to do.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#54710 - blindraccoon - Wed Sep 21, 2005 9:34 pm

I've been looking into this as well (I have a similar problem, a.k.a. old console port). So far I've found these to be helpfull:

for 8-bit tiles:

try grab_tiles.exe that comes with the level mapper from www.gbatools.com. It works very well for 8 bit stuff.

for 4-bit tiles:

I just tried quither (from http://www.angelfire.com/wizard/deku/program.html) that I heard about in this thread : http://forum.gbadev.org/viewtopic.php?t=3308&highlight=quither&sid=cb566ca79ba9f53b16f615d3c9a65e41 there is also talk of a Photoshop action in there but I haven't tried it yet.

Quither dithers the output but there is some code commented out in it that does non-dithered output. This produced pretty decent results for me. The non-dithering code needed some massaging to get it to work so if your interested I can post those changes for you.

I myself have started work on a program to do 4 bit palette reduction from 8/24/32-bit color bitmaps. If I get anywhere with it I'll post it here.

Let us know how you're doing, what you find out and any other questions.

-- the blindraccoon --
_________________
There are exactly 10 types of people in the world, those that understand binary and those that don't.

#54765 - FluBBa - Thu Sep 22, 2005 12:49 pm

DiscoStew: Use the Memory viewer in VBA and dump the data from there instead, you'll get the actuall raw graphics data that is in GBA format.
_________________
I probably suck, my not is a programmer.

#54774 - jumperwillow - Thu Sep 22, 2005 2:48 pm

I'm not sure if this will suit your needs, but I use irfanview all the time for all sorts of image manipulations. Just Google for it and you'll find it. It has options to convert images to any color depth, although I haven't taken the time lately to check out the indexed pallettes it creates. It has so many options to do different things though, you might just find what you need.
_________________
-h

#54802 - DiscoStew - Thu Sep 22, 2005 6:54 pm

Quote:
DiscoStew: Use the Memory viewer in VBA and dump the data from there instead, you'll get the actuall raw graphics data that is in GBA format.


Now that is something I would have never thought of doing. That is perfect! Plus, I can get the palette the same way too if needed. thx!

thx everyone for your suggestions. Maybe sometime in the future, I'll continue my little bitmap to tile project, but for right now, I got a game to make. =D
_________________
DS - It's all about DiscoStew