Fundamentals of computer graphics. Basic Photo File Formats


IN hello seven. When publishing a new article, the question often arises: what format should I use images in the article? In order to achieve the best result, you should select a format bitmap.
In this article, we will briefly discuss the popular GIF and the JPEG format, and then analyze the PNG format, and dispel some misconceptions about the use of certain formats.

GIF (Graphics Interchange Format) image format

Most color images and backgrounds on the Internet are GIF files. This compact format is known for its image files small size. GIF images, do not contain millions of colors, this figure is no more than 256. In addition, the GIF format supports animation, that is, using this format, you can do .

The GIF format has its own palette index. It contains a color palette index, up to 256, and for each pixel in the image, it has a corresponding color index. If you change the image and save it as a GIF, the image quality will not be lost.

As I already said, the GIF format supports animation, which, in the days of Web 1.0, was shown in the form of numerous blinking images, rotating icons, and thereby greatly irritated many users. In the more civilized era of Web 2.0, we still notice the beautiful "Loading..." animation while waiting for the query results to refresh the page.

GIF also supports transparency, which is a kind of logical type of transparency. A pixel in an image can be either completely transparent or completely opaque.

JPEG (Joint Photographic Experts Group) image format

JPEG has no limit of 256 colors. It can contain millions of colors, which is why it has high compression. This makes it suitable for photographs where high definition, sharpness and quality, which is why most digital cameras work in JPEG format.

This format is lossy, meaning you will lose quality with each new edit, so if you plan to make a lot of edits, it is better to use a different format to store intermediate results. However, there are some operations that can be performed without losing quality. Such as stretching the image, rotating it on an axis, or changing meta information such as comments that are stored in the image file.

JPEG does not support transparency.

When optimizing an image in this format, to obtain best results set compression to 50%. JPEG compresses the photo-quality graphics and color depth of more competing formats such as GIF, and also maintains a greater degree of color matching accuracy.

PNG (Portable Network Graphics) image format

This format was created specifically for the Internet to supplant the GIF format. Main advantage PNG format- supports 24-bit color and transparency.

PNG is lossless and comes in several forms, but for practical purposes it is used in only two ways:

2. PNG24 (full color)

PNG8, like GIF, has an image palette.

Let's compare the PNG8 format with GIF:

Advantages:

  1. PNG usually produces a smaller file size;
  2. PNG supports variable transparency;

Flaws:

  1. There is no animation;

The second type of PNG, full-color PNG, can contain millions of colors, just like JPEGs. You may sometimes see names like PNG24 or PNG32.

PNG-24 combines the features of JPEG and GIF: it supports 24-bit color, retains transparency, and is therefore good for halftones. The image size is usually larger than JPEG. This makes the full-color PNG format ideal for applications where file size is not an issue, such as screenshots or graphical tutorials.

Let's draw a conclusion on the use of formats:
  1. JPEG is the best format for photos.
  2. GIF is the best format for animation.
  3. PNG8 - format for: icons, buttons, backgrounds, website graphics.

Greetings friends! In our lives, we constantly come across images, when photographing, creating a website, scanning, printing. Which image format is better you ask.

The quality of the image and the convenience of its further editing depend on the format in which the file is saved.

With the development of computers and the Internet, new formats for recording images in files appeared. Each format has its own advantages and disadvantages.

In this article, I decided to try to figure out which image format is better and talk about the most common graphic formats - JPEG, TIFF, PNG, and GIF.

Which image format is better?

JPEG format

Digital cameras and web pages usually use JPEG files - its algorithm compresses data very well and the resulting file is small. However, JPEG uses a lossy compression algorithm, which can be a major disadvantage.

Not big size JPEG file comes at the expense of image quality. The compression level can be set in the settings of graphics programs - lower quality smaller file images and vice versa, the higher the quality, the larger the file size.

JPEG is almost the only format that uses lossy compression, allowing small files lower quality. There is a lossless compression mode - lossless JPEG.

This format used in cases where small file size is more important than maximum image quality (e-mail, transfer on memory cards, etc.). JPEG format good enough for most cases, as long as you don't overdo it with compression.

Always remember that repeated editing of a JPEG file degrades the quality of the image and artifacts appear, so I recommend that you always save the original images, which can be compressed later.

TIFF format

