Vector formats. Graphic file formats Data formats when saving information

Graphics file format(graphic format) is a collection of information about an image and a method for recording it in a file.

Graphics data tends to be large and require a lot of disk space. In this regard, most graphic formats use various methods of compression (compression) of information.

In general, all graphic formats can be divided into two groups:

1. Universal (general purpose formats)- contain only the image itself and are used to store graphic data and exchange it between various programs. They are generally accepted standards and are supported by almost all image preparation and processing programs.

2. Specialized (graphics editor formats)- contain information specific to each graphic file (for example, Corel Draw files contain information about curves, Photoshop files contain information about layers, channels, etc.) and are intended for storing images and intermediate results of their editing. These formats take into account the specific features and capabilities of a particular program, and therefore cannot be correctly recognized and processed by other programs.

Examples of universal graphic formats include the following:

GIF(Graphics Interchange Format) - designed for storing raster images with a high degree of compression; supports transparency and animation (was created for the Internet).

JPEG/JPG(Joint Photographic Experts Group) - allows you to store images of fairly high quality and relatively small size (uses various degrees of compression, balancing on the line between quality and volume).

PNG(Portable Network Graphics) - designed for transmitting raster images over networks (intended to replace GIF).

TIFF/TIF(Tagged Image File Format) - allows you to save raster images without loss of quality (does not use compression, so files in this format are large). Most often used when importing raster graphics into vector programs and publishing systems.

BMP(Windows Device Independent Bitmap) - created by Microsoft and used to store bitmap images intended for use in Windows. Although this format can use compression, most programs do not.

EPS(Encapsulated PostScript) - can be used to record both raster and vector graphics. In addition, this format allows you to write a vector outline that will limit the raster image (you can get a photo that is not rectangular, but round, oval or any other shape).

As an example of specialized graphic formats, we can cite the formats of the following popular programs:

PSD- Adobe Photoshop format - provides storage of full-color images with all their features, channels, masks, various layers, vector shapes, contours, effects, etc., characteristic, known and understandable only to this program. Recently it has become supported by some other programs.

CDR- CorelDRAW program format. Many other programs can import it.

A.I.- Adobe Illustrator program format. Opens directly in Photoshop and is also supported by almost all Macintosh and Windows programs.

CPT- Corel Photo-Paint format - provides storage of full-color images and vector objects. Not recognized by other programs.

SWF- vector format of the Macromedia Flash program for animation on the Internet.

Knowledge of file formats and their capabilities is one of the key factors in pre-press preparation of publications, preparation of images for the web and in computer graphics in general.

Yes, today there is no such kaleidoscope of extensions as in the early 90s, when every image editor company considered it its duty to create its own file type, or even more than one, but this does not mean that “everything needs to be saved in TIFF, but compress with JPEG".

Each of the formats established today has undergone natural selection and has proven its viability and necessity. They all have some characteristic features and capabilities that make them indispensable in their work.

Knowledge of the features and subtleties of technology is important for a modern designer, just as it is necessary for an artist to understand the differences in the chemical composition of paints, the properties of soils, types of metals and types of wood.

The main purpose of Knowledge, by and large, is to expand a person’s capabilities, to increase the degree of his freedom, when a person acts as he sees fit, and not as his circumstances force him to do.

Formats:

GIF | JPEG | PNG | TIFF | PostScript | EPS | PDF | Scitex CT | Adobe Photoshop Document | Adobe Illustrator Document | Macromedia FreeHand Document | CorelDRAW Document | PICT |WMF | BMP | RTF

Compression methods:

LZW | JPEG | Huffman | CCITT | RLE (Run Length)

All graphic data in a computer can be divided into two large branches: raster and vector. Vectors are a mathematical description of objects relative to the origin. Simply put, for the computer to draw a straight line, the coordinates of two points are needed, which are connected along the shortest path, the radius is specified for the arc, etc.

Thus, a vector illustration is a set of geometric primitives. Most vector formats can also contain raster objects embedded in the file or a link to a raster file (OPI technology).

The difficulty in transferring data from one vector format to another lies in the use of different algorithms by programs, different mathematics when constructing vector objects and describing raster objects.

