Re: web-safe colours.

by Luke Opperman <luko(at)rocketmail.com>

 Date:  Wed, 16 Dec 1998 16:06:05 -0800 (PST)
 To:  Warrick <warrick_gray(at)rocketmail.com>,
hwg-graphics <hwg-graphics(at)hwg.org>
  todo: View Thread, Original
Warrick-

Let me see if I can help you:


> The more I get into making images for the web, the more
I get
> confused.  I think this comes from a fundamental confusion
> concerning web-safe colours.  My questions to you are:

Let me explain the purpose of the web-safe colors. As I
understand it, whenever an image is displayed (in any
program) as many of those colors as possible are allocated
by the system. With high color depth monitors, this is not
a problem as there are plenty of available colors to be
displayed. With 256 color displays, there are a very
limited number of color spaces available. Netscape decided
to create a default palette that it would try to display
(216 colors + ~40 system colors = 256). These are the
web-safe colors.

Rather than using this palette, in theory it would be
possible to instead optimize your palettes for all your
images on a page to a small number of colors, or one
global palette, so long as it is 216 colors of less.
 
> 1) What happens to colours in a GIF that are not in the
colour-cube?
>  Does a harmless midtone blue change to some sort of
green or does
> the pixel not show?  If these in-between colours are
dithered then
> why dither them first?  Surely it is better to allow
some people to
> see the higher quality work.

Knowing the above, you can see that a mid color will try
to be displayed. If the display is not capable of
displaying more colors, the non-mapped color will be
displayed as the closest color which has already been
allocated. it will be "dithered".

On a 256 color display, any image containing color
information beyond that which can be displayed will be
dithered. The purpose of any global palette (web-safe or
custom) is to specify what those colors will be as much as
possible.
 
> 2) Does JPEG's "need" to be dithered to a web-safe
palette?  I've
> heard that they don't.

Only in the sense that Jpegs contain color information for
16 Mil colors. they will still be limited by the same
issues as above.
 
> 3) My understanding of GIF's is that they contain some
sort of
> palatte index ( eg 1 = #ff6699, 2 = #ffffff, etc ) and
then some
> image data.  If JPEG's don't need to be dithered then
why do GIF's
> need to be - they both carry colour information (ie -
gifs don't
> really have to conform to some sort of standard palette)?

See above. Yes, they both contain palette information. And
yes, they both will be dithered to the "standard" palette
which the user's system is displaying at the time.
 
> One of my reasons for these questions is that when I
come to dither
> an image to 256/216 colours for saving as a GIF - I
achieve much
> greater quality when using adaptive-dithering rather
than web-colour
> dithering.  In many cases an image made of 64 adaptive
colours is of
> a much greater quality than one of 216 web colours - and
it is
> smaller! 

By reducing to 64 colors, an image will always be smaller
than a 256 color image. And using an apdaptive pallette
allows the gradients between colors to be smoother, as the
only colors which are stored in the palette are ones that
are part of the image. For instance, an image which is a
transition between blue and orange. with an adaptive
palette, all the colors will be a transition between those
colors. Where as with the web palette you are limited to
those colors which are part of the web-safe cube, and all
the extra colors which are part of that are included.
 
> PS - is there some benefit of dithering first to one
type of palatte
> and then to another, or do you get the same results?
> 
> Thanks in advance, Warrick.
> 

Good luck in understanding my ramblings,

Luke


===

                - ( luke opperman ) -
     Spigot Graphics, Cohesive Design for the Web
          - ( http://spigot.hypermart.net/ ) -  

-- ..some tiny cows, two brushstrokes each,
       but confidently cows.. - 'Poem' by Elizabeth Bishop




_________________________________________________________
DO YOU YAHOO!?
Get your free (at)yahoo.com address at http://mail.yahoo.com

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA