BMP to Nametable + Sprites Layers

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Post Reply
User avatar
Lucradan
Posts: 99
Joined: Wed Sep 21, 2016 12:08 pm

BMP to Nametable + Sprites Layers

Post by Lucradan » Tue Jun 06, 2017 1:58 pm

Is there a tool out there that could take a bitmap and generate a an "optimal" combination of background and sprite layers that could be used to construct that image? I've been trying to use NES Screen Tool and YY-CHR, but it only handles the background and in most cases it doesn't do color quantization well.

I've done it manually for a sprite, but it was very time consuming.
Untitled2.bmp
Untitled2.bmp (28 KiB) Viewed 3466 times

tepples
Posts: 21810
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: BMP to Nametable + Sprites Layers

Post by tepples » Tue Jun 06, 2017 2:10 pm

As part of the process of developing The Curse of Possum Hollow, I made a tool that takes a PNG image, a list of 3-color palettes, and a list of bounding rectangles for each cel, and breaks up each cel into multiple layers, converts each layer to 8x16-pixel tiles, removes duplicates, and produces metasprite data. It may be one of the artifacts that my manager and I agreed that I could release.

psycopathicteen
Posts: 2911
Joined: Wed May 19, 2010 6:12 pm

Re: BMP to Nametable + Sprites Layers

Post by psycopathicteen » Tue Jun 06, 2017 3:15 pm

What kind of game are you making? That sprite looks like it almost takes up 8 sprites per line.

User avatar
Lucradan
Posts: 99
Joined: Wed Sep 21, 2016 12:08 pm

Re: BMP to Nametable + Sprites Layers

Post by Lucradan » Tue Jun 06, 2017 3:45 pm

psycopathicteen wrote:What kind of game are you making? That sprite looks like it almost takes up 8 sprites per line.
That sprite was used on an earlier project and shows what I had to do manually to create the color layers needed to approximate the image. It was close to 8 sprites per line, but didn't matter for that project.

For the project I'm trying to do now, I'm working on cut scenes (ex the title screen) where I can use the sprite palette to add up to 9 more colors to the scene. I've also been considering possible hblank palette changes to help but I've not explored that route much.

What I'd love to have is a tool that takes an image and returns the following:
1. CHR File for the backround
2. CHR File for the sprites
3. Nametable/Attribute for Background
4. Background Palette
5. Sprite Palette
6. Sprite Attributes (y, tile, atr, x)
7. Hblank Palette Changes (Optional)

User avatar
tokumaru
Posts: 11502
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: BMP to Nametable + Sprites Layers

Post by tokumaru » Tue Jun 06, 2017 4:43 pm

Lucradan wrote:7. Hblank Palette Changes
Those are really hard to pull off on the NES, and several restrictions apply.

User avatar
Lucradan
Posts: 99
Joined: Wed Sep 21, 2016 12:08 pm

Re: BMP to Nametable + Sprites Layers

Post by Lucradan » Tue Jun 06, 2017 5:25 pm

tokumaru wrote: Those are really hard to pull off on the NES, and several restrictions apply.
That's why I wouldn't even consider it unless there is a clear split in the graphics where I disable rendering for few lines to change (like parallax or sprite 0 hits)

User avatar
dustmop
Posts: 135
Joined: Wed Oct 16, 2013 7:55 am

Re: BMP to Nametable + Sprites Layers

Post by dustmop » Tue Jun 06, 2017 6:09 pm

This is quite similar to two of the modes of makechr, except that makechr doesn't support an image of combined background + sprites that it will decide to split up. I'm of the belief that it would be too difficult to define what "optimal" means, or to disambiguate what pixels should be in what layer.

For making Filthy Kitchen (open sourced on github) I created a small tool on top of makechr which takes compound pictures and splits it up into sprites and metadata describing how to piece the sprites back together to draw the original image on the NES. Typically, to do what you're describing, I would draw an image in Gimp, use the color select tool to cut pixels for the sprites, and paste them into another layer. Then, both layers can be exported as separate images, one can be run through bg mode, and the other through sprite mode. It's like, 80% of what you're asking, with the remaining 20% being manual work.

Post Reply