OPI (Open Prepress Interface) is a technology developed by Aldus that allows you to import not original files, but their images, creating in the program only a low-resolution copy (sketch) and a link to the original. During the printing process, the sketches are replaced with the original files. Using OPI, instead of simple embedding, makes it possible to save computer resources (primarily memory), significantly increasing its performance. OPI is the primary tool for working with imported graphics files in programs such as FreeHand and QuarkXPress, and is widely used in other products.

A raster file is simpler (to understand, at least). It is a rectangular matrix (bitmap), divided into small squares - pixels (pixel - picture element). Raster files can be divided into two types: those intended for display and for printing.

The resolution of files in such formats as GIF, JPEG, BMP depends on the computer's video system. In old Macs, there were 72 pixels per square inch of screen (screen resolution); on Windows, there was no single standard, but today the most commonly used value is 96 pixels per square inch of screen. In reality, however, these parameters have now become quite arbitrary, since almost all video systems of modern computers allow you to change the number of pixels displayed on the screen.

Raster formats intended exclusively for display have screen resolution only, meaning one pixel in the file corresponds to one screen pixel. They are also printed in screen resolution.

Raster files intended for pre-press preparation of publications have, like most vector formats, the Print Size parameter - the printed size. Associated with it is the concept of print resolution, which is the ratio of the number of pixels per square inch of a page (ppi, pixels per inch or dpi - dots per inch - the term is not entirely correct, but is often used).

Print resolution can be from 130 dpi (for a newspaper) to 300 (high-quality printing), almost never needed anymore.

Raster formats also differ from each other in their ability to carry additional information: various color models, vectors, Alpha channels or spot color channels, layers of various types, leading (interlaced loading), animation, compression capabilities and more.

GIF (CompuServe Graphics Interchange Format)

The hardware-independent GIF format was developed in 1987 (GIF87a) by CompuServe for transmitting raster images over networks. In 1989, the format was modified (GIF89a), support for transparency and animation was added. GIF uses LZW compression, which makes it possible to compress files with a lot of uniform fills (logos, inscriptions, diagrams) well.

The LZW (Lempel-Ziv-Welch) compression method was developed in 1978 by the Israelis Lempel and Ziv and later refined in the USA. Compresses data by searching for identical sequences (called phrases) throughout the file. The identified sequences are stored in a table and are assigned shorter markers (keys). So, if there are patterns of pink, orange, and green pixels in an image that repeat 50 times, LZW detects this, assigns a separate number to that set (for example, 7), and then stores that data 50 times as the number 7. The LZW method also , like RLE, performs better in areas of uniform, noise-free colors, it performs much better than RLE at compressing arbitrary graphics data, but the encoding and decompressing process is slower.

GIF allows you to record an image “through a line” (Interlaced), thanks to which, having only part of the file, you can see the entire image, but with a lower resolution. This is achieved by writing and then loading, first 1, 5, 10, etc. lines of pixels and stretching the data between them, the second pass is followed by 2, 6, 11 lines, the image resolution in the Internet browser increases. Thus, long before the file is downloaded, the user can understand what is inside and decide whether to wait until the entire file is downloaded. Interlaced notation slightly increases the file size, but this is usually justified by the acquired property.

In GIF you can set one or more colors to be transparent; they will become invisible in Internet browsers and some other programs. Transparency is provided by an additional Alpha channel saved with the file. In addition, a GIF file can contain not one, but several raster images, which browsers can load one after another with the frequency specified in the file. This is how the illusion of movement is achieved (GIF animation).

The main limitation of the GIF format is that a color image can only be recorded in 256 colors or less.

Read also:

  • D. Kirsanov "Inexhaustible GIF"
  • A. Lebedev "The simple secret of GIF"
  • A. Lebedev "The complex secret of GIF"

JPEG (Joint Photographic Experts Group)

Strictly speaking, JPEG is not a format, but a compression algorithm based not on searching for identical elements, as in RLE and LZW, but on the difference between pixels. Data encoding occurs in several stages. First, the graphics data is converted to a LAB color space, then half or three-quarters of the color information is discarded (depending on the implementation of the algorithm). Next, blocks of 8x8 pixels are analyzed.

