Hardware and software setup

Electronic textbook on the course "improving the qualifications of managers, specialists and teachers of the university in the field of ICT". Raster graphics Basic characteristics of raster graphics

Raster graphics

The smallest unit of raster graphics is a pixel (dot). Raster images resemble a sheet of checkered paper, on which any cell is painted over with some color, forming together a picture (bitmap). The main characteristics of raster graphics are color depth and permission.

Color depth.

Color depth is the number of bits allocated for color encoding.

Depending on how many bits are allocated for the color of each pixel, it is possible to encode a different number of colors. Thus, the color depth allows you to determine which maximum amount colors can be implemented in the image. For example, if the color depth is 24 bits, then the image can contain up to 16.8 million different colors and shades (ie 2 24 ≈ 16.8 million). It is obvious that the more colors are used for the electronic representation of the image, the more accurate the information about the color of each of its points (i.e. its color rendering).

Permission.

Resolution is the number of dots per unit length, the density of which determines the quality of the image (displaying colors and image details). The most common unit of length is inches, but sometimes millimeters can also be used. Image resolution is measured in dpi (dots per inch).

The higher the resolution of the image, the better it will be, but the larger the file size will be, which must be taken into account when creating and editing images. If the image is intended to be displayed on a monitor screen, then the resolution may be lower than if this image is intended for printing (usually 72 dpi or 96 dpi is enough to display the image on the screen, to print it from 150 dpi up to 300 dpi, and in the case of typographic printing, it can be much more).

+ Advantages of raster graphics:

  • displaying a large number of colors
  • displaying gradients and color transitions
  • displaying a lot of small details

- Disadvantages of raster graphics:

  • when the image is reduced, the quality deteriorates, because small details are lost
  • when the image is enlarged, the quality deteriorates, because dot size increases (pixelation effect)
  • the higher the resolution and color depth, the larger the file size

Bitmap graphic editors

Raster graphic editors are designed both for processing finished images (photographs, scanned images) and for creating images. Examples of such editors are Adobe PhotoShop, Corel PhotoPaint, Ulead PhotoImpact GIMP

Or colored dots (usually rectangular) on a monitor, paper and other display devices and materials (raster).

The important characteristics of an image are:

Raster graphics are edited using raster graphics editors. Raster graphics are created by cameras, scanners, directly in a raster editor, also by exporting from vector editor or as screenshots.

Advantages

  • Raster graphics allow you to create almost any drawing, regardless of complexity, unlike, for example, vector graphics, where it is impossible to accurately convey the effect of transition from one color to another without loss in file size.
  • Prevalence - raster graphics are now used almost everywhere: from small icons to posters.
  • High speed processing of complex images, if scaling is not needed.
  • Bitmap representation of an image is natural for most I / O devices graphic information, such as monitors (excluding vector output devices), dot matrix and inkjet printers, digital cameras, scanners, and cell phones.

Flaws

  • Large file sizes for simple images.
  • Impossibility of perfect scaling.
  • The impossibility of printing on a vector plotter.

Because of these shortcomings, it is recommended to use vector graphics instead of even compressed raster graphics to store simple drawings.

Formats

Raster images are usually stored in a compressed form. Depending on the type of compression, it may or may not be possible to restore the image exactly as it was before compression (lossless or lossy compression, respectively). Also, additional information can be stored in the graphic file: about the author of the file, the camera and its settings, the number of dots per inch when printing, etc.

Lossless compression

Uses compression algorithms based on information redundancy reduction.

  • BMP or Windows Bitmap - usually used without compression, although it is possible to use the RLE algorithm.
  • GIF (Graphics Interchange Format) is an obsolete format that supports no more than 256 colors at a time. Still popular due to animation support missing from pure PNG, although software is starting to support APNG.
  • PCX is an outdated format that allows you to compress simple drawn images well (when compressing, groups of consecutive pixels of the same color are replaced by a record of the number of such pixels and their color).
  • PNG (Portable Network Graphics)

Lossy compression

Based on the rejection of part of the information, as a rule, the least perceived by the eye.

  • JPEG is a very widely used image format. Compression is based on averaging the color of neighboring pixels (information about brightness is not averaged) and discarding high-frequency components in the spatial spectrum of an image fragment. A detailed examination of a highly compressed image shows blurring of sharp edges and a characteristic moiré near them.

