Better 8-bit QuickTime color

From Higher Intellect Wiki
Jump to: navigation, search

From: AvramD@aol.com
Date: Sat, 02 Jul 94 16:22:35 EDT
Subject: copy of better-8bit-qt-color.txt for archives

Here you go Igor... Thanks!
----------------------
If you've seen some really beautiful 16 or 24 bit quicktime moovs on someone
else's expensive Mac, and you've seen really beautiful GIF images on your own
piddling 8 bit Mac (256 colors), and you whish you could get the quality of
the later when viewing the former (and you don't mind run-on sentences), then
you've come to the right posting!

This is a simple trick that anyone can do to improve the color of quicktime
moovs on a mac that can only display 256 simultaneous colors. It doesn't
always work, and sometimes it makes them look much worse. But there are lots
of moovs out there that it does help, and hey - it's free!

Background (experienced graphics people can skip this): 

Color Macs can actually display over 16 million colors. The trouble is that
due to memory limitations, many Macs can only display 256 of these at one
time. The reason that GIFs look so good even if you only have 256 colors is
that they come with a custom color palate. This means that they can contain
any 256 colors from the full palate, not just the standard 256 system colors.
You may notice that when you display a nice GIF, things in the background
like your desktop pattern and some of your icons will have messed up colors.
Lots of really nice pictures only have a few hundred colors in them just by
chance. For example, if you had a picture of a six pack of Coke cans, you
would need many shades of red and grey, but if your background was just
white, you might not need anything else. Thus, it would be possible for the
Coke cans to appear with the same quality in 256 colors as they would in 16
million color mode.

The problem with quicktime:

Lots of quicktime movies don't need more than a few hundred colors to look
perfect. As with GIFs, you ought to be able to get these movies to look
nearly top quality even with only 256 colors, simply by using a custom color
palate. Ideally, if you changed the palate with every frame, you would be
able to get qt moovs to look as good as GIFs. Unfortunately, that's too much
work, and qt would be unusably slow. So, Apple just uses the standard 256
color palate, and picks the best matches it can.

The theory:

If you have a quicktime moov that over the course of its life doesn't use
more than a few hundred colors, you should be able to pick a color palate
that is customized for the colors that the moov as a whole uses. Then the
moov would look much better than it did under the standard 256 system colors.
It would be much closer to it's ideal 24 bit appearance, especially if the
colors the moov uses are very different from the standard palate (which is
usually the case).

The method:

Well, you CAN pick a custom palate to display quicktime moovs! And thanks to
readily available tools, a wonderful operating system, and a system
limitation 8-), it's very easy. Most graphics applications that can display
GIFs (e.g. GifConverter, available at Sumex) will customize the color palate
according to whatever image they are currently displaying. All you need to do
is get a picture that has a color palate that is appropirate for the movie,
display it in the graphics program, then simultaneously play the movie.

But where can you get a picture with a good color palate? Every frame in the
moov you are viewing can be used as such a picture. Most qt moovs are stored
in 24 bit color, regardless of the system that they will be viewed on. When
you copy a frame from the moov to the clipboard (just fast forward to the
frame, go to Edit, and select Copy),  MoviePlayer copies the picture in 24
bit color even if it is displaying it in only 8 bit color. You can then paste
it into a graphics application, and most apps will customize the color palate
on the spot to give you the best 256 colors for displaying that picture.

Ok, the procedure:

(I'll use GifConverter as the example graphics app)
1. Open the moov.
2. Open GifConverter.
3. Find a frame in the moov that is a good sample of what colors the moov
needs.
4. Copy it to the clipboard.
5. In GifConverter, select New from the File menu
6. Paste the frame into the new GifConverter document. (GifConverter will
adjust the color palate).
7. Switch directly to MoviePlayer and watch the moov (don't go through the
finder).
-- The moov will be shown with the current color palate instead of the
standard one.

When you switch directly from the graphics app to MoviePlayer, the system
doesn't reinstall the standard color palate (that's the application's
responsability, and MoviePlayer doesn't bother). If you switch to the finder,
it may try to readjust the palate. Just go back to the graphics app, and then
make the switch directly (e.g. by clicking on the moov window).

The limitations:

Some moovs have drastic scene changes with very different sets of colors. If
this happens, you probably won't be able to get a frame that represents both
equally. The result is that the unrepresented scene will look much worse than
if you just played the moov straight. Other moovs just plain have too many
colors, and will look equally awful.

Side notes:

This only helps with the color related problem of 8 bit quicktime. The other
main issue is speed: The algorithm to display graphics in 16 bit or 24 bit
mode is much simpler because the system doesn't have to decide which color is
closest to the requested color. Theoretically, there should be no change in
speed between the standard palate and a custom palate. In practice, it may be
that the system is optimized for working with the standard palate, or it may
be that it is easier to work with an optimized palate. I couldn't tell either
way.

Have fun, and feel free to send questions or comments!

-Avram

Disclaimers:
1) Yes, I know that GIF's aren't the only images that take advantage of
custom palates
2) I omitted all discussion of dithering for the sake of simplification
3) I can't imagine any way that anyone could cause any harm by doing this,
but if you come up with one, it's not my fault.

See Also



Share your opinion