For each block, a set of numbers is formed. The first few numbers represent the color of the block as a whole, while subsequent numbers reflect the subtle renderings. The range of details is based on human visual perception, so large details are more noticeable.

In the next step, depending on the quality level you choose, a certain portion of the numbers representing fine details are discarded. The final step uses Huffman coding to more efficiently compress the final data. Data recovery occurs in reverse order.

Thus, the higher the compression level, the more data is discarded, the lower the quality. Using JPEG you can get a file 1-500 times smaller than BMR! The format is hardware independent, fully supported on PC and Macintosh, but it is relatively new and is not understood by older programs (before 1995). JPEG does not support indexed color palettes. Initially, CMYK was not included in the format specifications; Adobe added support for color separation, but CMYK JPEG causes problems in many programs. The best solution is to use JPEG compression in Photoshop EPS files, which is described below.

There are JPEG subformats. Baseline Optimized - files are slightly better compressed, but are not readable by some programs. JPEG Baseline Optimized is designed specifically for the web and all major browsers support it. Progressive JPEG is also designed specifically for the Web, its files are smaller than standard ones, but slightly larger than Baseline Optimized. The main feature of Progressive JPEG is its support for analogue interlaced output.

From the above, the following conclusions can be drawn. JPEG compresses photographic-quality raster images better than logos or diagrams - they have more halftone transitions, and unwanted interference appears among monochromatic fills. Large images for the web or with high printed resolution (200-300 or more dpi) are compressed better and with less loss than with low resolution (72-150 dpi), because in each 8x8 pixel square, the transitions are softer, due to the fact that there are more of them (squares) in such files. It is undesirable to save any images with JPEG compression where all the nuances of color rendering (reproduction) are important, since color information is discarded during compression. Only the final version of the work should be saved in JPEG, because each resaving leads to more and more data losses (discarding) and turning the original image into a mess.

The LAB color space represents color in three channels: one channel dedicated to luminance values ​​(L - Lightnes) and the other two for color information (A and B). Color channels correspond to a scale, not to any one color. Channel A represents a continuous spectrum from green to red, while channel B represents a continuous spectrum from blue to yellow. The average values ​​for A and B correspond to real shades of gray.

There is a similar YCC color model used in Kodak Photo CD and FlashPix formats not covered here.

The Huffman compression method was developed in 1952 and is used as a component in a number of other compression schemes, such as LZW, Deflation, JPEG. The Huffman method takes a set of symbols and analyzes them to determine the frequency of each symbol. The most frequently occurring characters are then represented in the smallest possible number of bits. For example, the letter "e" is most often found in English texts. Using Huffman encoding you can represent "e" with just two bits (1 and 0), instead of the eight bits needed to represent the letter "e" in ASCII.

PNG (Portable Network Graphics)

PNG is a relatively recently developed format for the Web, designed to replace the outdated GIF. Uses Deflate lossless compression, similar to LZW (it was because of the patenting of the LZW algorithm in 1995 that PNG arose). Compressed indexed PNG files are usually smaller than similar GIF files, and PNG RGB is smaller than the corresponding TIFF file.

PNG files can have any color depth, up to 48 bits. Two-dimensional interlacing is used (not only rows, but also columns), which, just like in GIF, slightly increases the file size. Unlike GIF, where transparency is like honey - either it is there or not, PNG also supports translucent pixels due to the Alpha channel with 256 shades of gray.

The PNG file records gamma correction information. Gamma is a certain number that characterizes the dependence of the brightness of your monitor screen on the voltage on the electrodes of the kinescope. This number, read from the file, allows you to enter a brightness correction when displaying. It is needed so that the picture created on Mac looks the same on Windows and on various UNIXes. Thus, this feature helps to implement the main idea of ​​WWW - the same display of information regardless of the user's equipment.

PNG is supported in Microsoft Internet Explorer version 4 on Windows and version 4.5 on Macintosh. Netscape added PNG support to its browser in versions starting with 4.0.4 for both platforms. However, support for important format features such as seamless transparency and gamma correction has not yet been implemented.

Read also:
M. Tiguleev "P&NG"

TIFF (Tagged Image File Format)

