This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Tool that can extract unique tiles from an image

Tool that can extract unique tiles from an image
by on (#48846)
Does such a tool exist? You would feed an image in a specific color format, it would analyze it, extract all unique tiles in a chr files then create the name table data for reproducing that image.

If that doesn't, that seems quite a useful tool in some situation.

by on (#48847)
If you have the 4-color bitmap file, try CHROPT in my NES tools collection.

by on (#48849)
Removing redundant tiles is a trivial operation.

Something a bit more tricky is to generate an optimal set of palettes/attributes from a given image (and possibly generate sprite data as well to use as overlays in places where you need more colors than is possible with just the BG). That's a feature I'd like to add to my image converter.

by on (#48850)
I've been working on a graphics editor which does this.. You can import a 256x240 bitmap in any color depth, provided you don't have more than 256 unique tiles, and provided you don't have more than 4 colors (including the background color) in any 8x8 tile (it enforces 16x16 tile for backgrounds, 8x8 tile for sprites). *edit* and provided you don't have more than 13 colors in the entire bitmap. It will match the colors in the bitmap to the master NES Palette. If it makes a mistake you can modify the palette and attributes after the bitmap has been imported. Right now it can only produce .db assembler output in a text box, but could be easily modified to export binary files. I've found it quite convenient for my projects to have the data in .db format, since its easier to be "confident" that you know where the values are and what they are while debugging with FCEUXDSP for example.

It's kinda rough right now but if anyone's interested in trying it out send me a PM. It's a windows forms program. I've found it quite handy for my own projects so far.

by on (#48864)
mic_ wrote:
Something a bit more tricky is to generate an optimal set of palettes/attributes from a given image (and possibly generate sprite data as well to use as overlays in places where you need more colors than is possible with just the BG). That's a feature I'd like to add to my image converter.


Yeah, that'd be very cool to see.

Many years ago I used Chris Covell's utils extensively, and there is one for optimizing CHR files:
http://www.disgruntleddesigner.com/chrisc/software.html

ZomCoder: Sounds cool, you should post a pic of what it can do. 256 tiles is a little light though, I think in some cases people will want to do mid-frame bankswitching for more tiles (but I imagine it would be easy to massage the resulting data to fit like that).

by on (#48874)
Thanks everyone for the comments. So there is some tools. Great, I will be more than happy to try them. I'm always for not re-inventing the wheel, it's more effective.

@ZomCoder: I want to see what your tool do. By windows form do you mean VB or dot net? Just curious.

by on (#48877)
Ok, here's a brief screen shot of my program. It was written in C#, with .net 2.0. I did a print screen in FCEUXDSP with the nametable viewer on so I could get a background with no sprites from Mega Man 1 (and made sure I didn't walk anywhere so all the unique tiles are aligned on boundaries). When you import a bitmap, it asks you to click on the background color since that is shared amongst the 4, 4 color sub palettes. I panicked at first because I kept clicking on the blue and it wouldn't import. But it's the black that is actually the background color in this one =) When I clicked on black, then it imported fine to produce what you see here:

Image

I'd be reluctant to actually release this for general download (it wasn't meant to be pretty or polished), but if anyone would like to try it just send me a pm.

@Memblers: This tool is constrained to the "basics" as I create my first game. Maybe some day I will add more advanced features.

by on (#48977)
(first post for a long time lurker.. Yay)

I've been recently using Tile Studio ( http://tilestudio.sourceforge.net/ ), and while it's not specifically NES oriented, it's a very nice graphics and tilemap editor.

I've been importing the original hand drawn tile map as a bitmap, then creating a tilemap, using the tool to draw a full block (the icon with 1234). Then I use the Remove Duplicates.

Once all thats done, you can re-export the tile graphics as a bitmap, and save export the map.. Then you have a nice reduced tileset and tilemap.

It's open source and the author is working on 256 colour palettes, but it's possibly not to hard to add in support for NES attribute tables and palettes.

Juno

edit: Forgot to mention that I use Tile Molester to 'Copy From' the resulting tile graphics to make the .chr file