It is currently Mon Oct 16, 2017 7:18 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sat Sep 10, 2016 2:29 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2281
This has got to be one of the most annoying things about programming. I use Tile Molester to place my sprites (drawn from MS paint and GIMP) into the game. I find it really frustrating that I can't just give it a picture of the palette, and have it figure out the RGB values itself. I have to manually choose every color in the palette.

The palette save feature on Tile Molester sucks. Once you click on a saved palette, it saves every change you make to the palette. You pretty much have to save a palette BEFORE you create the palette, AND open the new palette, or else you end up corrupting the palette you copied from. I keep screwing this up, and I end up having to recreate the same palettes over again.

Any other tile editing program that is better with color palettes?


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 2:49 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
I use GIMP. All you need to do is go to "Image", then go to "Mode", then click Indexed. It will ask you the max amount of colors you want, but I'm pretty sure if you click 256 but your image is only 16, it won't make excessive palette entries. After that, go to "Colors", go to "Map", and then click "Rearrange Colormap". Colors are sorted by their luminescence. You can drag the colors in any order you want to then, which you'll have to if what you want to be color 0 is not the darkest color. The image isn't encoded for the SNES, you'll need a separate program for that.


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 3:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19084
Location: NE Indiana, USA (NTSC)
So how should the user tell GIMP to automatically Rearrange Colormap to reflect the pixels in a particular image, left-to-right and top-to-bottom?

I may have found one way: create a second image with the colormap rearranged in order (you have to use Rearrange Colormap once) and then save that image. Then you can convert other images using that image's colormap.

Attachment:
creating an indexed image.png
creating an indexed image.png [ 270.26 KiB | Viewed 1087 times ]

1. Create a new image that has all and only the colors you want.
2. Image > Mode > Indexed..., and use the optimum palette.
3. Notice at left that the colormap is in the wrong order.
4. Colors > Map > Rearrange Colormap
5. Drag them into the right order.
6. Notice at left that the colors are in the right order. Save this image in .xcf format or export it in .png format if you want to use it later.
7. Load the image that you want to convert to this palette.
8. Image > Mode > Indexed..., click Use custom palette, and click the button below Use custom palette to show a menu. Either at the top of the menu or at its bottom should be the colormap image that you created in steps 1 through 6. Make sure "Remove unused colors from colormap" is unchecked, or GIMP will rearrange the colors again. (I cannot show intermediate steps because my Xubuntu installation ignores Print Screen presses while a menu is up.)
9. Notice at left that the colors are in the right order. If not, you probably forgot to uncheck "Remove unused colors from colormap" in step 8.

Then when you want to convert another image using the same palette:

1-6. Open the palette image that you saved earlier.
7-9. Repeat steps 7-9 above.


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 4:10 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
I was not aware you could do that... :lol:


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 7:31 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2281
I use GIMP for drawing the graphics. That's not the nervewrecking part. The hard part is putting it into a ROM because the ROM editing program can't automatically tell what the palette is.


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 7:58 pm 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
To be fair, how would you even solve this kind of a problem? Taking the NES as an example, when you draw BG graphics, you have 4 sets of 4 colors each, where each set can have duplicate colors from another set, and that's only for a single screen at a time. In reality, your graphics are going to have many more sets of colors in different parts of the project, so how would you go from a colorful tilesheet to an appropriately quantized grouping of 4-color tiles and associated 4-color palettes? This doesn't have a simple solution to it, which is why it's not always the best idea to do NES CHR programming in a general art program.


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 8:19 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10045
Location: Rio de Janeiro - Brazil
If you're not satisfied with the assumptions (or lack thereof) that existing conversion tools make about your art, you can always make your own tools. Tile conversion is one of those tasks that's simple enough that you can solve with simple scripts, rather than with complex interactive software.

A while ago I was not satisfied with the conversion tools that existed for NES graphics, and I've always hated drawing my graphics inside awkward constrained boxes in dedicated tile editors trying to recreate the functional drawing tools of more advanced image editors, so I came up with a simple script to process bitmaps in a format I was comfortable with, that allowed me to arrange tiles and define palettes exactly how I wanted.


Top
 Profile  
 
PostPosted: Sun Sep 11, 2016 4:53 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19084
Location: NE Indiana, USA (NTSC)
Drag wrote:
To be fair, how would you even solve this kind of a problem? Taking the NES as an example, when you draw BG graphics, you have 4 sets of 4 colors each, where each set can have duplicate colors from another set, and that's only for a single screen at a time. In reality, your graphics are going to have many more sets of colors in different parts of the project, so how would you go from a colorful tilesheet to an appropriately quantized grouping of 4-color tiles and associated 4-color palettes? This doesn't have a simple solution to it

So long as you know the "associated 4-color palettes" in advance, and you're willing to use the command prompt, you could use "savtool" bundled with my NES graphics editor to convert one nametable. Or based on how it works, you could write your own tool for larger maps (such as an entire level) or for the Super NES. The hard problem is finding the palettes in advance.


Top
 Profile  
 
PostPosted: Sun Sep 11, 2016 11:39 am 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 919
Another thing that might be done is with ImageMagick or with my Farbfeld Utilities; you may write a shell script to automatically do many of these steps. Reduce to a specified palette using ff-reduce, and then to deal with tile sheets data you can use ff-strip. The ffbit program can write NES/Famicom .CHR data, but I don't know how Super NES format is working; if you know, possibly it is an existing format in there and if not you can tell me and I can add it.

It is possible to take screenshots at any time by using sleep and xwd commands (useful if you have a clock visible, to do timing).

_________________
.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group