The hardware-independent TIFF format appeared as an internal format of the Aldus PhotoStyler program. Its modular architecture turned out to be so successful that, having successfully survived the death of its native program, TIFF continues to improve and develop today.

Today it is one of the most widespread and reliable; it is supported by almost all programs on PC and Macintosh in one way or another related to graphics. Generally, TIFF is the best choice when importing raster graphics into vector programs and publishing systems. It has a full range of color models available from monochrome to RGB, CMYK and additional solid colors. TIFF may contain clipping paths, alpha channels, layers, and other additional data.

The exception, to some extent, is FreeHand. Sometimes TIFF files in it can randomly change their location when creating a PostScript file or directly in the document when opening it. More often than not, TIFFs “jump” while in the clipping path. With FreeHand, it is still preferable to use EPS.

TIFF can be saved in two recording orders: Macintosh and PC. This is because Motorola processors read and write numbers from left to right, while Intel processors read and write numbers the other way around. Modern programs can use both formats without problems.

In the TIFF format, it is possible to save using several types of compression: JPEG, ZIP, but, as a rule, only LZW compression is used. A number of older programs (eg QuarkXPress 3.x, Adobe Streamline, many text recognition programs) cannot read compressed TIFF files, but if you are using newer software there is no reason not to use compression.

Adobe PostScript

PostScript is a page description language (laser printer control language) from Adobe. It was created in the 80s to implement the WYSIWYG (What You See is What You Get) principle. Files of this format are a program with execution commands for an output device. They have the extension .ps or, less commonly, .prn and are obtained using the Print to File function of graphics programs when using a PostScript printer driver.

Such files contain the document itself (only what was located on the pages), all associated files (both raster and vector), the fonts used, as well as other information: color separation boards, additional boards, screen lineature and raster dot shape for each board and other data for the output device. If the file is created correctly, it does not matter what platform it was made on, whether True Type or Adobe Type 1 fonts were used - it makes no difference.

However, you need to take into account that even if you have made the correct settings in the print window, problems may arise due to the incorrect translation of the graphic language program you are using into the PostScript language (for example, the introduction of information about unused fonts). The most correct PS files are created by Adobe programs.

Data in a PostScript file is usually written in binary encoding. Binary code takes up half the space of ASCII. ASCII encoding is sometimes required for transferring files over networks, for cross-platform sharing, and for printing over serial cables. In these cases, the binary encoding may become corrupted (making the file unreadable) or cause "strange" behavior by the file server. These problems have long been eliminated in modern systems, but older computers and servers are susceptible to them.

The above applies to all PostScript-based formats: EPS and PDF, which are described below.

A more detailed description of the PostScript language, its features, problems and methods of printing from various programs can be found on my website in the article “Non-scary PostScript”.

EPS (Encapsulated PostScript)

The Encapsulated PostScript format can be called the most reliable and universal way to save data. It uses a simplified version of PostScript: it cannot contain more than one page in one file, and does not save a number of printer settings. Like PostScript print files, EPS records the final work, although programs such as Adobe Illustrator and Adobe Photoshop can use it as a working document.

EPS is designed for transferring vectors and rasters to publishing systems, and is created by almost all programs that work with graphics. It makes sense to use it only when the output is carried out on a PostScript device. EPS supports all color models necessary for printing, among them, such as Duotone, it can also record data in RGB, clipping path, trapping and raster information, embedded fonts. In EPS format, data is saved on the clipboard (Clipboard) of Adobe programs for exchange among themselves.

You can save a sketch (image header, preview) along with the file. This is a low-resolution copy in PICT, TIFF, JPEG or WMF format that is saved with the EPS file and allows you to see what's inside, since only Photoshop and Illustrator can open the file for editing. All others import the sketch, replacing it with original information when printed on a PostScript printer. On a printer that does not support PostScript, the sketch itself is printed. If you work on Photoshop for Mac, save thumbnails in JPEG format; other Mac programs save thumbnails in PICT format.

These and JPEG thumbnails cannot be used by Windows applications. If you're working on a PC or don't know where the file will be used, save the sketch in TIFF format (when given the choice). CorelDRAW also offers the vector format WMF for sketches, you should use this Microsoft brainchild very carefully - it will not lead to any good.

