24 bit modes, or the lack of them
---------------------------------

(That includes 'high-colour' modes too.)

Ok, basics first. Zgv was written as a GIF viewer (zgv stands for zgedneil's
GIF viewer, but don't tell anyone :) ). GIFs can at most have 256 colours in
an image chosen from a palette of 16,777,216. Most GIFs effectively use the
normal PC VGA standard of 256 colours from 262,144, so displaying them on a
VGA isn't too bad at all. 

Of course, JPEG adds a new flavour to the situation. I simply tacked it in
by using the IJG's JPEG library, converting to 256 colours with a palette.
Essentially, zgv sees the same result as if it had decoded a GIF file.

So what's this to do with 24 bit stuff?

JPEGs are 24 bit colour or greyscale - neither of these is likely to show
perfectly on a standard VGA, or indeed SVGA in 256-colour modes. So it'd be
a really good thing to let you use a 24 bit mode to show JPEGs.
Unfortunately, the internals of zgv have byte-per-pixel written all over
them. Another matter is that zgv lets you switch between video modes without
reloading the picture. This means zgv would have to do something like
loading a JPEG as 24 bit, then reducing it to 8 bit on demand, or keeping
two versions in memory, or whatever. The options work out slower, more
memory-intensive, or both. Zgv is already an incredible memory hog (probably
the biggest outside the wonderful world of X :( ), and I'm not really sure
how to handle this problem. I'm not even going to mention the hours of fun
you can have with quantization algorithms.

I'll probably end up loading JPEGs as 24 bit, constructing a palette, and
just dithering a 256-colour version when requested. Whatever I (eventually)
decide to do, it may not be for a while yet. Real Life is being particularly
obnoxious and annoying at the moment, so it may be some time.

-Rus.
