Home Adobe Substance

CGA display adaptor filter (palletisation is hard)

poopipe
grand marshal polycounter
Offline / Send Message
poopipe grand marshal polycounter

I'm on a bit of a retro kick at the moment  ( I'm probably going senile ) and wanted to feel the warmth that for some reason i associate with early PC graphics adaptors. 

so - I made a thing that palletises (and almost correctly) sets resolution on images  as per the venerable CGA display adaptor  from a long time ago

For those of you born this century that means that in most modes you have a choice of five predetermined 4 color palettes from a total palette of 16 colors at 320*200 pixel resolution.

there are high intensity versions of the pictured  palettes and a couple of other modes (160*100 16 color) (640*200 2 color) that I've implemented but I'm not 100% sure I've got them right and as such they're not included.

The fun part of this was palletising the input image. Nothing supplied with designer comes anywhere close to doing a good job of picking colours so I rolled my own oklab space conversion which (I'm told) is perceptually "correct" and it seems to be working really nicely.
It's not a cheap pile of maths (3-4 ms at 2048*2048 on my 3080) but it's in Designer so who cares really?

It should be relatively trivial to extend this to support wider fixed palettes such as those found in EGA, VGA etc as well as other computers such as the C64, Atari ST and Amiga 



Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    I decided making an ordered dither filter would be a deeply sad way to waste an evening so that's what I did

  • oblomov
    Offline / Send Message
    oblomov polycounter lvl 8
    Looking great ! Next step is dithered 4 color CGA I suppose ? :)

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    thanks :D 

    indeed, color is next  and then perhaps a version with a larger matrix for the dither as it's just a 4x4 currently. I'm not sure what's more historically accurate.  

    I've hit a couple of blockers with the larger color palettes so I need a win to keep this interesting. The limitations around data storage and lack of straightforward looping in the pixel processor mean graphs get unwieldy very quickly when you start trying to deal with large groups of numbers

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter


    now with dithering / period correct resolution. 

    it's not catching full whites correctly yet - it can handle full blacks which is arguably more important but I am having to boost contrast slightly on input images. 

    the third image is the full 16 color 160*100 mode mentioned in the first post - It looks like complete arse without the dithering hence omission from the first post.
    This is an aesthetic anyone who got some of those Amiga 'video disks for grownups' off the dodgy bloke at the market will be familiar with. 

    On that note.. aesthetically I generally prefer the undithered versions but it's going to be pretty context dependent I think.   


    The question now, is whether i can be arsed to port it to an unreal post-process shader or not...
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Seems to be mostly working in unreal  - no dither and only the one palette for now 

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter


    dithering is mostly working now - cheating a bit cos ive doubled the resolution (to 640*400) 

    i need to work out how to get proper whites still but its starting to come together
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter


    still cheating with double resolution but I've sorted the dither range and have been testing it out on various asset store things to see what happens 
Sign In or Register to comment.