Initially, EPS was developed as a vector format, later its raster version appeared - Photoshop EPS. In addition to the thumbnail type (TIFF, PICT, JPEG), Photoshop allows you to choose the data encoding method. ASCII, Binary and JPEG. The first two were described above; JPEG is worth focusing on.

Photoshop allows you to compress raster data using the JPEG algorithm. Adobe has improved this compression method. Photoshop's JPEG now supports CMYK and compresses better than JPEG that fully complies with the original specifications. In other words, JPEG-encoded non-thumbnail EPS files weigh less than comparable JPEG files! However, I would like to draw your attention to an important feature when working with JPEG compression in EPS.

Printer and phototypesetting drivers cannot perform color separations on such files. That is, when performing color separation on your computer, the JPEG-compressed EPS image will appear entirely on the first board (Cyan, usually). However, in the service bureau, Scitex workstations (the majority of them in Israel) can color separate pages with JPEG EPS illustrations without any problems. I think systems from other companies also support JPEG EPS, in any case it’s worth asking. In service bureaus and printing houses in Tel Aviv, I was often recommended to use JPEG EPS instead of TIFF for recording raster data, since it is faster to output.

EPS has many varieties, depending on the creator program. The most reliable EPS are created by programs produced by Adobe Systems: Photoshop, Illustrator, InDesign. Since 1996, Adobe programs have a built-in PostScript interpreter so they can open and edit EPS. This opportunity seems to me very important. Other graphic editors cannot open EPS; moreover, the EPS files they create sometimes turn out to be, to put it mildly, special.

Among the most problematic are Quark EPS, created by the Save Page As EPS function, and FreeHand editable EPS, created by the Save As function. You should not particularly trust Corel EPS versions 6 and lower and EPS from CorelXARA. EPS files from CorelDRAW 7 and higher still have the problem of adding fields to the Bounding Box (a conditional rectangle in PostScript that describes all objects on the page).

Before exporting EPS files from CorelDRAW, CorelXARA and, to a lesser extent, FreeHand, it is worth converting many program effects (translucent fills, for example) into raster or simple vector objects. Thick outlines (more than 2 pt) may also make sense to be converted into objects when the program provides such an opportunity. You can check the EPS file with Adobe Illustrator, if it opens, then everything is in order.

PDF (Portable Document Format)

PDF is proposed by Adobe as a platform-independent format for creating electronic documentation, presentations, and transferring layouts and graphics over networks. Used as an internal graphics format in Mac OS X.

PDF files are created by converting from PostScript files or using the export function of a number of programs. Adobe Acrobat Distiller is used for conversion; this is the best way to create PDF. Creating PDFs using the export method from programs usually gives worse results - the files are heavier and often have problems with embedding fonts.

To create PDF, there is also a PDFWriter program that works as a virtual printer. PDFWriter is not PostScript based and cannot handle graphics correctly. It is designed for quickly producing simple text documents. It has the same problem with embedding fonts as many programs that can export PDF. The most reliable and closest to the original PDF is created from PostScript and EPS files by the Acrobat Distiller program, supplied in the Adobe Acrobat package.

PDF was originally designed as a compact electronic documentation format. Therefore, all data in it can be compressed, and different types of compression are applied to different types of information, the most suitable for them: JPEG, RLE, CCITT, ZIP (similar to LZW and also known as Deflate). The Acrobat Exchange 3 program (which in version 4 became simply called Acrobat 4.0) allows you to create hyperlinks, fill in fields, include video and sound in a PDF file, and other actions.

The CCITT (International Telegraph and Telephone Committie) compression method was developed for facsimile transmission and reception. It is a narrower version of Huffman coding. CCITT Group 3 is identical to the fax message format, CCITT Group 4 is the fax format, but without special control information.

The PDF file can be optimized. Repeating elements are removed from it, a page-by-page order is established for loading pages via the web, with priority first for text, then graphics, and finally fonts. However, when there are no duplicate elements, the file, after optimization, usually increases slightly.

PDF is increasingly being used to transmit graphics and layout over networks in a compact form. It can retain all the output device information that was in the original PostScript file. This applies to PDF versions 1.2 (Acrobat 3) and higher. However, version 1.2 cannot include trapping information, some other specific data (DSC, for example), and does not use color profiles. All this is implemented in subsequent versions of the format.

