Hello, first i want to apologize for my spelling mistakes (english is not my native language). Second, after months of lurking i finally found the guts to try assembly and since my art skills are far from good (mostly skilled with clay) i found a nice solution for my problem with the art, i went to pages with open game art and tried to edit the image (a chicken) to try my first demo but i can't figure out which tools to use since i found plenty of tools to convert the image to bin, nes, chr but the image is still way too big and ends eating the whole 8 KB for graphics (i am trying to use a nrom).
I can use gimp (very basic), what i want to do is edit the 80 KB chicken image to a 4 blocks nes style, but i have no idea how to do it.
Any thoughts?
Thank you all.
Take a look if it helps:
0 Setup the image
0.1 Open the GIMP
0.2 Open the desired image for editing
1 Resize the image
1.1 "Image" > "Scale Image..."
1.2 Change the Width to 16 and Height to 16 with the combo box selected as "px"
1.3 Choose an interpolation algorithm
1.4 Click "Scale"
2 Set it to 4 colors
2.1 Manually paint the image to an arbitrary 4 colors (including the background)
2.2 "Image" > "Mode" > "Indexed..."
2.3 Set the "Maximum number of colors" to 4
2.4 Click "Convert"
3 Export as Bitmap
3.1 "File" > "Export As..."
3.2 Do not check anything and click "Export"
4 Get the CHR
4.1 Open the NES Screen Tool (get it
here)
4.2 "Import" > "BMP file as Tileset"
4.3 "Patterns" > "Save CHR"
4.4 Choose a size
You can do this method to make a whole CHR of 4KiB by just making an 128x128 image on GIMP with all tiles for a bank of this size.
Thank you! It works like a charm, now the chicken image is 4 colors and 16x16, but at first Gimp didn't allowed me 16x16 for some reason, it moved to 17 or 15 (i found that i can use the padlock icon).
Anyway, thank you, you saved me from tons of hours lurking for tutorials, now i can focus on the assembly part.
I am trying to make a dungeon crawler and maybe if get enough knowledge, a Harvest Moon/Rune Factory for the NES.
I use YY-CHR. If you have the image open in GIMP or Photoshop, converted to indexed 4 color, you can just cut and paste into YY-CHR.
Save as a CHR file. incbin into project.
@dougeff:
Thank you too, i just did it and now i have the chr file. I will post the chicken demo (mostly movement only), as soon as i get the code done.
You guys saved me tons of time. Thanks.
Hi!, after doing both techniques, some images lost tons of quality and when i move the 16x16 to yy-chr there is a weird color background and the chr file loses (again), more quality. The only image i could do with no problems is the chicken. Any suggestions?
Thanks.
There should not be any "quality loss" in something of this sort, especially if it's 4-colour. Can you provide details of what you're seeing? Screen shots? Anything?
As for the wrong background colour: CHR files do not contain a palette. YY-CHR requires you save the RGB palette for the associated image separately. Likewise, these palette are not "NES-compatible" (i.e. not for use natively on the NES). This is made further complicated by the NES attribute table, etc..
When you say "lost quality" what exactly do you mean? (Examples?)
The NES has very few pixels, in comparison to a modern computer, and also has very few options of colors, and very limited ability to display multiple colors at the same time, so some loss of quality may be unavoidable.
Ah yes sorry, here are some examples, the chick image i got from open game art gets "pixelated" a lot. And when i convert the image to 4 colors, yy shows a grey color (5), instead of 4, black (background) and 3. Sorry again if i am making spelling mistakes.
What are those attachments showing? You said that you had a 80kbyte source image with whatever color depth, and wanted to display a 4-color nes image? The attachments appear to be showing neither one of that. So why did you attach those files? What are they good for? The 25x24pixel image is most mysterious, especially as the contained image looks more like 12x12pixels.
Counting colors: White body, Transparent background (also white, but transparent counts as a separate color), grayish outlines, blue eye, and two oranges. That are six colors, not four. There are ways two show more than 4 colors (different colors in each 8x8pixel section, or overlappjng tiles), but that requires that you are using such special methods - are you doing that? Those tricks do also reduce the number of free palette entries and available sprites per line, so one single super colorful sprite might leave little room for other sprites.
For the transparent color, it may help if you assign an unused color to it, eg. magenta.
If you want to, you can use the full 16pix height, currently you have transparent pixels at top and bottom, and use only 14pix height. Of course, there may be several good reasons for that. I just noticed that it looks smaller than neccessary.
@nocash The images show the conversion i did with gimp, the chick image1 is before, chick2 is after and as you can see, the second image has lost quality.
I haven't uploaded the bmp image.
@nocash
Here is another image i borrowed from harvest moon (for an experiment) and it lost severe quality and color data. (yy)
Black brown white red gray. That are 5 colors. Try to use only 4 colors. If you don't need white, replace the white background by black, for example.
I am not familar with that tools, and don't know if less colors will help, but that should be the first thing to try.
@nocash
Thank you. Which tools you use?
Me? None. I am not doing much graphics. Or well, once or then, I am using ms paint for drawing, or iview for resizing/resampling/color depth changes, or I am just editing pixels in a text editor.
Did you get the 4 color limit working? If not, maybe try something simple, like getting started with using only 2 colors : )
I am using a tool called makechr and it works with 3 and 4 colors images (16x16) but it doesn't work with SNES sprites converted to 4 colors even if i repaint them.
Okay, I think you are still miles away from NES graphics, or even from converting PC bitmaps graphics to NES graphics.
Before trying to do anything like that, you must first understand how to create a 4-color bitmaps (with normal PC tools, you don't need any special NES tools for that).
--- You need 2bpp bitmap format (bpp = bits per pixel) (with 4 colors)
--- What you have now is 24bpp bitmap format (with 16 million colors).
I have had a closer a look at the chick images, and they have even more colors than I had thought. The chick1 has 7 colors (or maybe 8 colors if you count the background separately). And the chick2 has 82 colors.
If you have Irfan View (or similar tools), you can these things:
--- Use the "Count Colors Used" function to see how many colors you have.
--- Use the "Decrease Color Depth" function to convert to 4-color (2bpp) format.
If decreasing color depth "erases" pixels:
--- First use the "Contrast" or "Gamma Correction" or "Edit Palette" functions before decreasing color depth.
Changing 24x24pix to 16x16pix: You can almost forget about that idea. It won't work. Or it would require a lot of manual editing.
In theory there are two ways, called Resize and Resample in Irfan View:
--- Resize "removes" pixels (a pair of black and white pixels will leave only one of them, the one other disappears).
--- Resample "merge pixels (a pair of black and white pixels will become gray; the downside is that you have more colors than before).
Converting from 24x24 to 16x16 (66.666% of original size) is a terrible idea anyways. The result would probably look much better if you keep it at 24x24. Or, use half size, ie. convert to 12x12 pixels (50% of original size), you may still need manual editing, but not so much as with other scale factors.
Of course, your 25x24pix image ruins all kind of attempts to use even scale factors. Use the "Crop" function in an image editor to crop to 24x24 pixels (=remove the rightmost extra 1x24pix).
Another option is to just redraw the graphics in a tool meant to make NES graphics.
NES screen tool
YY-CHR
Tile Layer Pro
Tile Molester
etc.
Hi, makechr (the tool i am using), uses a color palette (the nes one) and if i put another color not allowed by the nes palette, i get an error. So far i made a bit of progress because i am repainting the images i borrow but yy still pastes the images with crappy quality (something that doesn't happen in makechr if i get the colors right).
I am using gimp and when i convert the image to 4 colors, it often uses colors not allowed by makechr, the chicken had 2 kinds of gray even after i converted with gimp (4 colors), and thanks to your tool (nocash) i could see the extra colors. I am still a noob and my skills with gimp are pretty far from good.
@dougeff, YY-CHR puts a weird color for the background and maybe i am doing it wrong since one picture pastes right and the other ones get a weird background color or even more than 4 colors. Here is the image that pastes right in yy.
Pasting to YY-CHR does not save the color information. It only saves the "index" (and personally, I think it does it backwards).
Palettes (the actual color you see on a screen on a NES) have to be programmed in separately from the graphic file.
There is a color replace tool (looks like 3 squares with an arrow to 3 squares) to change the index of each color after you've pasted it in.
...edit ...so if you don't understand color index... when you reduce a file to indexed 4 color, somewhere in the file it has a list of the colors and it can order them in random ways... it could be black,red,blue,white... it could be blue,white,black,red... any order is possible... so you can't expect YY-CHR to know the correct order of each color.
I use gimp also for editing my graphics. I've found the easiest thing to do is use the colormap window to manage your colors. I almost ALWAYS convert everything to the same set of 4 colors, in the same order, so that it doesn't get confused when copying things around from image to image. You can click on a color in the colormap window, and change the color for that index, or you can right-click the colormap and choose to rearrange the map.
The way I use it, I always use #FF00FF for background color (so it's obvious), then black, gray, white for the other three colors. Picking a consistent set of colors and order of colors makes it a lot easier to copy and paste things around.
(Then at the end, instead of using something like YY-CHR, I use a python script to convert the indexed png file to chr format.
There's an example script of how you might do that in Tepples' NROM Template)
You can give a shot to
my tool which doesn't care about the specific colors you are using, and doesn't care about whether the image is indexed or not. It's designed to work with backgrounds, but this doesn't matter if all your sprites are tile aligned anyway.
Just keep in mind it works on PNG images, not BMP. After importing it will mark errors (if you use more than 4 colors in places an NES background wouldn't allow), or export NES ready files. (CHR.) Here it is working on the carrot image:
You may find the colors strange. For this reason, I-CHR also exports a palette:
You want to open a palette set (the option may have slightly different text, there are lots of yy-chr versions around). You need to select all files as a filter, since yy-chr wants the .dat extension by default, but I-CHR exports .pal.
Because I-CHR doesn't care about color order as much, you may find you need to remap the palette. This is how you do this in (one version of) YY-CHR, if for example, green was supposed to be the transparent color instead:
And then, assuming you have multiple chr files you want to condense into one set, you can open all of them in one instance of YY-CHR and copy/paste them into the "final" arrangement.
I made a zip of blank chr files here:
viewtopic.php?p=136347#p136347When YY-CHR saves, it uses the same size file. So open up the 8KB file (NROM's limit), and paste your tiles into it, then save that. Consider it your "master" tile file.
Two different versions of YY-CHR, whoops!
Edit: To select a portion of tiles, right click and drag. ctrl+c copies, ctrl+v pastes.
Note that it's up to you to make sure the palette indices correspond properly. You can remap a specific selection of tiles by right click and dragging, and doing the remap palette step. (Shown for the carrot a little above.) It will only change the tiles that have been selected.
All of that doesn't really help you with getting existing art down to four colors. I might make another post about that. The tool I use makes it pretty easy (Aseprite), but it's non free (unless you compile it.)
Thank you @dougeff @gauauu @Kasumi
With Kasumi's tool i made this rom (i used copyright material but for experimental purposes only). It's a rom with the SNES hen from Harvest Moon. I am far from understating 100% of the process so i will pester you guys with questions as soon as i try to make the hen move.
Thank you.