The lossless format used for raster images is considered the best format for commercial work. It is used for scanning, in printing for high-quality printing, text recognition, and faxing. TIFF files are significantly larger in size than their JPEG counterparts and can be written uncompressed or with lossless compression.

The TIFF format allows you to save several layers, which is very convenient for further editing, and, unlike JPEG, it can have a bit depth of 8 or 16 per channel. TIFF is the most versatile and is typically used to store original images that can later be edited. But keep in mind that browsers do not display TIFF files.

GIF format

This format was developed by CompuServe in 1987 for the first 8-bit computer video cards and was intended for transmission over a dial up (modem) connection. At one time it was the most common format on the Internet. GIF uses lossless compression LZW, and compresses images very well that have a lot of uniform fills (banners, tables, logos, diagrams).

We are not happy with the color depth of this format, only 8 bits (256 colors maximum) and it is not recommended to use it for storing photographs (photos have a 24-bit color depth).

This format supports image animation, which is expressed in the change of static pictures after a certain period of time, which can be specified. Animation can be made cyclical, which is successfully used in the production of banners and avatars.

PNG format

It was created relatively recently to replace the outdated GIF (browsers show both formats), and to some extent the more complex TIFF format. PNG is raster format uses lossless compression, does not support animation and can have a 48-bit color depth.

One of the advantages of this format is that you can specify the level of transparency for each point, which allows you to smooth transitions from a clear image into the background. The main application is Internet use and graphics editing.

File types depending on the purpose of use:

Photographic images Graphics, logos
Properties Photos 24-bit color and 8-bit b/w Graphics with many solid colors, few colors (up to 256 colors), text or lines
Best quality TIFF or PNG (lossless compression) PNG or TIFF (lossless compression)
Smallest file size High Quality JPEG TIFF or GIF or PNG (graphics/logos without gradients)
Compatibility
(PC, Mac, Unix)
TIFF or JPEG TIFF or GIF
Worst choice GIF 256 colors (very limited color, and file size larger than 24-bit JPEG) JPEG compression adds artifacts, blurs text and line edges

Results

Which image format is better and how to choose a file type depending on the area of ​​use.

Modern digital cameras, starting with advanced models, offer the user a choice of several file formats in which photographs can be recorded on a memory card. Most often these are JPEG and RAW formats, sometimes TIFF format is added to them. In this article I will talk about the features of these three formats and help you decide on the choice of format for shooting. To understand how a particular format is formed in a camera, let's briefly look at the main stages of image formation, from exposing the matrix to recording the finished result on a memory card.

Light hitting the matrix changes the value electric charge element (which will later become an image pixel). The charge values ​​from all elements of the matrix are recorded and digitized by an analog-to-digital converter, and then encoded into special format, which received the general name RAW (from the English “raw”). Strictly speaking, this is not a format, but the name of many formats of raw data from the camera sensor. Each manufacturer has its own data format, so when a new camera model is released, programs for processing RAW files cannot open an image until an update is released that includes file format information for new cameras.

The data set is then processed by the camera's computer. In this case, white balance, brightness, contrast are corrected, noise is removed, sharpness is increased, and color depth is reduced to 8 bits. That is, the camera does everything for us, according to its own algorithm, without taking into account the individual characteristics of the image. Part of the initial information embedded in RAW format, is lost during such conversions, but there is no significant deterioration in quality, since a lossless compression algorithm is used. Some camera models allow you to record the image to a memory card after this processing stage. This will be in TIFF format.

Next, the image information is compressed. In this case, a lossy compression algorithm is used, that is, an irreversible deterioration in image quality occurs. Such a file will take up significantly less space, but it will contain only 30-40% of the original information recorded by the camera sensor.

Now more about each format, its advantages and disadvantages

JPEG format.

The most common image format is JPEG (Joint Photografic Experts Group - a group of photography experts who developed this encoding algorithm). It allows you to receive images good quality with a small file size.

Advantages of the format: small file size, high compatibility with all devices (images can be viewed on any computer or mobile device), full support for all Internet browsers.

Disadvantages of the format: caused by the use of a lossy compression algorithm. At high degree compression, the file size decreases, but the image quality deteriorates significantly, and blocky compression artifacts appear.