miscellanea

  • TIFF supports a wide range of color depths, different color spaces, different settings compression (both lossy and without), etc.
  • Raw stores information directly received from the matrix of a digital camera or similar device without applying any transformations to it, and also stores camera settings. Allows you to avoid the loss of information when applying various transformations to the image (loss of information occurs as a result of rounding and the pixel color going beyond the allowable values). Used when shooting in difficult conditions (low light, inability to set the white balance, etc.) for subsequent processing on a computer (usually in manual mode). Almost all semi-professional and professional digital cameras allow you to save RAW images. The file format depends on the camera model, there is no single standard.

Computer bitmap represented as a rectangular matrix, each cell of which is a colored dot. Those. the main element of a raster image is a dot. If the image is on-screen, then this point is called pixel.

When creating bitmap images, you must specify the resolution and dimensions of the image.

Depending on which graphic screen resolution is used operating system, images with 640x480, 800x600, 1024x768 or more pixels can be placed on the screen.

Permission images are measured in dots per inch (dpi) (1 inch = 25.4 mm). Printing a full-color image requires a resolution of at least 200-300 dpi.

With the help of raster graphics, you can reflect and convey the whole gamut of shades and subtle effects inherent in a real image. A bitmap image is closer to a photograph, it allows you to more accurately reproduce the main characteristics of a photograph: illumination, transparency, and depth of field.

Most often, raster images are obtained by scanning photographs and other images, using a digital camera, or by "capturing" a frame of video.

The main disadvantage of raster images is the inability to enlarge them. to review the details. As the image is enlarged, the dots become larger, but no additional information appears. This effect is called pixelization (see Figure 19).

Tools for working with raster graphics

The simplest raster editors are paintbrush, Paint, painter, which allow you to directly draw the simplest bitmaps.

The main class of raster graphic editors is intended for processing finished raster images in order to improve their quality and create your own images from existing ones. These editors include powerful programs, how Adobe Photoshop , Corel PhotoPaint, gimp other.

Basic raster formats

BMP ( Windows device independent bitmap)- the simplest bitmap format is Windows format, it is supported by all graphic editors running under its control. BMP stores color data only in the RGB model, and supports both indexed colors (up to 256 colors) and full color images. Due to the most primitive image recording algorithm, very little is spent on processing BMP files. system resources, so this format is often used to store logos, screen savers, icons, and other graphic design elements of programs.

GIF (Graphics Interchange Format)) is one of the most popular image formats for web pages. Its distinctive feature is the use of the indexed color mode (no more than 256), which limits the scope of the format to images that have sharp color transitions. The small size of image files is due to the use of a lossless compression algorithm, which makes images in this format the most convenient for sending over communication channels. global network. Implemented in GIF transparency effect and the ability to store several pictures in one file with an indication of the display time of each, which is used to create animated images.

PNG (Portable Network Graphics)- the PNG format, which is the fruit of the work of a community of independent programmers, was born as a response to the transition of the most popular GIF format to the category commercial products. This format, unlike GIF, compresses bitmap images not only horizontally, but also vertically, which provides a higher compression ratio. As a shortcoming of the format, it is often mentioned that it does not allow you to create animated videos. But the PNG format allows you to create images with 256 levels of transparency, which, of course, distinguishes it from the background of all those existing in this moment formats. Since the format was created for the Internet, there is no space in its header for additional resolution type parameters, so PNG is not suitable for storing images to be printed, PSD or TIFF are better suited for these purposes.

JPEG (Joint Photographic Experts Group)- the most popular format for storing photographic images, is a generally accepted standard. JPEG can only store 24-bit full color images. Although JPEG compresses photographs well, this compression is lossy and spoils the quality, however, it can be easily adjusted to minimal, almost imperceptible to the human eye, losses. However, you should not use the JPEG format to store images to be further processed, since every time you save a document in this format, the process of image quality deterioration is avalanche. It would be most advisable to correct the image in some other suitable format, such as TIFF, and only after all the work is completed, the final version can be saved in JPEG. The JPEG format does not support animation or transparent color, and is suitable in the vast majority of cases only for publishing full-color images, such as photographs, on the Internet.

TIFF (Tag Image File Format). How universal format For storing raster images, TIFF is widely used, primarily in publishing systems that require the best quality images. By the way, the ability to record images in TIFF format is one of the signs high class modern digital cameras. This format supports such purely professional features as clipping paths, alpha channels, the ability to save multiple copies of an image at different resolutions, and even include layers in the file. Due to its compatibility with most professional imaging software, the TIFF format is very useful when transferring images between different types of computers.

PSD (Adobe Photoshop)- is the standard format of the Adobe Photoshop package and differs from most conventional raster formats in the ability to store layers (layers). It contains many additional variables (not inferior to TIFF in terms of their number) and sometimes compresses images even more than PNG (in cases where file sizes are measured not in kilobytes, but in tens or even hundreds of megabytes). PSD files are freely readable by most popular viewers.

