Tips about different image formats
Tips about different image formats
There are many formats for saving images on the computer, but only a few formats are usable on the web. Each of these formats has its own characteristics and as a web designer, you should choose the most appropriate format in different situations.
Different image formats
As for images, there are two types of compression:
Lossy: In this type of compression, whenever we want to decompress the compressed image, we will not reach the quality of the original image; However, this distinction may not be clear from a distance and you may think that the photo was not of good quality. This image compression method is suitable for use in web pages. Images that are compressed in this way, even though they require very little memory, have a suitable quality for publishing on the Internet.
Lossless: An image that uses this type of compression, whenever it is decompressed, will have exactly the same quality as the original image. In this type of compression, images require more memory, so they are not suitable for use on the Internet.
· JPEG format
JPEG is the name of a format for storing images and .jpg is an extension of this format. This format uses Lossy type and when compressing it, you can fully control the amount of image compression. This format is suitable for storing images in which millions of colors are used, such as photos taken by a camera or images that use many color ranges or gradients.
· GIF format
Gif is a bitmap format. This means that the image consists of a table with pixels in the square houses of the table. Then the information about each pixel is stored separately. You can store 256 colors in this structure and pixels can be transparent. Therefore, this format is lossless because the information of the pixels is always saved and can be retrieved. The gif format can have several data storage tables; Therefore, it can display an animation by storing the information of different frames.
Since image editing programs can have full control over the exact number of colors stored in this format, this format is suitable for storing images with a low color count such as charts, buttons, small icons, and images containing text Is.
· PNG format
Since the gif image format was a non-free, copyrighted format, the free PNG format was created to improve the properties of the gif. PNG image format has a wider color range than GIF. The PNG structure has the ability to store transparent pixels in a compressed form, and the ability to compress this format is more than GIF.
The PNG format is very suitable for storing images that have transparent parts and a large number of colors at the same time. Because this image format uses a lossy structure, it often doesn't scale down well enough for the web. But if the image size is small and transparent areas are needed, this format can be used. Like buttons with rounded corners.