You can find a more detailed description of technologies based on Adobe Acrobat PDF on my website in the article Man-Orchestra 3.0.

Scitex CT

A PostScript file intended for output goes through a number of stages on its way to the phototypesetting machine. The most important of these is rasterization - the process of converting PostScript data into a bitmap, performed by the PostScript interpreter (RIP).

CorelDRAW format files can be used to transfer/transfer works to a PC, but it is not advisable to import them into layout programs. On a Macintosh, CorelDRAW for Windows files open with the Macintosh version of CorelDRAW and Adobe Illustrator 8 or later.

PICT (Macintosh QuickDraw Picture Format)

PICT is a native Mac OS Classic format. Standard for the clipboard, uses the Mac OS graphical language. PICT is capable of carrying raster, vector information, text and sound, and uses RLE compression. Supported on Mac by all programs. Pure bitmap PICT files can have any bit depth (from Lineart to CMYK).

Vector PICT files, which have all but disappeared from use these days, had strange problems with line thickness and other printing variations.

The format is used for the needs of Mac OS, and when creating certain types of presentations only for Macintosh. Outside the Macintosh, PICT has a .pic or .pct extension and can be read by separate programs, but working with it is rarely simple and straightforward.

WMF (Windows Metafile)

The WMF vector format uses the Windows graphic language and can be said to be its native format. Used to transfer vectors via the clipboard. Understood by almost all Windows programs that are somehow related to vector graphics.

However, despite its apparent simplicity and versatility, the WMF format should be used only as a last resort for transmitting bare vectors. WMF distorts color, cannot save a number of parameters that can be assigned to objects in various vector editors, cannot contain raster objects, and is not understood by many Macintosh programs.

BMP (Windows Device Independent Bitmap)

Another native Windows format. It is supported by all graphic editors running this operating system. It is used to store bitmap images intended for use in Windows and, in fact, is not suitable for anything else.

Capable of storing both indexed (up to 256 colors) and RGB colors (more than 16 million shades). It is possible to use compression based on the RLE principle, but this is not recommended, since many programs do not understand such files (they may have the .rle extension). There is a version of the BMP format for the OS/2 operating system.

Using BMP for purposes other than Windows is a common mistake for newbies. It is important to understand that it is not advisable to use BMP either on the web, or for printing (especially), or for simply transferring and storing information.

RTF (Microsoft Rich Text Format)

The RTF text format came here for its extraordinary ability to transfer texts from one program to another. It allows you to transfer formatted text from optical character recognition programs or text editors to graphics programs or in any other direction. RTF can be a good solution (and sometimes the only solution) when transferring non-Latin, for example, Hebrew text or Russian in Windows 95/98 Hebrew Edition from program to program.

The secret to compatibility is the use of special RTF and Unicode formatting tags. It is Unicode (used as the basis of the Microsoft Word 97/98 format for Macintosh and PC) that allows you to easily transfer Russian texts from PC to Mac and back in MS Word 97/98 files (true for higher versions of Word).

RTF is used as the main one in the TextEdit editor that comes with Mac OS X and in the WordPad program that comes with Windows.

File formats are the basis of working with digital photographs. will tell you about all the major graphic file formats.

RAW.

A file format containing raw information coming directly from the camera sensor. These files are not processed by the camera's processor (unlike JPG) and contain original shooting information. RAW can be compressed without losing quality.

The advantages of RAW are obvious - unlike JPG, which was processed in the camera and already saved with data compression - RAW gives the widest possibilities for processing photographs and maintains maximum quality.

The note. Different camera manufacturers use different algorithms to create RAW in their cameras. Each manufacturer comes up with its own resolution for its RAW file - NEF - Nikon, CR2 - Canon...

JPEG (aka JPG).

This is the most common graphics file format.

JPG has earned its popularity due to its flexible data compression capabilities. If necessary, the image can be saved with maximum quality. Or compress it to the minimum file size for transmission over the network.

JPG uses a lossy compression algorithm. What does this give us? An obvious disadvantage of such a system is the loss of image quality every time a file is saved. On the other hand, image compression simplifies data transfer by 10 times.