It is not advisable to re-edit and save an image in JPEG format, since each re-saving is a new compression of the image with corresponding losses. If you need to continue working on the image, save it in TIFF or PSD format. These formats use lossless data compression algorithms, so there is no deterioration in quality when resaving multiple times.

TIFF format

TIFF (Tagged Image File Format) is also a common image format. It uses lossless compression algorithms and can also store data without compression. TIFF files are significantly larger in volume than JPEG files. Since compression occurs losslessly or not at all, this format provides more high quality images and is often used for high-quality preparation of images for printing, especially in large formats.

Advantages of the format: high image quality, use of lossless data compression

Disadvantages of the format: very large volume of files, 8-10 times larger than JPEG images. If 16-bit color depth is used, the file size is doubled.

RAW format

A RAW file, as we have already said, is data from a camera sensor, digitized by a processor and “packed” using a special algorithm into a format standardized by the camera manufacturer and compressed losslessly, without any processing. At the same time, the RAW format takes up significantly less space than TIFF, but more than JPEG, and contains 10 - 16 bit data, depending on the camera model.

In general, all digital cameras shoot in RAW format, even the simplest compact ones. It's just that not all cameras have this format available to the user. In cases where the camera supports shooting in RAW format, it must be accompanied by software, which allows you to make basic corrections in this format and convert it to others, for example, JPEG and TIFF.


A file in RAW format cannot be damaged by inept processing - it is not directly edited and always remains unchanged. All processing is recorded in a small instruction file, which is used by the program to read information about processing and visualize what is extracted from RAW file images taking into account the applied adjustments. In addition, the RAW format allows you to edit many parameters with minimal loss of quality, such as correcting white balance, restoring seemingly lost detail in light or dark areas, correcting optical distortions, and much more. To better demonstrate the benefits of the RAW format, I recorded a short video in which I show the restoration of blown-out areas of the image.

Advantages of the RAW format: the widest possibilities for editing images with minimal loss of quality, the inability to spoil original file inept processing.

Disadvantages of the RAW format: large file size required special programs for viewing and editing.

What format should I shoot in?

The choice of image format for shooting depends on many factors. Many novice photographers make a big mistake by shooting only in RAW format, ignoring the JPEG format as defective. Indeed, in cases where the situation allows, it is best to use the RAW format. But in reportage or sports photography, for example, neglecting the JPEG format can cost you missed amazing shots. The thing is that the RAW format requires a large buffer memory in the camera, as well as a fast processor. When shooting a long series in RAW format, even fast cards memory - the camera buffer will still fill up and the camera will not be able to shoot until it is freed. This time takes about a few seconds, quite enough to miss a good shot. In this case, the JPEG format will allow you not to limit yourself and shoot as long a series of frames as you like. In studio or staged photography, or in any situation where fast continuous shooting is not required, it is better to use the RAW format.

It is not advisable to use the TIFF format for shooting - it takes up a lot of space on the memory card, and less data is recorded in it than in the RAW format.

Photographs and pictures differ from each other not only in content, but also in other “computer” characteristics. For example, by size.

It happens that there seem to be two identical drawings, but one is three times larger than the other.

The images also differ in quality. I think you have seen photos of extremely poor quality more than once. This is visible to the naked eye. For example, two identical photos, but one is of better quality, and the other is of worse quality.

And it happens that the drawing seems to lack colors. Here's an example.

And the file format or type is responsible for all this.

On a note . Images come in a variety of formats. And there are very, very many of them. We will not consider them all, but will talk about the most common ones: bmp, gif, jpg (jpeg), png, tiff.

Image formats differ from each other primarily in quality. And the quality differs in the number (saturation) of colors.

For example, I'm drawing a picture using different colors. And then suddenly some of them are over, and you have to finish painting with what you have. Of course, I will try to do everything possible so that this does not greatly affect the result, but still the picture will not turn out the way you want - more faded, blurry.

That's how it is with image formats. Some leave all the colors, while others cut off some. And sometimes this causes the picture to deteriorate.

This is a rough example - in fact, everything is somewhat more complicated there. But I think you get the point.

Common image formats

BMP is a format for drawings made in the Paint program. It can be used to store drawn pictures on your computer. But on the Internet this type is not suitable due to the large volume. So if you want to post picture Paint on a blog or social network, it must be of a different type - gif, jpg or png.

