POV-Ray : Newsgroups : povray.general : keyring background : Re: keyring background Server Time
6 Aug 2024 19:30:48 EDT (-0400)
  Re: keyring background  
From: Sir Charles W  Shults III
Date: 18 Mar 2002 20:46:17
Message: <3c969869$1@news.povray.org>
When compressing to 8 bit, you gain in two respects- one is that you
have a far smaller palette to work with, so you spend about one third of the
space right off the bat.  But another thing happens as well- smaller
"distances" between colors mean that you will have better image compression
ratios.  Take JPG compression for instance.
    If you are familiar with the first term of palette reduction, you can
see that you could create a small table that represents some basic set of
colors and that table might be far smaller than 256 colors in some images.
You might get by with a mere 50 to 70 base colors.  6 bits might be
sufficient to adequately describe your color subset.
    Then, you create the "templates" that a DCT (discrete cosine transform)
might use to describe how an 8x8 cell of the image might be recreated using
some small number of those colors, using three templates that get overlaid
to describe the RGB components.  There are not many such templates used,
thus resulting in a further compression.
    Overall, JPG is lossy exactly because the data is not perfectly
recreated; it is "derived" from some basic selection of colors and then DCT
templates are used to approximate what they looked like.  Other schemes such
as run length encoding are done it other systems.  GIF is a perfect example.
When you go to a small number of colors and then specify that 61 dots
following this one will all be color 46 from the palette, you can see some
immediate benefits right there.
    Of course, each image format has its advantages and disadvantages, and a
truly universal image compression routines would analyze an image and select
the one that gave best compression and lowest loss and then recommend that
file format for your final image.  There's a useful tool to write.

Cheers!

Chip Shults
My robotics, space and CGI web page - http://home.cfl.rr.com/aichip


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.