Raster graphics

Raster graphics, general information. Bitmap representations of images. Raster types. Factors that affect the amount of memory a bitmap takes. Advantages and disadvantages of raster graphics. Geometric characteristics of the raster (resolution, raster size, pixel shape). The number of colors in the bitmap. Tools for working with raster graphics.

Raster graphics, general information

A computer bitmap is represented as a rectangular matrix, each cell of which is represented by a colored dot.

basis raster graphics presentation is pixel(dot) indicating its color. When describing, for example, a red ellipse on a white background, you must specify the color each ellipse and background points. The image is represented as a large number of dots - the more of them, the visually better the image and the larger the file size. Those. one and even a picture can be presented with better or worse quality in accordance with the number of dots per unit length - resolution(usually dots per inch - dpi or pixels per inch - ppi).

Raster images resemble a sheet of checkered paper, on which any cell is painted over with either black or white, forming a picture in the aggregate. Pixel– the main element of raster images. It is from such elements that a bitmap image consists, i.e. bitmap graphics describe images using colored dots ( pixels) located on the grid.

When editing bitmap graphics, you are editing pixels, but not lines. Raster graphics are resolution dependent because the information that describes the image is attached to a grid of a certain size. When editing raster graphics, the quality of their presentation may change. In particular, resizing raster graphics can cause the edges of the image to "fuzzle" as the pixels are redistributed on the grid. Raster graphics output to devices with a lower resolution than the resolution of the image itself will reduce its quality.

In addition, the quality is also characterized by the number of colors and shades that each point of the image can take. The more shades characterize images, the more bits are required to describe them. Red can be color number 001, or it can be 00000001. Thus, the better the image, the larger the file size.

Raster representation is usually used for photographic-type images with a lot of detail or tint. Unfortunately, scaling such images in any direction usually degrades the quality. When the number of points decreases, small details are lost and the inscriptions are deformed (although this may not be so noticeable when the visual dimensions of the image itself are reduced - that is, the resolution is maintained). Adding pixels leads to a deterioration in the sharpness and brightness of the image, because. new points have to be given shades that are average between two or more bordering colors.

With the help of raster graphics, you can reflect and convey the whole gamut of shades and subtle effects inherent in a real image. A bitmap image is closer to a photograph, it allows you to more accurately reproduce the main characteristics of a photograph: illumination, transparency, and depth of field.

Most often, raster images are obtained by scanning photographs and other images, using a digital camera, or by "capturing" a frame of video. Raster images can also be obtained directly in raster or vector graphics programs by converting vector images.

Common formats .tif, .gif, .jpg, .png, .bmp, .pcx and etc.

Bitmap representations of images

Pixel– the main element of raster images. It is from these elements that a bitmap image consists.

digital image is a collection of pixels. Each pixel of a raster image is characterized by x and y coordinates and brightness V(x,y) (for black and white images). Since pixels are discrete, their coordinates are discrete values, usually integers or rational numbers. In the case of a color image, each pixel is characterized by x and y coordinates, and three luminances: red luminance, blue luminance, and green luminance (V R , V B , V G). By combining these three colors, you can get a large number of various shades.

Note that if at least one of the characteristics of the image is not a number, then the image belongs to the form analog . Examples of analog images are holograms and photographs. To work with such images, there are special methods, in particular, optical transformations. In some cases, analog images are converted into digital view. This task is performed by Image Processing.

The color of any pixel in a bitmap is stored using a combination of bits. The more bits used for this, the more shades of colors can be obtained. Under the gradation of brightness, 1 byte (256 gradations) is usually allocated, with 0 being black and 255 being white (maximum intensity). In the case of a color image, a byte is allocated per gradation of brightness of all three colors. It is possible to encode gradations of brightness with a different number of bits (4 or 12), but the human eye is able to distinguish only 8 bits of gradations for each color, although special equipment may require more accurate color reproduction. Colors described by 24 bits provide over 16 million available colors and are often referred to as natural colors.

V color palettes each pixel is described by a code. This code is associated with a color table consisting of 256 cells. The capacity of each cell is 24 bits. The output of each cell has 8 bits for red, green and blue colors.

The color space formed by the intensities of red, green and blue is represented as a color cube (see Fig. 1.).

Rice. 1. Color Cube

Cube vertices A, B, C are the maximum intensities of green, blue and red respectively, and the triangle they form is called Pascal's triangle. The perimeter of this triangle corresponds to the most saturated colors. The color of maximum saturation always contains only two components. On the segment OD there are shades of gray, and the current O corresponds to black, and the point D to white.

