Friday, January 8, 2010

The Colour of Magic

After adding colour matching to the app based on code I've written many times over the past couple of decades, stuff I've found on the web etc and then tweaking it a bit and thinking I was done, I ended up spending more and more time on colour.

An argument on a certain forum over which machine had a better palette, the Atari 800 or the Atari ST got me geared up to add some more functionality to the app. Simple things like the fact that none of the high end image apps seem able to remap to a fixed palette of anything over 256 colours because that's the most sensible maximum size for a fixed palette, it having one byte per pixel. A 512 colour palette would need 2 bytes per pixel (without bit packing) which is 16 bits which means you may as well write some raw RGB values in that pixels data instead. All that meant there didn't seem to be a standard image app that would remap to the ST's palette (9bit 333RGB = 512 colours). Also despite what one member (and I use that term with more than one sense) thinks just masking off bits of a 24bpp image doesn't have the desired result.

After faffing with all of that and posting remapped images in all kinds of formats and palettes and APAC 256 colour Atari 800 versions I thought I was done with colour. Wrong again :) The matter of picking complementary colours whilst designing a game came up as just having a shade of colour a bit "off" can ruin the look of a perfectly well done image. Soooo I've now added some more colour conversion functions: RGB to XYZ, XYZ to CIE-L*ab, CIE-L*ab to CIE-L*CH, some others, and all the functions to convert back. CIE-L*CH seems to be the one to use for automatically finding complementary colours so now the functions are all there I'll be able to fiddle with some kind of gui colour picker thing in that colourspace..

No more colour now! Different code!! :)


Pete

No comments:

Post a Comment