Standardising a Colour Palette

Standardising a Colour Palette

Post by Warren Woo » Sat, 24 Aug 1996 04:00:00



Please help!

        In producing graphics for a WWW page, I understand that using a
standardised 256 colour palette helps decrease the file size of the
images used.  What I don't understand is whether it is equally important
to ensure that the same palette be used for all of the images within
your site/page?  How does this design consideration link with the
relevance of the user's standard display colour palette?

        If it turns out that the same 256 colours should be used within the
entire site/page, what utility programs will convert images of different
source types (eg. cdr, pdf, tiff, bmp etc) to the same palette?  My
understanding of the HIJACK 95 program is that it will convert multiple
images to the same palette, but only when the original images are of the
same file type.  This leads to the situation where your GIFs and JPEGs
may all be of 8-bit per pixel colour, but not using the same 256 colours
(perhaps this isn't important anyway?).

        Apologies for the simple nature of this request for assistance, however
after two weeks of late night research, I can't find the answer to these
basic design questions.  Thanks in advance.

        Warren Wood

 
 
 

Standardising a Colour Palette

Post by Victor Eng » Sun, 25 Aug 1996 04:00:00



>Please help!
>    In producing graphics for a WWW page, I understand that using a
>standardised 256 colour palette helps decrease the file size of the
>images used.

I don't think I can agree with this statement as written. Currently,
there are two widely used graphics formats for the WWW: Jpeg and GIf.
The Gif is an 8 bit format, which, for all practical purposes means
you are limited to 256 colors for an image (although, see
http://www.cafe.net/peda/iag/ for information on using GIF for more
that 256 colors using a clever technique that is not universally
supported). Jpeg is a 24 bit lossy format providing compression by
defining areas of the picture that can be described by a mathematical
forumula. For images to be displayed in the GIF format, you are forced
into 256 colors. For Jpeg, you definitely should not reduce color
depth.

Quote:> What I don't understand is whether it is equally important
>to ensure that the same palette be used for all of the images within
>your site/page?  How does this design consideration link with the
>relevance of the user's standard display colour palette?

This is a frequently recommended technique and one based upon an
assumption: that the browser will allocate colors to its effective
palette on a first come first served basis. While it is true that some
browsers do use this technique, the majority do not, preferring
instead to use a generic palette for all images.

Quote:>    If it turns out that the same 256 colours should be used within the
>entire site/page, what utility programs will convert images of different
>source types (eg. cdr, pdf, tiff, bmp etc) to the same palette?  My
>understanding of the HIJACK 95 program is that it will convert multiple
>images to the same palette, but only when the original images are of the
>same file type.  This leads to the situation where your GIFs and JPEGs
>may all be of 8-bit per pixel colour, but not using the same 256 colours
>(perhaps this isn't important anyway?).

Again, Jpeg is a 24 bit per pixel format. There is no such thing as an
8 bit per pixel Jpeg unless you are talking about a greyscale image.

Quote:>    Apologies for the simple nature of this request for assistance, however
>after two weeks of late night research, I can't find the answer to these
>basic design questions.  Thanks in advance.

For more information about this and related topics, you may want to
view my links of related pages at http://the-light.com/netlinks.html.

-----------------------------------------------------------
Victor Engel                                   Vector Angle

http://the-light.com         http://www.onr.com/user/lights

 
 
 

Standardising a Colour Palette

Post by Ross Smit » Wed, 28 Aug 1996 04:00:00



> Please help!

>         In producing graphics for a WWW page, I understand that using a
> standardised 256 colour palette helps decrease the file size of the
> images used.  What I don't understand is whether it is equally important
> to ensure that the same palette be used for all of the images within
> your site/page?  How does this design consideration link with the
> relevance of the user's standard display colour palette?

The same palette should be used for all images on the same page.
Otherwise, users with 256-colour displays will see at least one of the
images badly dithered.

If you standardise your images to a 256-colour palette, it's best to
stick to a single standard palette for everything, rather than trying
to optimise it for individual pages. Netscape Navigator has a standard
256-colour (actually 216-colour) palette that it uses nearly all the
time when it's running on a 256-colour screen (the only time it uses
the image's own palette is when the image is being viewed alone, rather
than as part of a page).

In other words, if you place images in Web pages, and the person
viewing the pages is running a 256-colour screen, they'll see the
images in that standard palette anyway, whether you set them up that
way or not. So it's best to optimise the images for the standard
palette yourself before you save them, rather than letting browsers do
the job for you.

If the user is running a 16-bit or 24-bit screen, none of this applies,
of course -- they'll see whatever colours are in the image (or a close
approximation, in the case of 16-bit). If they're only running a 4-bit
(16-colour) screen, there's not much you can do about it -- almost any
image will be badly screwed up (presumably the user will be used to
this and won't blame you!).

Quote:>         If it turns out that the same 256 colours should be used within the
> entire site/page, what utility programs will convert images of different
> source types (eg. cdr, pdf, tiff, bmp etc) to the same palette?  My
> understanding of the HIJACK 95 program is that it will convert multiple
> images to the same palette, but only when the original images are of the
> same file type.  This leads to the situation where your GIFs and JPEGs
> may all be of 8-bit per pixel colour, but not using the same 256 colours
> (perhaps this isn't important anyway?).

If you're running any form of Windows, the best image conversion
program is JASC's Paint Shop Pro. It comes in 16-bit and 32-bit
versions, and can convert almost anything to almost anything else. You
can download it (shareware) from their Web site (http://www.jasc.com/).
(Disclaimer: I have no connection with JASC other than being a
satisfied customer.)

A particular advantage of PSP in this context is that it has a
built-in function to optimise an image to a standard 256-colour
palette (the same one Netscape uses).

All this applies only to GIFs. There's no such thing as an 8-bit JPEG
-- all JPEGs are 24-bit. For JPEGs you have no choice but to save them
in 24-bit colour and let the browser worry about the palette.

--

   "I have a natural revulsion to any operating system that shows so
   little planning as to have named all its commands after digestive
   noises (awk, grep, fsck, nroff)."    -- The Unix-Haters' Handbook

 
 
 

Standardising a Colour Palette

Post by Dav » Tue, 03 Sep 1996 04:00:00



>A particular advantage of PSP in this context is that it has a
>built-in function to optimise an image to a standard 256-colour
>palette (the same one Netscape uses).
>All this applies only to GIFs. There's no such thing as an 8-bit JPEG
>-- all JPEGs are 24-bit. For JPEGs you have no choice but to save them
>in 24-bit colour and let the browser worry about the palette.

Well, yes and no.  Although JPEGs are stored as 24-bit, that doesn't
mean you have no choice about number of colors used.  After all, if I
made a JPEG that was all black, it would only use one of the 16.7
million possible colors. :)

Paint Shop Pro has a "decrease color depth" tool, as you mention,
which can be used to map to an optimized or standard 256 color
palette.  If you use this on a JPEG you will still have only 256
colors, even though the file format supports more.

I would recommend that anyone producing graphics for the WWW try to
reduce their images to 256-color depth, as there are still a -lot- of
people out there running at 256 colors.  Use the standard palette if
possible.  Whether you choose to use GIF or JPEG format is a matter of
taste.  I prefer JPEG if only as a statement about the Unisys patent.

Dave

 
 
 

Standardising a Colour Palette

Post by Alan J. Flavel » Tue, 03 Sep 1996 04:00:00



> >All this applies only to GIFs. There's no such thing as an 8-bit JPEG
> >-- all JPEGs are 24-bit. For JPEGs you have no choice but to save them
> >in 24-bit colour and let the browser worry about the palette.

> Well, yes and no.  Although JPEGs are stored as 24-bit, that doesn't
> mean you have no choice about number of colors used.

If you would post this nonsense on the proper group, I think you'd soon
get someone to explain it to you. c.i.w.authoring.html gets quite enough
discussion about HTML already, without having to deal with people who
don't understand image formats.  Of course, if you would read the JPEG
FAQ first, you could have saved yourself the embarassment of posting
such stuff.

Quote:> Paint Shop Pro has a "decrease color depth" tool, as you mention,
> which can be used to map to an optimized or standard 256 color
> palette.  If you use this on a JPEG you will still have only 256
> colors, even though the file format supports more.

Sez you.  High time you read that FAQ...

Quote:> I would recommend that anyone producing graphics for the WWW try to
> reduce their images to 256-color depth, as there are still a -lot- of
> people out there running at 256 colors.  Use the standard palette if
> possible.

All the exact opposite of what one should do for best results with JPEG

Quote:>  Whether you choose to use GIF or JPEG format is a matter of
> taste.

Again, clearly refuted by the JPEG FAQ and by the materials at the
"bandwidth conservation society".  What other valuable insights have
you to offer us, then?

Quote:>  I prefer JPEG if only as a statement about the Unisys patent.

Gosh.  Now do tell us, why didn't you _read_ what you were quoting,
and then check up on why it was at variance with your preconceived
notions?  You might have learned something new, instead of making a
fool of yourself and risking misleading others.

best regards

"Only mediocrity can guarantee to be at its best all the time".

 
 
 

Standardising a Colour Palette

Post by Ross Smit » Thu, 05 Sep 1996 04:00:00




> >All this applies only to GIFs. There's no such thing as an 8-bit JPEG
> >-- all JPEGs are 24-bit. For JPEGs you have no choice but to save them
> >in 24-bit colour and let the browser worry about the palette.

> Well, yes and no.  Although JPEGs are stored as 24-bit, that doesn't
> mean you have no choice about number of colors used.  After all, if I
> made a JPEG that was all black, it would only use one of the 16.7
> million possible colors. :)

> Paint Shop Pro has a "decrease color depth" tool, as you mention,
> which can be used to map to an optimized or standard 256 color
> palette.  If you use this on a JPEG you will still have only 256
> colors, even though the file format supports more.

Actually, no, you won't. Remember that JPEG is a lossy format -- the
saved image doesn't exactly match the original. Colour information
gets "smeared out" in a different way to luminance information (JPEG
was designed to fit the way the human eye works, and our colour
resolution is less precise than our luminance resolution). The upshot
of all this is that the colours recorded in the file will be slightly
different to those in the original image.

You can easily check this with PSP or any other graphics tool that can
count the actual number of colours in an image. I started with an 8-bit
bitmap (according to PSP, "The number of unique colours in this image
is 237."), then saved it as a JPEG and reloaded it. Now it says "The
number of unique colours in this image is 79843."

--

   "I have a natural revulsion to any operating system that shows so
   little planning as to have named all its commands after digestive
   noises (awk, grep, fsck, nroff)."    -- The Unix-Haters' Handbook

 
 
 

Standardising a Colour Palette

Post by Tom La » Fri, 06 Sep 1996 04:00:00




>> Well, yes and no.  Although JPEGs are stored as 24-bit, that doesn't
>> mean you have no choice about number of colors used.
>> Paint Shop Pro has a "decrease color depth" tool, as you mention,
>> which can be used to map to an optimized or standard 256 color
>> palette.  If you use this on a JPEG you will still have only 256
>> colors, even though the file format supports more.
> Actually, no, you won't. Remember that JPEG is a lossy format -- the
> saved image doesn't exactly match the original.
> [ snip ]
> You can easily check this with PSP or any other graphics tool that can
> count the actual number of colours in an image. I started with an 8-bit
> bitmap (according to PSP, "The number of unique colours in this image
> is 237."), then saved it as a JPEG and reloaded it. Now it says "The
> number of unique colours in this image is 79843."

As the JPEG FAQ points out, the entire concept of number of colors is of
little use when dealing with JPEGs.  If Ross had repeated his experiment
with any other JPEG compressor and/or decompressor, he would likely have
gotten a different number of colors, because that result depends on
roundoff errors and other implementation details.  So you can't usefully
say that a JPEG file has *any* particular number of colors.

Dave's advice to pre-reduce the number of colors before saving as JPEG
is dead wrong: it will hurt image quality, it will not make life any
easier for the decompressor/viewer, and in most cases it will actually
make the JPEG file *larger* because of dithering noise.  For more info,
see the JPEG FAQ at
http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/top.html

                        regards, tom lane
                        organizer, Independent JPEG Group

 
 
 

Standardising a Colour Palette

Post by Claus Schott » Fri, 06 Sep 1996 04:00:00



> >A particular advantage of PSP in this context is that it has a
> >built-in function to optimise an image to a standard 256-colour
> >palette (the same one Netscape uses).

Stop dreaming about color selection on the WWW.
Netscape doesn't neccessarily use a "standard 256-colour palette".
E.g. my Netscape uses a 2-colour palette. Others use a max. of 64 or
227 colours.


 
 
 

Standardising a Colour Palette

Post by Victor Eng » Sat, 07 Sep 1996 04:00:00



>Stop dreaming about color selection on the WWW.
>Netscape doesn't neccessarily use a "standard 256-colour palette".
>E.g. my Netscape uses a 2-colour palette. Others use a max. of 64 or
>227 colours.

For the purposes of this message, let us refer to the standard palette
in Paint Shop Pro, the evenly distributed 6x6x6 color palette, or the
"browser-safe" palette as the BSP.

I'm not sure where you get 64 and 227, but it is true that Netscape
does not always use the same palette. I think we can discount your
2-colour palette. No amount of selecting any significant number of
colors is going to make a colourful image appear any better in your
situation. Everyone else fits in one of the following categories, from
the information I have been able to glean:

Windows 16 color -- does not use the BSP but does not dither colors
either, so this situation need not be considered for dithering.

Windows 256 color (8 bit) -- this is the platform the BSP is most
useful for.

Mac 8 bit -- Netscape uses the BSP supplemented with additional
colors.

X-Windows -- Usually uses a 125 color 5x5x5 color palette, dithering
images saved with the BSP pretty badly. Sometimes a different palette
is used with the same results.

Windows 15 or 16 bit -- colors are not dithered.

Mac 15 or 16 bit -- I haver received one report of images saved with
the BSP dithering. I believe this is not the most common situation,
however, or I probably would have heard of other reports of the same
problem.

All systems at True Color -- There is no dithering.

These are the setups I am familiar with. Any others are rarefied
enough not to matter significantly.

Of all these scenarios, only X Windows at 8 bit and Macs at 15 or 16
bit show dithering of images saved with the BSP. All the rest show
images that display either as well or better than the unadjusted
image. If you don't specifically apply the 5x5x5 color cube to the
image, X Windows will probably dither equally poorly before and after
applying the BSP, so we can discount it as well. A similar argument
can be made for Macs at 15 or 16 bit.

OK. That takes care of Netscape. What about the other browsers? Well,
Internet Explorer uses the BSP at 8 bit. So do many other browsers.
Those that do not tend to allocate colors as they are encountered. If
the BSP is used, all images will appear clearly.

The bottom line is that applying the BSP vastly improves the display
for Windows and Macs at 8 bit without adversely affecting the display
on other platforms. Therefore, using the BSP has tremendous use.

All that being said, it is not appropriate for use with photographic
images and other images containing continuous gradations of color.
These are better represented in the JPEG format.

For further information on this subject with example images, go to
http://the-light.com/netcol.html

-----------------------------------------------------------
Victor Engel                                   Vector Angle

http://the-light.com         http://www.onr.com/user/lights

 
 
 

Standardising a Colour Palette

Post by Alan J. Flavel » Sat, 07 Sep 1996 04:00:00



> I think we can discount your
> 2-colour palette.

In the same way that tv shows are unviewable by owners of b/w TVs?

Some mistake, surely??

Are you unaware that many laptops have b/w displays?

Nobody expects b/w displays to show colours.  But if they don't show the
information at all - or even if they just fail to display the anchors
that lead to other pages - then you have seriously crippled your
information, in ways far more serious than the mere cosmetic faults in
the colour display of the platforms that you went on to analyze in
exceedingly fine detail (and which I have calmly omitted, sorry).

Might I remind you that this is the WWW _HTML_ authoring group.  Many
people use b/w displays for reading text.  I was trying to help a
colleague only this morning who was unable to read the important parts
of a WWW page on his b/w display because the idiot author had used
different coloured texts against a coloured background and had contrived
to make them all the same intensity.  If you go to the trouble of making
your text unreadable in b/w, and/or convert that text into images that
are themselves unreadable in b/w, you do yourself and your readers a
great disservice. Your topic would be an interesting one for
c.i.w.a.images, I suggest, but it would still be nice if b/w readers
could see _something_ in your images.

p.s I use a colour display myself.  I'm not doing this out of self
interest, but out of consideration for WWW readers as a whole.

--

best regards

 
 
 

Standardising a Colour Palette

Post by Jack Berli » Sat, 07 Sep 1996 04:00:00




> > I think we can discount your
> > 2-colour palette.

> In the same way that tv shows are unviewable by owners of b/w TVs?

> Some mistake, surely??

> Are you unaware that many laptops have b/w displays?

> Nobody expects b/w displays to show colours.  But if they don't show the
> information at all - or even if they just fail to display the anchors
> that lead to other pages - then you have seriously crippled your
> information, in ways far more serious than the mere cosmetic faults in
> the colour display of the platforms that you went on to analyze in
> exceedingly fine detail (and which I have calmly omitted, sorry).

> Might I remind you that this is the WWW _HTML_ authoring group.  Many
> people use b/w displays for reading text.  I was trying to help a
> colleague only this morning who was unable to read the important parts
> of a WWW page on his b/w display because the idiot author had used
> different coloured texts against a coloured background and had contrived
> to make them all the same intensity.  If you go to the trouble of making
> your text unreadable in b/w, and/or convert that text into images that
> are themselves unreadable in b/w, you do yourself and your readers a
> great disservice. Your topic would be an interesting one for
> c.i.w.a.images, I suggest, but it would still be nice if b/w readers
> could see _something_ in your images.

> p.s I use a colour display myself.  I'm not doing this out of self
> interest, but out of consideration for WWW readers as a whole.

> --

> best regards

Hello-
In the interest of the www readers, do not confuse a B&W display with a
binary palette.  People misuse the term B&W to mean greyscale, and PC's
show shades of grey, 64 I think.  That is different than a true B&W
device, such as a fax machine or most laser printers, which only have
two shades.  They provide shading through half-toning, or mixing white
and black dots in different concentrations to give the impression of
grey.
BTW, it is quite easy to view color images in greyscale by, what else,
scaling to grey.
Regards,
jack
--
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jack Berlin         Pegasus Imaging Corporation
           the BETTER JPEG people!
    813-875-7575 x303    Fax 813-875-7705
               http://www.jpg.com
***************************************************