In order to view images on the internet, the graphics must be in one of two formats, GIF and JPEG. These two formats can be created using a graphics program like Photoshop. I will be explaining the difference between the two and when to use what.
GIF stands for Graphics Interchange Format and is in a lossless format. This means the graphics program which produces it simply squashes the original image down and does not care if any data is lost. When the compression happens, the program looks for similar colors and compresses them into a single color. Thus the maximum compression for a GIF depends on the amount of repetition in the image. For example, a picture with two colors will compress well, whereas pictures with many colors will not.
A drawback of the GIF format is the number of colors available for compression. The GIF palette only contains 256 colors or less. This makes GIF less favorite for images with many colors. A good example of a lousy compression would be with photographs. Pictures contain many colors and the GIF compression format will not make the image appealing.
JPEG, which stands for Joint Photographic Experts Group, on the other hand is a lossy compressio method. In other words, it saves space by throwing away parts of an image. The JPEG algorithm works in the following way. It first divides the image into squares. Then it uses a piece of mathematics called Discrete Cosine Transformation to turn the square of daya into a set of curves that make up the image. Next is where the lossy bit comes in. Depending on how much you want to compress the image, the algorithm will throw away the least significant part. Thus, you can instruct the program to cmopress the image by a desired amount. However, the lossy compression method can generate unwanted effects such as false color and blockiness.