Raster types

Raster is the order in which dots (raster elements) are arranged. On fig. 2. a raster is shown, the elements of which are squares, such a raster is called rectangular, it is these rasters that are most commonly used.

Although it is possible to use a figure of a different shape as a raster element: a triangle, a hexagon; meeting the following requirements:

    all figures must be the same;

    must completely cover the plane without collisions and holes.

So, as a raster element, it is possible to use an equilateral triangle (Fig. 3, regular hexagon (hexahedron) fig. 4. You can build rasters using irregular polygons, but there is no practical sense in such rasters.

Rice. 3. Triangular raster

Let's consider ways of constructing lines in a rectangular and hexagonal raster.

Rice. 4. "Hexagonal raster"

In a rectangular raster, a line is drawn in two ways:

    The result is an eight-connected line. Neighboring pixels of a line can be located in one of eight possible (see Fig. 5a) positions. The disadvantage is that the line is too thin at an angle of 45°.

    The result is a four-connected line. Neighboring pixels of a line can be in one of four possible (see Fig. 5b) positions. The disadvantage is an excessively thick line at an angle of 45°.

Rice. 5. Construction of a line in a rectangular raster

In a hexagonal raster, the lines are six-connected (see Fig. 6); such lines are more stable in width; linewidth dispersion is smaller than in a square raster.

Rice. 6. Construction of a line in a hexagonal raster

One of the methods for estimating a raster is the transmission over a communication channel of an encoded image, taking into account the raster used, with subsequent restoration and visual analysis of the achieved quality. It has been experimentally and mathematically proven that the hexagonal raster is better, because provides the least deviation from the original. But the difference is not great.

Modeling a hexagonal raster. It is possible to build a hexagonal raster based on a square one. To do this, the hexagon is represented as a rectangle.

Factors affecting the amount of memory used by a bitmap

Raster graphics files take up a large amount of computer memory. Some pictures take up a large amount of memory due to the large number of pixels, each of which takes up some part of the memory. Three things have the biggest impact on the amount of memory a bitmap takes:

    image size;

    bit depth of color;

    file format used to store the image.

There is a direct relationship between the file size of a bitmap image. The more pixels in the image, the larger the file size. The resolution of the image does not affect the size of the file. Resolution has an effect on file size only when scanning or editing images.

The relationship between bit depth and file size is direct. The more bits used in a pixel, the larger the file will be. The size of a raster graphics file is highly dependent on the format chosen for storing the image. Ceteris paribus, such as image dimensions and bit depth, the image compression scheme is essential. For example, a BMP file tends to be larger than PCX and GIF files, which are larger than a JPEG file.

Many image files have own schemes compression, may also contain additional data short description preview images.

Advantages and disadvantages of raster graphics

Advantages:

Raster graphics effectively represent real-life images. The real world consists of billions of tiny objects and the human eye is just adapted to perceive a huge set of discrete elements that form objects. At their highest level of quality, the images look very realistic, much like photographs compared to drawings. This is only true for very detailed images, usually obtained by scanning photographs. In addition to the natural look, raster images have other advantages. Output devices such as laser printers use sets of dots to create images. Raster images can be printed very easily on such printers because it is easy for computers to control the output device to represent individual pixels using dots.

Flaws:

Raster images take up a lot of memory. There is also the problem of editing raster images, since large raster images take up significant amounts of memory, and to ensure the operation of editing functions for such images, significant memory arrays and other computer resources are also consumed.

About raster graphics compression

Sometimes the characteristics of a bitmap are written in this form: 1024x768x24. This means that the width of the image is 1024 pixels, the height is 768 and the color depth is 24. 1024x768 is the working resolution for 15 - 17 inch monitors. It is easy to guess that the size of an uncompressed image with these parameters will be 1024*768*24 = 18874368 bytes. This is more than 18 megabytes - too much for one picture, especially if you need to store several thousand of these pictures - this is not so much by computer standards. This is why computer graphics are almost always used in compressed form.

RLE (Run Length Encoding) is a compression method that searches for sequences of identical pixels in the pixels of a bitmap image (“red, red, ..., red” is written as “N reds”).

LZW (Lempel-Ziv-Welch) is a more complex method, it looks for repeating phrases - the same sequences of pixels of different colors. Each phrase is assigned a certain code; when the file is decrypted, the code is replaced by the original phrase.

When compressing JPEG files (with loss of quality), the image is divided into sections of 8x8 pixels, and their value is averaged in each section. The average value is located in the upper left corner of the block, the rest of the place is occupied by pixels of lower brightness. Then most of the pixels are set to zero. When decoded, zero pixels get the same color. The Huffman algorithm is then applied to the image.

The Huffman algorithm is based on probability theory. First, image elements (pixels) are sorted by frequency of occurrence. Then, a Huffman code tree is built from them. Each element is assigned a code word. When the image size tends to infinity, the maximum compression is achieved. This algorithm is also used in archivers.

Compression is also applied to vector graphics, but there are no such simple patterns here, since the formats of vector files differ quite a lot in content.

Geometric characteristics of the raster

For raster images consisting of dots, the concept of permissions, expressing the number of points per unit length. In doing so, one should distinguish between:

    resolution of the original;

    screen image resolution;

    print image resolution.

original resolution. The resolution of the original is measured in dots per inch (dots per inchdpi) and depends on the requirements for image quality and file size, the method of digitizing and creating the original illustration, the chosen file format and other parameters. In general, the rule applies: the higher the quality requirement, the higher the resolution of the original should be.

Screen resolution. For on-screen copies of an image, an elementary dot of the raster is usually called pixel. The pixel size varies depending on the selected screen resolution(from the range of standard values), original resolution and display scale.

Monitors for image processing with a diagonal of 20-21 inches (professional grade), as a rule, provide standard screen resolutions of 640x480, 800x600, 1024x768, 1280x1024, 1600x1200, 1600x1280, 1920x1200, 1920x1600 pixels. The distance between adjacent phosphor dots in a high-quality monitor is 0.22–0.25 mm.

For a screen copy, a resolution of 72 dpi is sufficient, for printing on color or laser printer 150-200 dpi, for output on a photo-exposure device 200-300 dpi. A rule of thumb has been established that, when printed, the resolution of the original should be 1.5 times greater than screen lineature output devices. In case the hard copy will be enlarged in comparison with the original, these values ​​should be multiplied by the scaling factor.

Resolution of the printed image and the concept of lineature. The size of a raster image dot both on a hard copy (paper, film, etc.) and on the screen depends on the applied method and parameters. screening original. When screening, a grid of lines is superimposed on the original, the cells of which form raster element. The raster grid frequency is measured by the number lines per inch (lines per inch - Ipi) and called lineature.

The screen dot size is calculated for each element and depends on the tone intensity in the given cell. The greater the intensity, the denser the raster element is filled. That is, if absolutely black color is in the cell, the size of the raster dot will match the size of the raster element. In this case, we talk about 100% occupancy. For pure white, the fill value will be 0%. In practice, element occupancy on a print is typically between 3 and 98%. In this case, all dots of the raster have the same optical density, ideally approaching absolute black. The illusion of a darker tone is created by increasing the size of the dots and, as a result, reducing the white space between them with the same distance between the centers of the raster elements. This method is called screening with amplitude modulation (AM).

Thus, the resolution characterizes the distance between adjacent pixels (Fig. 1.). Resolution is measured by the number of pixels per unit length. The most popular unit of measure is dpi(dots per inch) - the number of pixels in one inch of length (2.54 cm). You should not identify the step with the pixel size - the pixel size can be equal to the step, or it can be either less or more than the step.

Rice. 1. Raster.

The size A raster is usually measured by the number of pixels both horizontally and vertically. It can be said that for computer graphics, a raster with the same pitch for both axes is often the most convenient, that is, dpiX = dpiY. This is convenient for many algorithms for displaying graphical objects. Otherwise, problems. For example, when drawing a circle on the EGA display screen (an outdated model of a computer video system, its raster is rectangular, the pixels are stretched in height, so an ellipse must be generated to represent a circle).

Pixel shape raster is determined by the features of the graphic output device (Fig. 1.2). For example, pixels may be in the form of a rectangle or square, which are equal in size to the raster pitch (liquid crystal display); pixels round shape, which may or may not be equal in size to the raster pitch (printers).

Rice. 2. examples of displaying the same image on different rasters

Tone Intensity(the so-called lightness) It is customary to subdivide into 256 levels. A larger number of gradations is not perceived by human vision and is redundant. A smaller number worsens the perception of the image (the minimum acceptable value for a high-quality halftone illustration is 150 levels). It is easy to calculate that to reproduce 256 tone levels, it is enough to have a raster cell size of 256 = 16 x 16 pixels.

When outputting a copy of an image on a printer or printing equipment, the raster lineature is chosen based on a compromise between the required quality, the capabilities of the equipment and the parameters of the printed materials. For laser printers, the recommended lineature is 65-100 dpi, for newspaper production - 65-85 dpi, for book and magazine production - 85-133 dpi, for art and advertising works - 133-300 dpi.

dynamic range. The quality of reproduction of tone images is usually evaluated dynamic range (D). This optical density, numerically equal to the decimal logarithm of the reciprocal of transmittance (for originals viewed through the light, such as slides) or reflection coefficient(for other originals such as printed copies).

For light-transmitting optical media, the dynamic range is between 0 and 4. For light-reflecting surfaces, the dynamic range is between 0 and 2. The higher the dynamic range, the more midtones are present in the image and the better quality his perception.

In the digital world of computer imaging, the term pixel refers to several different things. It can be a single dot on a computer screen, a single dot printed on a laser printer, or separate element bitmap. These concepts are not the same, therefore, to avoid confusion, they should be called as follows: video pixel when referring to an image of a computer screen; dot when referring to a single dot generated by a laser printer. There is a coefficient of squareness of the image, which is introduced specifically for the image of the number of pixels of the pattern matrix horizontally and vertically.

Returning to the analogy with a sheet of paper, you can see that any bitmap image has a certain number of pixels in horizontal and vertical rows. There are the following aspect ratios for screens: 320x200, 320x240, 600x400, 640x480, 800x600, etc. This factor is often called the image size. The product of these two numbers gives the total number of pixels in the image.

There is also such a thing as the squareness factor of the pixels. Unlike the aspect ratio of an image, it refers to the actual dimensions of a video pixel and is the ratio of the actual width to the actual height. This coefficient depends on the display size and current resolution, and therefore on different computer systems takes on different values. The color of any pixel in a raster image is stored in the computer using a combination of bits. The more bits used for this, the more shades of colors can be obtained. The number of bits used by a computer for any pixel is called the bit depth of the pixel. The simplest raster image is made up of pixels that have only two possible colors black and white, and therefore images made up of pixels of this kind are called single-bit images. The number of available colors or shades of gray is 2 to the power of the number of bits in a pixel.

Colors described by 24 bits provide over 16 million available colors and are often referred to as natural colors. Raster images have many characteristics that must be organized and fixed by a computer.

The dimensions of an image and its pixel arrangement are the two main characteristics that a bitmap file must maintain in order to create an image. Even if the information about the color of any pixel and any other characteristics is corrupted, the computer will still be able to recreate a version of the picture if it knows how all its pixels are located. The pixel itself does not have any size, it is just an area of ​​computer memory that stores color information, so the aspect ratio of the image does not correspond to any real dimension. Knowing only the squareness ratio of the image with a certain resolution, you can determine the real size of the picture. Since the dimensions of the image are stored separately, the pixels are stored one by one, just like a normal block of data. The computer doesn't have to save the individual positions, it just creates a grid to fit the given aspect ratio of the image, and then fills it in pixel by pixel.

Number of colors in a bitmap

Number of colors(color depth) is also one of the most important characteristics of a raster. The number of colors is an important characteristic for any image, not just a raster one.

We classify images as follows:

    Bicolor(binary) - 1 bit per pixel. Among the two-color images, black and white images are most common.

    Halftone– gradation of gray or other color. For example, 256 gradations (1 byte per pixel).

    Color images. From 2 bits per pixel and above. The color depth of 16 bits per pixel (65,536 colors) is called highColog, 24 bits per pixel (16.7 M colors) – TrueColog. In computer graphics systems, a large color depth is also used - 32, 48 or more bits per pixel.

Raster graphics file formats

gif– a format that uses the LZW lossless compression algorithm. The maximum color depth is 8 bits (256 colors). It also has the ability to record animations. Supports pixel transparency (two-level - full transparency or full opacity). This format is widely used when creating Web pages. GIF-format allows you to record the image "through the line", so that, having only part of the file, you can see the entire image, but with a lower resolution. It is beneficial to use for images with a small number of colors and sharp borders (for example, for text images).

JPEG (JPG)- a format that uses a lossy compression algorithm that allows you to reduce the file size by hundreds of times. Color depth - 24 bits. Pixel transparency is not supported. Under strong compression, defects appear in the region of sharp boundaries. The JPEG format is good for compressing full color photos. Considering that re-compression causes further deterioration in quality, it is recommended to save only the final result of the work in JPEG. JPEG is widely used for creating Web pages, as well as for storing large collections of photographs.

Comparison of GIF and JPEG

    GIF - the format is convenient when working with hand-drawn pictures;

    JPEG - the format is best used for storing photographs and images with a large number of colors;

    to create animations and images with transparent background GIF format is used.

BMP is the format graphic editor paint. It does not apply compression. It is well suited for storing very small images, such as desktop icons. Large files in this format take up too much space.

PNG- designed to replace the GIF format. Uses the Deflate lossless compression algorithm (advanced LZW). Max Depth colors - 48 bits. Supports gradient transparency mask channels (256 transparency levels). PNG is a relatively new format and therefore not very common yet. Mostly used in web design. Unfortunately, even in some modern browsers (such as Internet Explorer 6) There is no support for PNG transparency and therefore it is not recommended to use transparent PNG images on Web pages.

TIFF is a format specially designed for scanned images. Can use LZW lossless compression algorithm. Allows you to save information about layers, color profiles (ICC-profiles) and mask channels. Supports all color models. Hardware independent. Used in publishing systems, as well as to transfer graphic information between different platforms.

PSD- the format of the graphic editor Adobe Photoshop. Uses the RLE lossless compression algorithm. Allows you to save all the information created in this program. In addition, due to the popularity of Photoshop, this format is supported by almost all modern computer graphics editors. It is convenient to use it to save the intermediate result when working in Photoshop and other raster editors.

RIFF- Format of the graphic editor Corel Painter. Allows you to save all the information created in this program. It should be used to save an intermediate result when working in Painter.

Format

Max. bits/pixel

Max. number of colors

Max. image size, pixel

Compression methods

Multiple Image Encoding

281 474 976 710 656

2147483647 x 2147483647

Deflation (LZ77 variant)

total 4,294,967,295

LZW, RLE and others

Tools for working with raster graphics

Adobe's Photoshop package occupies a special place in the vast class of programs for processing raster graphics. Today it is the standard in computer graphics, and all other programs are invariably compared to it.

The main controls of the Adobe Photoshop program are concentrated in the menu bar and toolbar. A special group is made up of dialog boxes - tool palettes:

    Palette Brushes controls the settings for editing tools. The brush editing mode is entered after double-clicking on its image in the palette. Clicking while holding down the CTRL key destroys the brush. Double-clicking on an empty area of ​​the palette opens a dialog box for creating a new brush, which is automatically added to the palette.

    Palette Options serves to edit the properties of the current tool. You can open it not only from the menu bar, but also by double-clicking on the tool icon in the toolbar. The composition of the palette controls depends on the selected tool.

    Palette Info provides information support display means. It presents: the current coordinates of the mouse pointer, the size of the current selection, the color parameters of the image element, and other data.

    Palette Navigator allows you to view different parts of the image and change the viewing scale. A thumbnail of the image is placed in the palette window with a selected viewing area.

    Palette Synthesis displays the color values ​​of the current foreground and background colors. The sliders on the color bar of the corresponding color system allow you to edit these parameters.

    Palette Catalog contains a set of available colors. Such a set can be loaded and edited by adding and removing colors. The color tone of the foreground and background is selected from the set. The standard package of the program provides several color sets, mainly from Pantone.

    Palette Layers serves to control the display of all layers of the image, starting from the topmost. It is possible to determine the parameters of layers, change their order, operate with layers using different methods.

    Palette Channels are used to select, create, duplicate and delete channels, determine their parameters, change the order, convert channels into independent objects and form combined images from several channels.

    Palette Outlines contains a list of all created contours. When converting a path to a selection, it is used to form a clipping path.

    graphics Vector, graphics fractal graphics Raster image... of the third order. V general curve equation... in TIFF format you can store intelligence about masks (contours) of images. ...

  • Graphics to create Web pages in Flash

    Coursework >> Informatics

    ... charts. General it is known that the vector graphics takes up less space than previously used bitmap graphics... but also raster Images. Using bitmap charts the image is being described... in this case, the html code mixed to a minimum due to...

  • Computer graphics (9)

    Cheat sheet >> Informatics, programming

    Therefore, the terms "VECTOR GRAPHICS" and " RASTER GRAPHICS". In the first case, piecewise linear ... mathematical models of elements are performed in order to minimize general volume information v mathematical model object M. So...

A computer bitmap is represented as a rectangular matrix, each cell of which is represented by a colored dot.

When digitizing an image, it is divided into such tiny cells that the human eye does not see them, perceiving the entire image as a whole. The network itself is called raster map, and its unit element is called pixel.

Pixels are like grains in a photograph, and when zoomed in a lot, they become noticeable. A raster map is a set (array) of triples of numbers: two coordinates of a pixel on a plane and its color.

Unlike vector images, when creating raster graphics objects, mathematical formulas are not used, therefore, for the synthesis of raster images, it is necessary to set the resolution and dimensions of the image.

With the help of raster graphics, you can reflect and convey the whole gamut of shades and subtle effects inherent in a real image. A bitmap image is closer to a photograph, it allows you to more accurately reproduce the main characteristics of a photograph: illumination, transparency, and depth of field.

Most often, raster images are obtained by scanning photographs and other images, using a digital camera, or by "capturing" a frame of video. Raster images can also be obtained directly in raster or vector graphics programs by converting vector images.

There are many raster graphics file formats, and each has its own way of encoding image information. We list the features of only the most common formats.

Format Max. bits/pixel Max. number of colors Max. image size, pixel Compression methods Multiple Image Encoding
BMP 16 777 216 65535 x 65535 RLE -
gif 65535 x 65535 LZW +
JPEG 16 777 216 65535 x 65535 JPEG -
PCX 16 777 216 65535 x 65535 RLE -
PNG 281 474 976 710 656 2147483647 x 2147483647 Deflation (LZ77 variant) -
TIFF 16 777 216 total 4,294,967,295 LZW, RLE and others +

From a large number of formats graphic files on the Internet, only two are now widely used - GIF and JPEG. Let's talk about them in more detail.

GIF format

The popular GIF format was developed by CompuServe as being independent of hardware. It is designed to store bitmap images with compression. Several images can be stored in one file of this format. Typically this feature is used to store animated images (as a set of frames).

GIF-format allows you to record the image "through the line" (Interlaced), so that, having only part of the file, you can see the entire image, but with a lower resolution. This feature is widely used on the Internet. At first, you see a picture with a rough resolution, and as more data comes in, its quality improves. The main limitation of the GIF format is that a color image can contain no more than 256 colors. For printing, this is clearly not enough.

jpeg format

JPEG file format ( Joint Photographic Experts Group - Joint Expert Group on Photography) was developed by C-Cube Microsystems as effective method storing images with a large color depth, such as scanned photographs with numerous subtle (and sometimes elusive) color tints.

The biggest difference between the JPEG format and other formats is that JPEG uses lossy compression algorithm(not a lossless algorithm).

The lossless compression algorithm preserves image information in such a way that the decompressed image exactly matches the original. Lossy compression sacrifices some image information in order to achieve a higher compression ratio.

The compression used in JPEG format, irreversibly distorts the image. This is not noticeable when simply viewing it, but becomes apparent with subsequent manipulations. But the file size is 10 to 500 times smaller than BMP! If you decide to burn an image in JPEG format, it's best to do all the necessary operations before writing the file for the first time.

Comparison of GIF and JPEG

  1. GIF format is convenient when working with hand-drawn pictures.
  2. The JPEG format is best used for storing photos and images with large quantity colors.
  3. The GIF format is used to create animations and images with a transparent background.

Vector graphics

Main logical element vector graphics is geometric object. As an object, simple geometric shapes (the so-called primitives - rectangle, circle, ellipse, line), composite shapes or shapes built from primitives, color fills, including gradients, are accepted.

The advantage of vector graphics is that the shape, color and spatial position of its constituent objects can be described using mathematical formulas.

An important object of vector graphics is a spline. A spline is a curve that describes a particular geometric figure. Modern fonts are built on splines true type and postscript.

Vector graphics have many advantages. It is economical in terms of disk space required for storing images: this is due to the fact that not the image itself is saved, but only some basic data, using which the program recreates the image every time. In addition, the description of color characteristics almost does not increase the file size.

Vector graphics objects are easily transformed and modified, which has almost no effect on image quality. Scale, rotate, warp can be reduced to a couple elementary transformations over vectors.

In areas of graphics where importance has the preservation of clear and distinct contours, for example, in font compositions, in creating logos, etc., vector programs are indispensable.

Vector graphics can also include fragments of raster graphics: a fragment becomes the same object as all the others (though with significant limitations in processing).

An important advantage of vector graphics programs is the advanced means of integrating images and text, a unified approach to them. Therefore, vector graphics programs are indispensable in the field of design, technical drawing, drawing, graphic and design work.

However, on the other hand, vector graphics may seem overly rigid, "plywood". It is indeed limited in purely pictorial means: it is almost impossible to create photorealistic images in vector graphics programs.

And besides, the vector principle of image description does not allow you to automate the input of graphic information, as does a scanner for dot graphics.

Recently, 3D modeling programs, which also have a vector nature, are becoming more widespread.

With sophisticated rendering techniques (ray tracing, radiance), these programs allow you to create photorealistic bitmaps with arbitrary resolution from vector objects with moderate effort and time.

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!