Jump to content
IGNORED

Conversion from RGB/HSV to GTIA color codes


Recommended Posts

I've been looking for this for some time and haven't had any luck. Is there some kind of formula somewhere that can convert from RGB or HSV color values to NTSC GTIA codes?

 

Alternatively, if someone has already brute-forced this, a table of color mappings would be quite helpful.

Link to comment
Share on other sites

You're going to have to give some more info about what you're trying to do and what form you need that mapping in. The easiest thing to do is just to export a .pal file from a recent emulator that has a palette with the color settings you want, then run a standard RGB-to-indexed-color mapping algorithm. PAL files are just RGB byte triples for all 256 colors in GTIA order. There is still no one such mapping, though, as it depends on the monitor and the color adjustment on the bottom of the computer.

 

If for some reason you want an algorithm, it's more complicated and there's still ongoing research as to more accurate methods. Forget about HSV for this, it's a weird color encoding that has no use here. The basic method is to map a cylinder in YIQ/YUV space, with its centerline along the grayscale axis and the hue values at equally spaced angles (but not necessarily equally distributed around the whole cylinder), then a color matrix to convert YIQ/YUV to NTSC RGB, followed by an additional color correction from NTSC RGB to sRGB.

 

  • Like 1
Link to comment
Share on other sites

I'm trying to convert some color-indexed RGB images for a game I'm working on. I have a utility I wrote that generates the data bytes and color tables in a way I can use, but the color conversion has to be done by hand and my eyesight isn't up to the task.

 

I was hoping to have some way to convert, if only approximately, the RGB triples to the GTIA color codes. I've stumbled across some of those crazy cylinder formulas, but the principles involved are a complete mystery to me.

 

Something like this?

 

 

Wow, I even posted in that thread. I don't remember that at all. I'll check this out later. Unfortunately, I develop on a Linux machine and this isn't running with Wine. The next time I'm on Windows I'll see if this can help me, thanks.

Link to comment
Share on other sites

Hi!

 

I'm trying to convert some color-indexed RGB images for a game I'm working on. I have a utility I wrote that generates the data bytes and color tables in a way I can use, but the color conversion has to be done by hand and my eyesight isn't up to the task.

 

I was hoping to have some way to convert, if only approximately, the RGB triples to the GTIA color codes.

Then, perhaps it is better to use graph2font? ( http://g2f.atari8.info/That way, all the restrictions on number of color per line are take care.

 

If not, the correct way is to export the pallete from the emulator and use one of many tools to map an RGB image to a given pallete, I use a command line tool " ppmquant ", but you can use Gimp or other graphic editors.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...