GIF (Graphic Interchange Format), JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphics) are the three major formats of graphic images that are available on the net. Our previous article Web Graphics will give you detailed information in these formats. It is essential to understand the pros and cons of all these formats before choosing the right one for your image. The size of the resulting image file is the only factor that has to be considered while choosing the right format. Moreover it is also necessary to understand how to optimize the image file without hampering the image properties.
Image optimization refers to adjusting the compression settings such that the image is made as small as possible with very little loss of resolution. It is important to optimize the images as they take too much time to up load. If a website takes longer time to upload they end up loosing their site visitors.
Optimizing the GIF image:
GIF images consist of maximum 256 colours as each pixel is represented by a single 8-bit byte. Each GIF image has a description that defines colours used in the image. This description also known as header assigns the colours to particular codes which then appear in the image.
Example: “yellow is colour #58”. In the image the colours can be represented as “colour #58 is used for the next 546 pixels”.
Hence optimizing the GIF image is very simple and can be done by using almost all the graphics program available like Paint Shop Pro etc.
Optimizing the JPEG image:
JPEG image consists of 16 million colours, but when a JPEG image is compressed it throws away pixels i.e. JPEG images become blurred when the optimization rate is high.
Example: Consider a photograph of 1024 pixels wide. When this photograph is compressed, it throws away 10% of the pixels. When the image is decompressed these pixels values are extrapolated from the colours of the surrounding pixels. Due to this the JPEG image becomes blurry.
JPEG formats are much preferred for photographs and art works as they have soft edges.
Optimizing the PNG image:
PNG image consists of 16 million colours and it does not throw away the pixels when compressed. Most of the graphic editors that support PNG handle the image compression. GIF is great for drawing lines and shapes with sharp edges and not more than 256 colours.
There are certain rules to be followed before you can optimize your images.
- Find the best available format for your applications.
- Know the optimization functions of your graphics program.
- Use different settings to save the images and observe the difference closely i.e. find the right setting, the smallest possible file size with the least change in the quality of the image quality and use it. This setting will be different for every single image.
Optimizing of the images is necessary for fast download of the website. Faster download of the website more will be the site traffic.
This article has been compiled by the content development team at Pegasus InfoCorp which pulls subject matter specialists from different work domains. They can be contacted through the Pegasus InfoCorp website at info@pegasusinfocorp.com. Pegasus InfoCorp is an India based web design, web development and online/ offline software development company. Please visit http://www.pegasusinfocorp.com to read more articles and know more about us!
Other companies and organizations are welcome to reprint this article
on their websites provided the following conditions are met.