Raster graphics file formats. Computer Graphics Basics
Any digital photograph is essentially a software file that stores information about the image obtained by digitizing each of its points and how and when it was taken. The data structure of this information is called photo file format or in another photo file format.
There are many such formats, and they all belong to the graphic type. They differ in the information compression algorithm, specification and purpose. Each photo file format was designed for its own purposes and is better suited for them than others. For example, for storing images, processing or posting them on the Internet.
There is one way to obtain the original digital photograph. It is necessary to project a frame of a future photograph onto a matrix consisting of many light-sensitive photocells, measure the signal level of each of them and write all these values to the photograph file. This division of a photograph into individual points - pixels - is called a raster, and its file format is called raster (Fig. 1).
Fig.1 Any digital photograph consists of individual pixels, information about which is stored in a raster file.
You can make a raster format photo file using two main devices - a digital camera or. But at the same time, the number of formats in which photo files can be saved is limited. To obtain photo files of a different format, they must be converted in a special program (Fig. 2).
Fig.2 Methods for obtaining digital photo files in raster formats.
Changing the photo file format may be necessary for various reasons. For example, to reduce the size of photo files, to maintain maximum image quality, or to be able to work with layers. There are other reasons, but in any case, each photo file format should be used for its intended purpose.
Basic Photo File Formats
File names of digital photographs of any photo format as well as program files other types consist of a variable part, a point, and an extension. The extension of photo files is always the same and can consist of three or four characters, which determine the file type or format name. For example, jpeg, cr2, tiff, psd, gif (Fig. 3).
Fig.3 The file extension of a photo indicates its format.
JPEG is considered a universal format for digital photo files. This is the most popular raster format, which is used to save photos to different types photographic equipment. It is convenient to work with it in various photo editors and use it to view photos in all technical devices. Its main drawback is the loss of image quality when saving a file (Fig. 4).
Fig.4 Loss of image quality of a photo when saving its file in JPEG format.
In addition to the JPEG format, expensive photographic equipment often uses the RAW format. A file of this format stores the most full information about the image and all the camera settings with which it was taken. This gives enormous advantages when processing photographs and allows you to eliminate many photography errors (Fig. 5).
Fig.5 Using special program in photo files RAW format You can change the camera settings.
RAW format is common name several formats used in photographic equipment different manufacturers. Each such format has its own characteristics and is not unified. To bring everything existing formats RAW to a single standard, the DNG format was developed. Essentially this is the same RAW format, but its file size is smaller and there are no additional text files(Fig. 6).
Fig.6 Files of the same photo in RAW and DNG format have different sizes and methods for storing text information.
In cases where it is necessary to save the results of color processing, layers, channels, masks or any other photo editing attributes, the PSD format is used. This is the internal file format of the Photoshop program, in which all information about changes to photographs after photography should be saved (Fig. 7). The main disadvantage of this format is its limited application.
Fig.7 In files PSD format Conveniently store information about photo editing (example file).
The TIFF format is another file format used to store digital photographs. It allows you to maintain maximum image quality, but at the same time the size of such a file will be the largest in comparison with other listed formats (Fig. 8). In digital photography it is used for high-quality color work.
Fig.8 Comparison of file sizes of one photo saved in different photos formats.
The five photo file formats discussed above - JPG, RAW, DNG, PSD and TIFF are considered the main ones for storing, processing and viewing digital photos. But such formats are not suitable for effectively demonstrating photographs to the viewer. To do this, you need to choose other formats designed for this purpose.
File formats for displaying photos
The main purpose of all photographs is to show them to the viewer. Unlike paper photographs, many digital photographs can be displayed more accessible and interesting by using suitable file formats. For example, photographs can be animated and posted on the Internet, with music, text and various special effects applied to them.
Most convenient way showing photographs to a large number of viewers means posting them on the Internet - on photo sites, in social networks or (Fig.9). In this case, the format of the photo files should be such that their sizes are as small as possible and the image is of good quality. There are three suitable formats for this.
Fig.9 Example of placing digital photos in the cloud.
The main format for posting photographs on the Internet is the same JPEG, but with a high degree of information compression. It is ideal for this purpose. A photograph file in this format measuring 600 by 900 pixels can be compressed to 50 - 70 kb and the image will still look normal.
The second popular format that was created for fast transmission raster images over networks, is a GIF. This format allows you to significantly compress digital photo files without losing image quality. In addition, in this format you can save animation and transparency of the image layer (Fig. 10). The main disadvantage of the GIF format is its limitations in color reproduction.
Fig.10 GIF photo file with animation.
(hover over image)
For better color transmission on the Internet, it was developed PNG format. This format has a higher compression ratio without loss of quality graphic information unlike the JPEG format and can store an unlimited number of colors, unlike the GIF format. Additionally, PNG files can be used as an alternative format for photo editing.
Using all of the above formats, photo files can be stored and viewed individually. But there is another way. If the photos are combined and saved in video format, they will become one file. At the same time, you can make a beautiful slide show from them with music, text and special effects. Several formats are suitable for this purpose: MPEG4, MOV, AVI, WMV, FLV (Fig. 11). But this is not all formats.
Fig. 11 Example of a slide show of photographs in MPEG4 file format.
()
To store and view digital photos in one file, you can also use the most popular book format PDF. In this format, photographs can be stored in one photo album. This makes it possible to create for them interactive menu quick search or view photos as a slide show (Fig. 12).
Fig. 12 Example of storing digital photos in a PDF file.
()
That's probably all there is to it general overview formats for files in which to store digital photos. When selecting formats for specific purposes, you need to know more about them - features, advantages, disadvantages. Read more about each of these formats in the following articles.
Vector formatsFiles vector format especially useful for storage linear elements(lines and polygons), as well as elements that can be decomposed into simple geometric objects (for example, text). Vector files do not contain pixel values, but mathematical descriptions of image elements. By mathematical descriptions graphical shapes (lines, curves, splines) the visualization program builds an image.
Vector files are structurally simpler than most raster files, and are usually organized as data streams.
Examples of the most common vector formats are AutoCAD DXF and Microsoft SYLK.
WMF. This is a vector format that is used graphic programs Windows OS. This format is used to transmit vector images via clipboard in Windows environment. This format is accepted by almost all programs that work with vector graphics. This format cannot be used for raster images. Disadvantages: color distortion and failure to save a number of parameters that are set for images in graphics programs.
AI. Internal format Illustrator programs. Can open Photoshop program and besides, this format is supported by all programs related to vector graphics. This format is the best remedy when transferring vector images from one program to another. Raster graphic elements are lost in most cases when transmitted via AI format.
CDR. This is an internal format of the Corel Draw program. This format is very popular, as is the software package itself. Many programs can import vector files to Corel Draw formats. The CDR format also contains raster graphic objects. This format uses compression, and different compression is applied to vector and raster files.
Metafile formats
Metafiles can store both raster and vector data. The simplest metafiles resemble vector files; they contain the language or syntax for defining vector data elements, but may also include a raster representation of the image. Metafiles are often used to transport raster and vector data between hardware platforms, as well as to move images between software platforms.The most common metafile formats are WPG, Macintosh PICT and CGM.
IN hello seven. When publishing 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 raster image format.
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 the fact that its image files are not large size. GIF images, do not contain millions of colors, this indicator is no more than 256. In addition, 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 Web times 1.0, was shown in the form of numerous flashing images, rotating icons, and thereby greatly irritated many users. In the more civilized era of Web 2.0, we still notice beautiful animation"Loading..." while waiting for query results to refresh the page.
GIF also supports transparency, which is kind of boolean type 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 clarity, sharpness and quality are needed, so most digital cameras They 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 loss of 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 supports greater degree accuracy of color matching.
PNG (Portable Network Graphics) image format
This format was created specifically for the Internet to supplant the GIF format. The main advantage of the PNG format is that it 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:
- PNG usually produces a smaller file size;
- PNG supports variable transparency;
Flaws:
- 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:
- JPEG is the best format for photos.
- GIF is best format for animation.
- PNG8 - format for: icons, buttons, backgrounds, website graphics.
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've come across photos more than once poor quality. 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.
Note: Images come in the most different 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 paint 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. 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 publish a Paint image on a blog or social network, it must be a different type - gif, jpg or png.
GIF is a popular image format on the Internet. You can save images in it without losing quality, but with a limited number of colors - 256. GIF has gained particular popularity due to the fact that in this format you can create small animated (moving) pictures.
JPG - format of photographs and paintings with a large number flowers. 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 are very good quality, no compression. Accordingly, the size of such files is huge. TIFF is used when the quality is great value. 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.).
At all stages of creating a photo, you must choose a format for saving. Before the photo is released into the world, it is saved 4 times:
- at the time of shooting on the camera’s memory card;
- when converting from a memory card to a PC for editing;
- after editing to save on PC;
- to transmit photos to viewers - social networks, clients, photo stocks.
At each stage there are different requirements for the image, as a result there is a great variety of formats. For example, the photographer’s first task will be to take as much information as possible from the subject, that is, to preserve greatest number units of data. There should be a format with minimal compression and loss. At the last stage, especially for posting pictures on social networks and Instagram, the size and amount of information do not matter at all. The main thing here is the idea, colorfulness, execution, details. We need a format that compresses photographs to miniature frame sizes without losing clarity and quality. To store photos on a PC, you need powerful archivers, masters of their craft, who do not kill quality during compression.
Most often, everything starts with RAW, and the output images are saved in JPEG; at the moment, this option is the most popular. To decide on required formats, you must first find out which ones exist today and how they differ from each other. This will allow you to choose best option for every stage of your photos' life.
What are the graphic formats?
Today, there are dozens of different formats for photography, among them the popular and most frequently used:
- RAW– a common name for all cameras, denoting a “raw” file, unprocessed. Each manufacturer has its own name and extension for this format. The most popular today for filming.
- JPEG, JPG- the second most popular for saving frames during filming, the frame “weighs” less, without losing much in quality, but there will be difficulties with post-processing. The format deprives the photographer of the opportunity to correct the photo in many respects. It is used many times more often than others for storing and transmitting photographs.
- TIFF– a great option for saving large quantity information, compresses the frame almost without loss, but the picture still “weighs” quite a lot. For a long photo shoot you will need a lot of space and memory cards. The abbreviation stands for Tagged Image File Format; the format allows you to edit images in all respects.
- PNG– a format for storing and transmitting raster images without significant loss in quality. It was designed to expand the capabilities of the GIF format. PNG color depth is up to 48 bits; you can save only an object without a background. A great option for storing and editing photos.
- GIF compresses images well, but it is not suitable for working with large images or for editing images. A fairly simple format for transmitting raster images with a color depth of no more than 8 bits. GIF supports animation, such moving pictures are often called “gifs”.
- PDF A great option for storing a number of images in one file. Photo books, slides, and photographs from one photo shoot are saved in this format. Great helper for transferring offline images to electronic form. Developed by Adobe Systems to deliver images in original colors and without loss appearance. Not suitable for photographers, especially for working with large-sized images, and practically impossible to edit.
- PSD created by the program Adobe Photoshop and is an editable file consisting of layers with all applied effects, masks, and text. An excellent option for transferring and storing an image if its further processing is intended.
In addition to those listed, there are more than a dozen various formats, most often highly specialized, tailored for a specific task, not suitable for the work of a photographer.
Features of the JPEG format
The huge and main advantage of the JPEG format is its versatility - absolutely all editors and programs can read it. Saved pictures on the network or on a PC are no exception. This is the reason for its popularity; in 80% of cases, transfer of graphic data between users occurs using the JPEG format. Many photographers even use it for shooting when they need to significantly save time on saving one frame and space on the memory card. But JPEG also has significant disadvantages that force you to choose RAW or TIFF.
Pros of the JPEG format
The main task of the creators of the format was to compress images to the optimal level without loss of quality. Judging by the distribution of the jpeg image, they succeeded. What are the main advantages of the format:
- Pictures are ready for printing or transfer immediately after shooting; they can be directly displayed on a PC screen, sent to a printer without conversion and viewed on the screen in their real form;
- The “correct” colors will be displayed on the camera display, this is exactly how the picture looks for the matrix, imperfections can be changed during shooting;
- Manual camera settings will allow you to select parameters during shooting - white balance, noise reduction, sharpness, saturation and contrast;
- The “weight” of images is significantly less, sometimes even 2-3 times, than when saving in RAW or TIFF;
- After filming, you can open the file in almost any program for viewing or editing;
Disadvantages of the JPEG format
But without any disadvantages or inconveniences digital world impossible to get by. There are also significant disadvantages:
- Post-processing of images is impossible due to some parameters; if sharpness, noise or balance does not meet expectations, the photo will most likely go to waste;
- When saving a frame, some information is lost; the quality of the image in a large format will be noticeably poor;
- Many pictures will lose sharpness when switching from RAW to JPEG; if the parameter is important, then it is better to choose a different format.
JPEG significantly reduces post-processing capabilities, which is an important and significant point for a photographer. That's why many people shoot in RAW and save it in JPEG, but after editing. This procedure adds some difficulties, but brings excellent results.
Features of the RAW format
To clarify the terminology, RAW is not an extension, not a format, but a general name for formats that have one essence and goal - to save the maximum amount of information about each pixel. Each manufacturer named it differently. What are the advantages of this method of storing information:
- Saving additional information about each section of the image, if necessary, it can be pulled out and used for processing;
- Color correction options top level, in post-processing you can tighten the white balance, change the saturation or contrast of each color separately;
- Many editors allow you to save photo settings and apply them to multiple images;
- More opportunities for applying additional effects, stylization and artistic elements;
- High quality for large format printing, no dead pixels or data loss;
- Working with overexposed areas, editing shadows, darkened details, removing noise, increasing sharpness.
All the advantages of the RAW format are in the area of photo editing, which is very important for photographers, but not essential for ordinary people. Thus, we can highlight the disadvantages of the format:
- The most important inconvenience is the need to convert images; without this, you cannot even view the image in its normal form;
- The “weight” of each frame does not allow you to take thousands of photos quickly, and you will need a lot of space to store them;
- Converting images requires time and availability specialized programs, which significantly slows down the process of working with them.
All the shortcomings relate to the process of saving and using photographs, which is very inconvenient for “non-specialists”. Drawing a conclusion from the pros and cons, we can say that the RAW format is an option for professionals, for artistic processing and subsequent work with photographs.
To view photos at home or print them in 10x15 cm format, JPEG will be sufficient. The same applies to using photos on social networks, where using RAW will only create a number of inconveniences.
10 reasons to shoot in RAW
Summing up the pros and cons of the two main popular formats, we can conclude: if you are a photographer, then the RAW format is more of a necessity than a habit or whim. Some sources give several reasons to choose it:
![](https://i2.wp.com/top100photo.ru/uploads/%D0%BA%D0%B0%D0%BA%D0%BE%D0%BC%20%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B5%20%D1%81%D0%BD%D0%B8%D0%BC%D0%B0%D1%82%D1%8C/7_1.png)
Which format should you choose?
Comparing the main formats for saving graphic files, we can conclude that for different tasks you need to choose a separate format. Each has pros and cons, advantages and disadvantages.
- For filming and saving frames in the camera’s memory - definitely RAW is the best. But for time lapses or fast shutter clicks, it’s better to lose a little quality, but not miss the main thing; JPEG will “save” here.
For editing and design - PSD, RAW, TIFF to choose from, as you wish.
For storage on a PC – JPEG still confidently holds the palm, allowing you to compactly fold pictures without losing quality. The same goes for saving photos to social media accounts. JPEG format Enough is enough.
For data transfer - JPEG, again, and GIF. They compress the image to an acceptable size without significantly damaging the image.
In what format to shoot and store is a purely personal matter; no one can cancel habits, priorities, and personal preferences. To a true photographer and master incorrect formats will not interfere with creating a masterpiece.