Here's the test <APPLET>
example we used earlier:
<APPLET CODE="Pixie.class" WIDTH=600 HEIGHT=300>
<PARAM NAME=Src VALUE="Eg.pxi">
</APPLET>
Here is what the various parts mean.
CODE="Pixie.class"
WIDTH=600 HEIGHT=300
NAME=Src VALUE="Eg.pxi"
For some pictures, the background color of the applet shows through behind the image. This happens when the picture is drawn with holes in it, so that it doesn't completely fill its rectangle. The viewer applet tries to match its background to the color of the page, but often doesn't succeed and the result can be an ugly rectangle around the image. You can fix this by forcing both the page background and the applet background to the same color, so that they blend in together.
To change the background color of the web page,
for example to white, add a BGCOLOR
attribute to its
<BODY>
tag:
<BODY BGCOLOR="#ffffff" TEXT="#000000">
This example also changes the text color to black, to avoid getting white text on a white background. You may want to change the link colors too. This is standard HTML, not part of Pixie, so you can consult your HTML reference for more information.
To change the background color of the viewer applet to white,
use a <PARAM>
like this:
<PARAM NAME=BGCOLOR VALUE="#ffffff">
This must go between the <APPLET>
and </APPLET>
tags.
Some pictures need more than 256 colors to look right, but you don't know in advance how many colors visitor's browsers support. But the Pixie applet does. Pixie lets you provide a second .PXI file which it will use if the browser has 256 colors or less. Only one of the two files will be downloaded.
You set this with another <PARAM>
tag:
<PARAM NAME=SRC VALUE="Eg.pxi">
<PARAM NAME=SRC8 VALUE="Eg8.pxi">
Again this must go between the <APPLET>
and </APPLET>
tags.
The "8" in "SRC8" means a
color depth of 8 bits per pixel.
When designing an 8-bit picture,
you should consider confining yourself to
the "browser safe" palette.
This is a palette of the 216 colors that most
browsers are most likely to be able to display correctly.
See Which Color Palette? for more information.
Non-Java browsers
The Pixie viewer is a Java applet.
Not all browsers support Java,
and in those that do, users sometimes turn it off.
Fortunately the HTML standard is designed to degrade gracefully.
You can put normal HTML between the <APPLET>
and </APPLET>
tags,
and it will be used if the browser does not have Java enabled.
You could, for example, include an <IMG>
tag with a .GIF
version of the Pixie image, as a fallback for people with old browsers,
or who turn Java off for security reasons.
It will only be downloaded if it's needed.
Many people can't see images - blind people, obviously, but also normal people with slow Internet connections may turn graphics off. Search engines in particular, rarely index pictures. Generally, then, you should make sure that the important information of a Pixie image is also available as normal HTML text. This means you might have:
All for the same information.
Best Viewed With Any Browser is a good starting point for information on why such fallbacks are a good idea and how to implement them.
Here is a complete example, which combines all of the points discussed in this section.
<BODY BGCOLOR="#ffffff" TEXT="#000000">
<APPLET CODE="Pixie.class" WIDTH=600 HEIGHT=300>
<PARAM NAME=SRC VALUE="Eg.pxi">
<PARAM NAME=SRC8 VALUE="Eg8.pxi">
<PARAM NAME=BGCOLOR VALUE="#ffffff">
<IMG SRC="Eg.gif" WIDTH=600 HEIGHT=300
ALT="PIXIE - Tiny pictures for the web">
To see this Pixie example, you need a Java-capable browser with
Java turned on.
</APPLET>
</BODY>
Note the ALT text in the <IMG> tag.