Some image conversions I made

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

Moderator: Moderators

User avatar
RLError
Posts: 48
Joined: Sat Jul 25, 2009 8:45 am

Post by RLError »

tokumaru wrote:There's also this.
All of the demos linked to in this thread are awesome, but WOW! THIS demo is INCREDIBLY mind-blowing! My goodness! It was a immense shock to me when I loaded it up and experienced it in its entirety. I hope more people get a chance to see this.

Oh, and
Image
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

There are two other animation NES demos, ones which marked 001 and 002.
User avatar
RLError
Posts: 48
Joined: Sat Jul 25, 2009 8:45 am

Post by RLError »

These animations are pretty cool. I'm a little disappointed because I found out that the animation and music in that Bad Apple demo wasn't made just for the demo. It's still pretty cool and it's obviously an impressive feat.
Onju_Asakura
Posts: 1
Joined: Sun Mar 20, 2011 11:31 am

Post by Onju_Asakura »

The Dinosaur looks like freakin' holographic 3D 0.0
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

I decided to release the tool which was used for these conversions. Download it HERE.

EDIT: Note: There's a small bug in the tool, there can't be spaces in the path of the image.

Basic usage

This tool takes a 256x480 or 512x240 resolution image and attempts to convert it to be displayed on NES to the best of its abilities. You can of course also convert a 256x240 image (so it won't flicker) by resizing it (using nearest neighbor filtering) to 256x480 or 512x240, then converting.

To use it, first of all you'll need to download and install ImageMagick (download the file ImageMagick-x.x.x-x-Q16-windows-dll.exe). After installing, open up command line and type "convert --version" to verify it installed succesfully. It should print something like this:

Code: Select all

Version: ImageMagick 6.7.1-2 2011-08-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
You'll also need some version of the .NET runtime, I'm not exactly sure which. But you probably have it anyways if you're not using an ancient version of Windows.

In the package there's a file named "sample.png" which looks like this:

Image

Drag & drop "sample.png" over the file "convert-256x480.cmd". After a little while it should have been converted to "sample.nes". Open the ROM in your favourite emulator to verify it works. I prefer Nestopia, since it seems to be the best at keeping a stable frame rate. If it worked, CONGLATURATION!!! If not, drop me a line.

Preparing images for conversion (with Photoshop)

So how to prepare your own images for converting? You can't use just any arbitrary image. Here are the restrictions:

- Resolution must be 256x480 or 512x240.
- All colors in the image must be from Nestopia's YUV palette! Photoshop palette file is included in the package (nestopia-yuv-palette.act).
- Bit depth of the input image doesn't matter (at least 8 bpp and 24 bpp work).

Here's a process I've found to work fairly well for preparing arbitrary images. Let's take this random image from the internet for example:

Image

First I'm going to resize it down to 512x240 (from menu Image -> Image Size). 256x480 could be used as well, it's your choice. Looks like this:

Image

Now we need to reduce the number of colors in the image. Go to menu Image -> Mode and choose Indexed Color. This dialog will pop up:

Image

Color amount between 9-12 seems to work the best. The higher the number of colors, harder it is for the converter to give good results. I like to use Pattern dithering, but Diffusion can produce nice results as well.

The result looks like this:
Image

Next step is to make the colors compatible with NES palette. First we need to convert the image back to RGB. Choose to Image -> Mode -> RGB Color.

At this point it's usually good to make some adjustments to the image to make it better suited for NES. For example, pump up the contrast from Image -> Adjustments -> Brightness/Contrast. Image -> Adjustments -> Curves is another useful one. High contrast images tend to work better because there aren't very many shades of colors available on NES. The adjustments here are really the key to getting decent looking results, along with the complexity of the image.

Here's the image after my adjustments:
Image

Now let's apply the NES palette. Go again to Image -> Mode and choose Indexed Color. Under "Palette", choose "Custom...". In the "Color Table" dialog press "Load..." and navigate to the file "nestopia-yuv-palette.act". Be sure to turn Dithering off at this point! While it might look better, it'll make the image too complex to convert well. Take a look at the preview, and if it looks like shit, go back to adjusting the image.

Press OK, and here's the result:

Image

Now the image is ready to be converted. Save it in PNG format, and drag&drop the resulting PNG over "convert-512x240.cmd" to convert it. Pray to your deity of choice that it will be converted well.

Open the ROM in your favourite emulator to enjoy the fruits of your labor... It should look something like this:

Image

That's all! As usual, if you make something cool with this, let me know!

EDIT: Forgot to mention, in this latest version of image viewer button A can be pressed to skip over one frame, making it possible to adjust the even/odd field on displays such as HDTVs which treat the signal as interlaced. This can be used to make 256x480 images look better (or rather, a little bit less bad) on those displays.
Last edited by thefox on Tue Oct 04, 2011 12:55 am, edited 2 times in total.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Cool, I can't wait to get back home to try it.
Useless, lumbering half-wits don't scare us.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

To use it, first of all you'll need to download and install ImageMagick.
Dead link
Useless, lumbering half-wits don't scare us.
LocalH
Posts: 186
Joined: Thu Mar 02, 2006 12:30 pm

Post by LocalH »

That composite shot reminds me of why many Genesis/MD artists have used vertical dithering (well, now that I think about it, it's more accurately termed horizontal dithering). No vertical blending means that dithering on the Y axis sticks out like a sore thumb. Give me a bit to get back to my PC and I'll post my ImageMagick dithering threshold map for doing X-only dithering (and I'm experimenting with a technique to flip the map and make fieldrate flickering acceptable in many more cases so that might be useful too - C64 democrews have flickered for years without complaint, and they're primarily PAL). ImageMagick can also take a second input image containing the target colorset (which can hold more than 256 colors, btw), which is really handy for making proper 9-bit images for the MD and would also be useful for targeting either the YUV or RGB palette for the NES.

I'll also do a test using that same image, with the only change to your script being to use my X-only dithering map (well, that and moving the color reduction from Photoshop to ImageMagick, using a remap image derived from your Photoshop palette).

Edit: After doing some experiments, it turns out that things don't work so well with the flickering (although part of the difficulty is the non-RGB palette of the NES, as the -remap parameter is a color reduction step, not just a color mapping tool, so I'm finding it a pain in the ass to make IM use the PPU YUV palette as the colormap to reduce to, and same thing with the -colors switch). Am I just having trouble grokking IM or is what I'm wanting to do only possible with IM for the MD because of the regular 8-level RGB?
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

Bregalad wrote:
To use it, first of all you'll need to download and install ImageMagick.
Dead link
Sorry, missed this earlier. Fixed now.
LocalH wrote:ImageMagick can also take a second input image containing the target colorset (which can hold more than 256 colors, btw), which is really handy for making proper 9-bit images for the MD and would also be useful for targeting either the YUV or RGB palette for the NES.
Yep, but the resulting images are usually way too dithered to work well on the NES, that is, they contain way too many colors inside an attribute block. Dithering to an arbitrary colorset can be done with Photoshop as well (and at least previously Photoshop's dithering algorithms looked much better than ImageMagick's), but like said, it just doesn't work very well.

The attribute limitations really are a pain in the ass for realistic images like these.
After doing some experiments, it turns out that things don't work so well with the flickering (although part of the difficulty is the non-RGB palette of the NES, as the -remap parameter is a color reduction step, not just a color mapping tool, so I'm finding it a pain in the ass to make IM use the PPU YUV palette as the colormap to reduce to, and same thing with the -colors switch). Am I just having trouble grokking IM or is what I'm wanting to do only possible with IM for the MD because of the regular 8-level RGB?
I'm not sure.