In practice, saving a photo with minimal compression does not result in any visible degradation in image quality. That is why JPG is the most common and popular format for storing graphic files.

TIFF.

The TIFF format is very popular for storing images. It allows you to save photos in various color spaces (RBG, CMYK, YCbCr, CIE Lab, etc.) and with high color depth (8, 16, 32 and 64 bits). TIFF is widely supported by graphics applications and is used in the printing industry.

Unlike JPG, a TIFF image will not lose quality every time the file is saved. But, unfortunately, it is precisely because of this that TIFF files weigh many times more than JPG.

The rights to the TIFF format currently belong to Adobe. Photoshop can save TIFF without merging layers.

PSD.

The PSD format is used in Photoshop. PSD allows you to save a raster image with many layers, any color depth and in any color space.

Most often, the format is used to save intermediate or final results of complex processing with the ability to change individual elements.

PSD also supports compression without loss of quality. But the abundance of information that a PSD file can contain greatly increases its weight.

BMP.

The BMP format is one of the first graphic formats. It is recognized by any program that works with graphics; format support is integrated into the Windows and OS/2 operating systems.

BMP stores data with a color depth of up to 48 bits and a maximum size of 65535x65535 pixels.
At the moment, the BMP format is practically not used either on the Internet (JPG weighs several times less) or in printing (TIFF copes with this task better).

GIF.

The GIF format was created in the early days of the Internet for sharing images. It can store lossless compressed images in up to 256 colors. The GIF format is ideal for drawings and graphics, and also supports transparency and animation.
GIF also supports compression without loss of quality.

PNG.

The PNG format was created to both improve upon and replace the GIF format with a graphics format that does not require a license for use. Unlike GIF, PNG has alpha channel support and the ability to store an unlimited number of colors.

PNG compresses data without loss, which makes it very convenient for storing intermediate versions of image processing.

JPEG 2000 (or jp2).

A new graphics format created to replace JPEG. For the same quality, JPEG 2000 file size is 30% smaller than JPG.

When highly compressed, JPEG 2000 does not break the image into squares characteristic of the JPEG format.

Unfortunately, at the moment this format is not very widespread and is supported only by Safari and Mozilla/Fireox browsers (via Quicktime).

Vector formatsVector format files are especially useful for storing linear elements (lines and polygons) as well as elements that can be decomposed into simple geometric objects (such as text). Vector files do not contain pixel values, but mathematical descriptions of image elements. Based on mathematical descriptions of graphic forms (lines, curves, splines), the visualization program constructs 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 used by Windows graphics programs. This format is used to transfer vector images via the clipboard in the 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. Illustrator internal format. It can be opened by Photoshop and, in addition, this format is supported by all programs related to vector graphics. This format is the best way to transfer vector images from one program to another. Raster graphic elements are lost in most cases when transmitted via AI format.

CDR. This is the internal format of the Corel Draw program. This format is very popular, as is the software package itself. Many programs can import vector files into 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.

Raster images, especially high resolution and high color depth images, take up significant amounts of memory. Let's try to calculate how much memory space a color image of A4 format (8.2 x 11.6 inches) will take up if it is scanned with a resolution of 300 dpi and a color depth of 24 bits.

Let's calculate the image size in pixels:

X=11.6300=3480

Y=8.2300=2460

Thus, in total the picture consists of 34802460=8560800 pixels. Each point is allocated 24 bits or 3 bytes. Then the total amount of memory for storing the image will be 85608003=25682400 bytes or 24.5 MB.

Obviously, working with a file of this size is difficult. Therefore, many raster image storage formats provide information compression. We can say that when saving an image in this format, an archiver program is activated, compressing the data.

Fundamentally, there are two ways to compress information: lossless and lossy (Fig. 4.22).

Rice. 4.22 – Information compression algorithms.

With lossless compression, the data unpacked from the archive exactly matches the original data, so text and executable program files can be compressed using these methods. The compression principle is based on searching for repeated fragments in a file and placing them in a separate table. Lossless compression is implemented in the TIFF raster image storage format, and you can choose a compression algorithm: LZW or ZIP. In Fig. Figure 4.23 shows a dialog box for saving an image in TIFF format in the AdodePhotoshop program, in which you must explicitly specify the compression method.