GIF- popular format pictures on the Internet. You can save images in it without losing quality, but with limited quantity colors - 256. GIF has gained particular popularity due to the fact that in this format you can create small animated (moving) pictures.

JPG is a format for photographs and paintings with a large number of colors. You can save an image in it both without loss of quality and with loss.

PNG is a modern picture format. This type of image is small in size and without loss of quality. Very convenient: the file is small and the quality is good. It also supports transparency.

TIFF - images of very good quality, without compression. Accordingly, the size of such files is huge. TIFF is used when the quality is great importance. For example, when creating business cards, booklets, magazine covers.

Which format to choose

  • BMP - if this is a drawing made in Paint program, and you're only going to keep it on your computer.
  • GIF - if it is an animation or drawing with a small number of colors for publication on the Internet.
  • PNG - if this is a picture that has a lot of colors or some transparent parts.
  • JPG (jpeg) - if a photograph.
  • TIFF - image for printing (business cards, booklets, posters, etc.).

Today we will talk about image formats, their features and distinctive features. Many of us know that images have different formats, but not everyone understands why there are so many of them and what their distinctive features are.

Any image stored on a computer has its own graphic format. Each of the graphic formats has its own properties and purpose. Today there is great amount graphic formats. We will consider most of the graphic formats based on one of the most popular graphic Adobe editors Photoshop. Why Photoshop, it's simple, this graphic editor has the largest number formats.

But in addition, we will try to examine others widely known formats Images.

So let's get started:

PSD- This own format programs Adobe Photoshop, it allows you to save all the work done on the image. Namely, transparency, layer blending modes, shadows, layers, layer masks and all the other little things done with the image. This format is usually used if the image is not completely finished. It is also often used to develop a website layout, since layout is done with this file conveniently seeing all layers and elements. And in all other cases there is no point in using it, since it has a significantly large file size compared to other formats.

TIFF– allows you to save the prepared Photoshop project as accurately as possible. It contains not only pixel information, but also the density of pixels per image when printed in dpi. It can also store several image layers plus channel transparency information. This format was used mainly in printing.

BMP- This is a dot pattern. An image in this format consists of a mass of dots, each of which contains its own color. This format is very large and can be easily compressed by archivers. The quality loss in BMP is not significant, however, it is inferior to TIFF.

JPEG is the most widely used format. It has received widespread use in digital technology(cameras). The reason for such widespread use is that it is quite poor quality And small size file. But the small size means that image quality is significantly lost. It's all about the image compression algorithm; it consists in the fact that, when compressed, the image significantly loses accuracy. For these reasons, it is not advisable to use this format in printing. But the advantage is that it is convenient to send them by email ( e-mail), post it on the Internet and store it on disk.

GIF– Primarily used to produce graphics for the Internet. It is not suitable for saving photographs, as it has a limitation in color reproduction; for the same reasons, it is not suitable for printing. The image of this graphic format consists of dots, which can include from 2 to 256 colors. Limited color rendering and support for transparency make it indispensable for storing images with minimal colors, such as logos. Another feature of the format is the ability to produce animated images. Widely used for creating gifs(animated) banners.

EPS– can be called the most reliable and universal format. It is mainly intended for transmission to publishing houses; the format can be created and used by almost all graphic editors. It makes the most sense to use this format only if the output is on a PostScript device.

This format is unique; it supports everything necessary for printing, it can record data in RGB, clipping paths, as well as the use of fonts and more. EPS was originally developed as vector format, and later a raster version of it appeared - Photoshop EPS.

PNG is a graphic format that recently replaced the Gif format, and has already become very popular due to the fact that it can maintain transparency and translucency, which was not possible in its predecessor GIF. This means that the png maintains translucency in the range from 1 to 99% using an alpha channel with 256 levels of gray. Transparency works as follows: gamma correction information is written to the file. Gamma correction is certain number brightness and contrast of the monitor. This number is subsequently read from the file and allows you to adjust the image display by adjusting the brightness.

PICT is a proprietary Macintosh format. The format is capable of including both raster and vector information, text, as well as sound, and uses RLE compression. Bitwise PICT images can have absolutely any bit depth. Vector PICT images, which have all but disappeared from use these days, had unusual line thickness problems and other variations during printing.

