+Ryan Witmer Posted April 16, 2019 Share Posted April 16, 2019 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. Quote Link to comment Share on other sites More sharing options...
phaeron Posted April 16, 2019 Share Posted April 16, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 16, 2019 Share Posted April 16, 2019 (edited) Something like this? [Edit] obviously brought up to date with everything learnt since then Maybe Avery could include a little tool within Altirra to allow an RGB value to be mapped to the active palette? Edited April 16, 2019 by Wrathchild Quote Link to comment Share on other sites More sharing options...
+Ryan Witmer Posted April 16, 2019 Author Share Posted April 16, 2019 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. Quote Link to comment Share on other sites More sharing options...
dmsc Posted April 16, 2019 Share Posted April 16, 2019 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. Quote Link to comment Share on other sites More sharing options...
+Ryan Witmer Posted April 17, 2019 Author Share Posted April 17, 2019 OK, I tracked down one of these palette files, and now I think I have all the tools I need for what I want to do. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.