Rice. 4.23 – Selecting the type of file compression (AdodePhotoshop8.0).

The names of the algorithms are formed by the first letters of the surnames of their authors.

Lossy compression is based on the fact that by removing small details from an image, the file size can be reduced dramatically (by a factor of 100 or more). After unpacking, the resulting file will be different from the original one, so only images, video and sound are compressed in this way. The lossy compression algorithm was developed by the Joint Photographic Experts Group and is called JPEG.

Rice. 4.24 – Lossy image compression.

a) original image (24Kb)

b) JPEG format image with 40% quality (13Kb)

When saving a file in JPEG format, the quality level is indicated: from maximum (100%) to minimum. The lower the quality, the smaller the file size (Fig. 4.24). The JPEG format is best used if the image is intended to be displayed off-screen, so it is widely used on the Internet.

    1. Raster image color models

Color models determine which base colors are used when printing and when viewing an image. The following main color models exist:

– HSB (hue, saturation, brightness – hue, saturation, brightness);

– RGB (red, green, blue – red, green, blue);

– CMYK (cyan, magenta, yellow, black – blue, crimson, yellow, black).

Special models such as Indexed Color and Duotone are also used.

Rice. 4.25 - RGB color model.

As is known, most of the visible spectrum can be represented by a mixture of red, green and blue colors in varying proportions. This RGB model(Fig. 4 .25). RGB images use three colors, or channels. The brightness value of each pixel typically ranges from 0 (black) to 255 (white) for each of the three primary RGB colors. For example, a bright red color should have brightness values ​​of R=246, G=20, B=50. If all three values ​​are equal, the image will be gray, if all values ​​are set to 255, it will be bright white, and if all channels are set to 0, it will be black. Typically, the RGB model is used if the image is self-luminous, for example, if it is a picture on a monitor screen. The RGB model works with television and all video recordings.

CMYK model(Fig. 4.26) is mainly used for color printing of images that we view in reflected light. As with the RGB model, three colors - cyan, magenta and yellow - when mixed, form all other colors, including black. Since dyes contain impurities, when properly mixed they form a deep brown color instead of black. To get true black, you need to add pure black ink. By the way, in the abbreviation CMYK, the letter K is used to denote the color black (black), not B, to avoid confusion with the word Blue.

Rice. 4.26 – Color model CYMK.

In the CMYK model, the amount of each primary color is measured as a percentage. The more saturated the color, the higher its percentage. For example, a bright red hue is determined by 2% blue, 93% magenta, 90% yellow and 0% black.

When printing in the CMYK model (namely, almost all color printing is done in it), color separation– converting a full-color image into four separate layers of cyan, magenta, yellow and black (Fig. 4.27). Next, each of these layers is printed on transparent film and color offset printing is performed from these films.

a) original image

crimson

b) color layers

Rice. 4.27 – Color separation.

ModelH.S.B. was designed to be “objective”, independent of the equipment used. In this model, the parameter H (hue) is set by an angle from 0 to 360 o, which corresponds to the hue of the color on the standard color wheel. The colors of the visible spectrum are arranged sequentially on the circle; red, orange, yellow, green, blue, indigo, violet. To remember them, a saying was invented: “How Once Jacques the Bell-Ringer Broke a Lantern with His Head.”

Rice. 4.28 – HSB color model.

Brightness (B) is the X coordinate of the color triangle and ranges from 0 to 100. The value 0 corresponds to black.

Saturation (S) is the Y-coordinate of the color triangle and ranges from 0 to 100. A value of 0 corresponds to white (no dye).

Color models can be converted from one to another, so if you need to print an image in color, it is better to first edit it in RGB mode, which is more suitable for viewing on a monitor, and then convert it to CMYK.

Mode indexed color uses only 256 colors. Due to this, the file size is noticeably reduced. This mode is used, for example, when creating graphics for Web pages. The file additionally stores a table that shows the values ​​of all 256 colors in any color model (usually RGB).

When displaying glowing images, two well-known settings are used: brightness and contrast. Brightness sets the white level, and contrast sets the black level. When setting up your monitor, set the brightness and contrast so that the black color is truly black and not greyish.