The two most common graphics formats on the Web are GIF and JPG. GIF was the first graphics format supported on the Web and some earlier browsers only supported GIFs. It is common for most browsers to also support the JPG format. In General: Use GIF for images with areas of solid color or type. Use JPG for photographs and images with subtle gradients of many hues.
Please, whatever format you choose, dont turn GIF files into JPGs, or vice versa. The images will become full of digital junk. Also keep your original copy of the graphic separate from your final .GIF or .JPG to be used.
GIF
(Graphic Interchange Format) -- A common format for image files, especially suitable for images containing large areas of the same color. GIF format files of simple images are often smaller than the same file would be if stored in JPG format, but GIF format does not store photographic images as well as JPGs.
The GIF file format is an indexed color format that supports up to 256 (8-bit) colors, although a GIF image can contain as few as two colors. (The fewer colors used, the smaller the file size). Use your image editing software e.g., (Paint Shop Pro) to reduce the colors as much as possible while maintaining image integrity. Each color in your final image is represented in a palette containing a color look-up table (CLUT). When your computer reads a GIF image it assigns each screen pixel a color from the palettes CLUT.
When creating images for the Web its a good idea to make your palette conform to Netscapes 216 browser-safe colors. These colors are a simplified subset of the Macintosh 256-color system palette. The 40 missing colors are reserved for the Windows system title bars, scroll bars, icons, etc. Use this link to see a copy of the browser safe palette 216-Color Palette.
Do not feel obligated to use this palette at all times. Many times using an adaptive palette will work just fine for the majority of your readers. Web color theory is also explained quite well at The 256 Browser Safe Palette.
Since colors are assigned from a CLUT there are several features that GIF files offer:
Transparency: You can assign a color in a GIF image to be transparent. By doing this, you can make the white background of the GIF appear transparent and look great on your black or colored page.
Interlacing: When a GIF file is interlaced, the image will appear to scan in gradually on your visitor's screen. Visitors to your site may be able to use this feature for faster navigation. The downside to interlacing is a slight increase in file size and an overall longer finished display time.
Dithering: Dithering is a technique for making an image appear to have more colors in its palette than it actually does. It mixes the pixels with varying colors already present in your image to make areas appear blended. Dithering also increases your file size. If you have solid areas of color and sharp color edges (as with text) you shouldn't need to dither. If you do need to dither, question whether you shouldn't save the image as a JPG instead.
Animation: The GIF format allows the embedding of multiple images within one GIF file to create an animation sequence. You should download the shareware, GIF CONSTRUCTION SET an animation program for your computer. This software package is relatively easy to learn and use.
There is no way you can be sure that the person viewing your page has a computer capable of displaying more than 256 colors (in addition to other display considerations). Although the great majority of computers sold in the last several years have the capacity for displaying thousands or millions of colors many people do not realize this and go merrily along with their displays set at 256.
JPG
(Joint Photographic Experts Group) -- JPEG is most commonly mentioned as a format for image files. JPEG format is preferred to the GIF format for photographic images as opposed to line art or simple logo art.
JPG is a losey compression method, which means that some information is lost in the compression scheme. It can compress very detailed images 10x or 20x to 1 without noticeable loss (GIF commonly compresses 3x or 5x to 1.) Complex images created in 24-bit color can be saved to the JPG format and then be posted to Web Pages where they can be downloaded relatively quickly.
You should never resize a JPG image to a higher resolution because you will be asking your imaging software to create color information which simply does not exist. Your results will not be acceptable.
NOTE: This could be used to your advantage. If you wish to display original artwork on the Web but have concerns regarding your copyright use a small image size. This combined with the .JPG compression will limit the options and information for any would be copyright offender.
JPEG images can contain over 32 million different colors. Because they refer directly to the full spectrum of color, color palettes are not required to achieve accurate color. If they are displayed on a computer system set to 8-bit (256 colors) color depth or less, dithering occurs, causing sometimes-undesirable results. Plus, JPG's lousy compression scheme makes further editing risky.