The format is used for Macintosh, and when creating certain presentations only for Mac. On regular computers(not Mac) PICT – format is presented with the extension .pic or .pct, read certain programs, working with this format is often not easy.

PDF– the format was proposed and developed by Adobe as a format for electronic documentation, various presentations and layout for sending it by e-mail. And its design feature was to provide a compact format. For these reasons, all data in pdf can be compressed, and the peculiarity of it is that different types of compression are applied to different types of information, more suitable for these types of data: JPEG, RLE, CCITT, ZIP.

PCX– raster image format. pcx files use a standard color palette, this format has been extended to store 24-bit images. This format is hardware dependent. Designed to store information in a file in the same form as in the video card. To combine this format with older programs, support for the EGA mode of the video controller is required. The compression algorithm is fast and takes up a small amount of memory, but is not very efficient and is not suitable for compressing photographs and detailed computer graphics.

ICO– This format is designed for storing file icons. ico files can be any size, but the most commonly used icons are those with sides of 16, 32 and 48 pixels. Icons with sizes of 24, 40, 60, 72, 92, 108, 128, 256 pixels are also used. Icon data is usually not compressed. Icons come in True Color, High Color, or with a clearly fixed palette. By its structure ICO files closest to BMP format, but differ from bmp in the presence of a mask applied to the background using the bitwise “AND” operation, which makes it possible to implement transparency.

Exclusive OR overlaying the main image can even invert pixels where the background was not masked. And already with Windows XP, 32-bit icons began to be supported - each pixel corresponds to 24-bit color plus an 8-bit alpha channel, which allows for partial transparency of 256 levels. Using the alpha channel, it is also possible to display an icon with smooth edges and also with a shadow, combined with different backgrounds, the icon mask is ignored in this case.

CDR is a vector format image or drawing created using CorelDRAW. This format was developed by Corel for use in its own software products companies. CDR images are not supported by many graphics editors. But this is not a problem, the file can be easily exported using the same CorelDRAW to more common image formats. Images created in CorelDRAW with the CDR extension can also be opened in Corel Paint Shop Pro. For best compatibility, Corel recommends saving files in CorelDRAW CDR format for more than early version. CDR files tenth and earlier versions, can be opened using the program Adobe Illustrator.

A.I. is a vector image format, the name of which comes from the abbreviation of the name vector editor AdobeIllustrator. Supported by almost everyone graphic programs that are in any way related to vector graphics. Ai is one of the best middlemen for transferring an image from one editor to another. Distinctive and very important feature format is its greatest stability and compatibility with PostScript, which is of great value for publishing houses of printing products.

RAW– this is a data format containing raw information (or processed to a minimal extent), created directly by incoming information from the matrix of a camera (video camera, etc.). This format denotes not only photo data, but also the original audio or video data. This format stores all information about the file and has greater potential for processing photographs than JPG format. RAW preserves the highest possible quality. Data in RAW files can be uncompressed, losslessly compressed, or lossily compressed.

RAW files from a number of camera manufacturers have their own extension format, such as Canon - CR2, Nikon - NEF. Many others have the DNG format offered by Adobe, these are companies such as Leica, Hasselblad, Samsung, Pentax, Ricoh. If it is not available in Photoshop raw camera for your camera, the files will not open; it was created for these purposes by Adobe.

SVG– scalable format vector graphics(Scalable Vector Graphics). The format was created by W3C. In accordance with the specification, it was created to describe two-dimensional vector and mixed vector raster graphics in XML. Includes three types of objects: shapes, images, and text. Supports still, animated and interactive graphics. You can create and edit as in text editors by editing the code, or in any graphic editor for vector graphics (Adobe Illustrator, Inkscape, CorelDRAW, Corel SVG Viewer). SVG is open standard is not anyone's property.

Some of the advantages of the SVG format include: Scalability without loss of image quality. Text in SVG is text, not an image, so it can be selected, copied, and is indexed by search engines (when used on a website). The interactivity of the graphics makes it possible to attach your own events to each of the elements. Availability of using raster graphics within a document. Animation that is implemented in SVG using the SMIL language. Compatible with CSS, it allows you to set object properties such as color, background, transparency, etc. SVG easily integrates with HTML and XHTML documents. Reducing quantity HTTP requests. Small file weight compared to raster graphics.







2024 gtavrl.ru.