Btw here are some new images I've converted: http://thefox.aspekt.fi/new-images.zip (Nestopia preferred, it seems to be the best at keeping a stable framerate).
LocalH
Posts: 186
Joined: Thu Mar 02, 2006 12:30 pm

Post by LocalH »

Very nice images, the use of alternation at the frame rate (I call it "color-interlacing" from my days learning about the C64) is quite good for color blending (as long as the two colors being alternated are similar in luminance, obviously alternating black and white is not good). It would certainly be nice if the NES had a way to shift the image by a half-pixel, then you could also simulate double horizontal resolution (like they do on the C64 by using two multicolor images, which of course use double-wide pixels, and then one of the two images is offset by one hires pixel in hardware). And still in such cases you'd only really get good results on RGB PPUs, as the composite color phasing interferes with precise NES pixel placement.
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

Theoretically, couldn't you change the palette as the PPU draws the frame (per pixel or per tile) and get dramatically more colors?
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

You can, but the screen needs to be turned off for about a scanline worth of time. And you'll see the colors you write to the palette drawn on the screen.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
jpx72
Posts: 178
Joined: Tue Sep 28, 2010 3:27 am
Location: Slovakia
Contact:

Post by jpx72 »

Very nice application, thanks for the long description!
I was able to do a nice famicom picture but I wasn't able to use the palette provided, I'm using PaintshopPro and every palette editor is showing "wrong file" when trying to open your *.act palette :(
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Zelex wrote:Theoretically, couldn't you change the palette as the PPU draws the frame (per pixel or per tile) and get dramatically more colors?
That works for a few special cases like Blargg's flowing palette demo (video; discussion).
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

This also makes me wonder if a Mode 7 like effect is possible on the NES.
Post Reply