Raster computer graphics uses the following concepts. Features of raster graphics. Color representation systems

Raster graphics

Raster graphics, general information. Raster representations of images. Types of rasters. Factors that affect the amount of memory consumed by a bitmap image. 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 raster image is represented as a rectangular matrix, each cell of which is represented by a colored dot.

Basis raster graphics representation is pixel(dot) indicating its color. When describing, for example, a red ellipse on a white background, you must indicate the color each ellipse and background points. The image is represented as a large number of dots - the more there are, the visually better the image and the larger the file size. Those. one or 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 each cell is painted either black or white, together forming a pattern. Pixel– the main element of raster images. It is these elements that make up a raster image, i.e. raster graphics describe images using colored dots ( pixels), located on the grid.

When editing raster graphics, you are editing pixels, but not lines. Raster graphics are resolution-dependent because information describing the image is attached to a grid of a specific size. When editing raster graphics, the quality of its presentation may change. In particular, resizing raster graphics can cause the edges of the image to become frayed as the pixels are redistributed on the grid. Outputting raster graphics to devices with a lower resolution than the resolution of the image itself will reduce its quality.

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

Raster representation is typically used for photographic-type images with a lot of detail or shading. Unfortunately, scaling such images in any direction usually degrades the quality. When the number of dots is reduced, small details are lost and the inscriptions are deformed (although this may not be so noticeable if the visual size of the image itself is reduced - i.e., 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 adjacent colors.

Using raster graphics, you can reflect and convey the entire gamut of shades and subtle effects inherent in a real image. A raster 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 from a 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.

Raster image representations

Pixel– the main element of raster images. These are the elements that make up a raster image.

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 in nature, their coordinates are discrete quantities, usually integers or rational numbers. In the case of a color image, each pixel is characterized by x and y coordinates, and three brightnesses: red brightness, blue brightness and green brightness (VR, V B, V G). By combining these three colors you can get a large number of different 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 analogue images include halograms and photographs. To work with such images, there are special methods, in particular, optical transformations. In some cases, analog images are converted to digital form. This task is carried out by Image Processing.

The color of any pixel in a raster image is stored using a combination of bits. The more bits used for this, the more shades of colors can be obtained. 1 byte is usually allocated for brightness gradation (256 gradations), with 0 being black and 255 being white (maximum intensity). In the case of a color image, a byte is allocated for the 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 capable of distinguishing only 8 bits of gradations for each color, although special equipment may require more accurate color reproduction. Colors described in 24 bits provide more than 16 million available colors and are often called natural colors.

In color palettes, each pixel is described by a code. The connection of this code with a color table consisting of 256 cells is supported. The capacity of each cell is 24 bits. The output of each cell is 8 bits for red, green and blue.

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

Rice. 1. Color Cube

The vertices of the cube 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, with current O corresponding to black, and point D to white.

Types of rasters

Raster– this is the order of arrangement of points (raster elements). In Fig. 2. a raster is shown, the elements of which are squares, such a raster is called rectangular, these are the rasters that are most often used.

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

    all figures must be the same;

    should completely cover the plane without running over or holes.

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

Rice. 3. Triangular raster

Let's look at ways to construct lines in a rectangular and hexagonal raster.

Rice. 4. “Hexagonal raster”

In a rectangular raster, line construction is carried out in two ways:

    The result is an eight-connected line. Neighboring pixels of a line can be 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. Adjacent pixels of a line can be in one of four possible (see Fig. 5b) positions. The disadvantage is that the line is too thick at an angle of 45°.

Rice. 5. Drawing 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, i.e. line width dispersion is less than in a square raster.

Rice. 6. Drawing a line in a hexagonal raster

One of the ways to evaluate a raster is to transmit over a communication channel a coded 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 smallest deviation from the original. But the difference is not big.

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

Factors that affect the amount of memory consumed by a bitmap

Raster graphics files take up a large amount of computer memory. Some pictures take up a lot of memory because they have a large number of pixels, each of which takes up some of the memory. Three facts have the greatest impact on the amount of memory occupied by a raster image:

    image size;

    bit color depth;

    The file format used to store the image.

There is a direct relationship with the size of the bitmap image file. The more pixels there are in an image, the larger the file size. The image resolution does not affect the file size in any way. Resolution only affects file size 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 depends greatly on the image format chosen for storage. All other things being equal, such as image size and bit depth, the image compression scheme is essential. For example, a BMP file is usually larger in size compared to PCX and GIF files, which in turn are larger than a JPEG file.

Many image files have their own compression schemes and may also contain additional data brief 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 precisely designed to perceive a huge set of discrete elements that form objects. At their highest level of quality, the images look quite real, similar to how photographs look compared to drawings. This is only true for highly detailed images, usually obtained by scanning photographs. Besides their natural appearance, raster images have other advantages. Output devices such as laser printers use patterns 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:

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

About raster graphics compression

Sometimes the characteristics of a raster image are written in this form: 1024x768x24. This means that the image width is 1024 pixels, the height is 768 and the color depth is 24. 1024x768 is the working resolution for 15 - 17 inch monitors. It’s 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 consists of searching for sequences of identical pixels in the lines of a raster image (“red, red, ..., red” is written as “N red”).

LZW (Lempel-Ziv-Welch) is a more complex method that searches for repeating phrases - identical sequences of pixels of different colors. Each phrase is associated with a certain code; when decrypting the file, the code is replaced by the original phrase.

When JPEG files are compressed (with lossy quality), the image is divided into 8x8 pixel sections, 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 space is occupied by pixels of lower brightness. Most pixels are then reset to zero. When decrypted, zero pixels receive 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 associated with a code word. As the image size tends to infinity, maximum compression is achieved. This algorithm is also used in archivers.

Compression is also used for vector graphics, but there are no such simple patterns here, since vector file formats differ quite greatly in content.

Geometric characteristics of the raster

For raster images consisting of dots, the concept is of particular importance permissions, expressing the number of points per unit length. It is necessary to distinguish between:

    original resolution;

    screen image resolution;

    resolution of the printed image.

Original resolution. Original resolution is measured in dpi (dots per inchdpi) and depends on the requirements for image quality and file size, the method of digitizing and creating the original illustration, the selected 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 screen copies of an image, the elementary raster point is usually called pixel. 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 class), as a rule, provide standard screen resolutions of 640x480, 800x600, 1024x768, 1280x1024, 1600x1200, 1600x1280, 1920x1200, 1920x1600 pixels. The distance between adjacent phosphor points on a high-quality monitor is 0.22–0.25 mm.

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

Printed image resolution and the concept of lineature. The dot size of a raster image both on a hard copy (paper, film, etc.) and on the screen depends on the method and parameters used rasterization original. When rasterizing, 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 (Ipi) and is called lineature.

The raster dot size is calculated for each element and depends on the tone intensity in a given cell. The higher the intensity, the denser the raster element is filled. That is, if the cell contains absolutely black color, the size of the raster point will coincide with the size of the raster element. In this case, they talk about 100% occupancy. For a completely white color, the fill value will be 0%. In practice, element occupancy on a print usually ranges from 3 to 98%. In this case, all raster points 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 rasterization amplitude modulation (AM).

Thus, 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 measurement is dpi(dots per inch) – the number of pixels in one inch of length (2.54 cm). The pitch should not be equated with the pixel size - the pixel size can be equal to the pitch, or it can be either smaller or larger than the pitch.

Rice. 1. Raster.

Size A raster is usually measured by the number of horizontal and vertical pixels. We can say that for computer graphics, the most convenient raster is often one with the same pitch for both axes, that is, dpiX = dpiY. This is convenient for many algorithms for displaying graphic 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 depict the circle).

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

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

Tone intensity(so-called lightness) It is customary to divide it 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 screen 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 printing – 85–133 dpi, for artistic and advertising works – 133–300 dpi.

Dynamic range. The quality of tone image reproduction is usually assessed dynamic range (D). This optical density, numerically equal to the decimal logarithm of the reciprocal transmittance (for originals held up to the light, such as slides) or reflection coefficient(for other originals, such as printed prints).

For optical media that transmit light, the dynamic range ranges from 0 to 4. For surfaces that reflect light, the dynamic range value ranges from 0 to 2. The higher the dynamic range, the more halftones are present in the image and the more better quality his perception.

In the digital world of computer imaging, the term pixel refers to several different concepts. This could be a single point on a computer screen, a single point printed on a laser printer, or a single element in a raster image. These concepts are not the same thing, so 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 produced by a laser printer. There is an image rectangularity coefficient, which is introduced specifically to depict 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 raster image has a certain number of pixels in horizontal and vertical rows. There are the following rectangularity coefficients for screens: 320x200, 320x240, 600x400, 640x480, 800x600, etc. This coefficient 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 pixel squareness coefficient. Unlike the image squareness ratio, it refers to the actual video pixel dimensions and is the ratio of the actual width to the actual height. This coefficient depends on the display size and current resolution, and therefore at different computer systems takes on different meanings. 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 the computer uses for any given pixel is called the pixel bit depth. The simplest raster image consists of pixels with only two possible colors, black and white, and therefore images consisting of pixels of this type are called single-bit images. The number of available colors or shades of gray is 2 to the power of the number of bits per pixel.

Colors described in 24 bits provide more than 16 million available colors and are often called natural colors. Raster images have many characteristics that must be organized and captured by the computer.

The dimensions of an image and the arrangement of its pixels are two of the main characteristics that a raster image file must store 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 drawing if it knows how all its pixels are located. A pixel itself does not have any size, it is just an area of ​​​​computer memory that stores color information, so the squareness coefficient of the image does not correspond to any real dimension. Knowing only the rectangularity coefficient of the image with a certain resolution, you can determine the real dimensions of the picture. Since the image dimensions are stored separately, the pixels are stored one by one, just like a regular block of data. The computer doesn't have to store individual positions, it just creates a grid to fit the image's given squareness factor, and then fills it in pixel by pixel.

Number of bitmap colors

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

We classify images as follows:

    Two-color(binary) – 1 bits per pixel. Among two-color images, black and white images are most common.

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

    Color images. From 2 bits per pixel and above. Color depth of 16 bits per pixel (65,536 colors) is called HighCo1og, 24 bits per pixel (16.7 million colors) – TrueCo1og. In computer graphics systems They also use greater color depth - 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 animation. Supports pixel transparency (two levels - full transparency or full opacity). This format is widely used when creating Web pages. The GIF format allows you to record an image “through a line”, thanks to which, having only part of the file, you can see the entire image, but with a lower resolution. It is advantageous to use for images with a small number of colors and sharp edges (for example, 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 bit. Pixel transparency is not supported. With strong compression, defects appear in the area of ​​sharp boundaries. The JPEG format is good for compressing full-color photographs. Given that re-compression causes further degradation in quality, it is recommended to save only the final result of the work as JPEG. JPEG is widely used when creating Web pages, as well as for storing large collections of photographs.

Comparison of GIF and JPEG

    GIF – 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 a format of the Paint graphic editor. It does not use 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 (enhanced LZW). The maximum color depth is 48 bits. Supports gradient transparency mask channels (256 levels of transparency). PNG is a relatively new format and therefore not very widespread yet. Mainly used in Web design. Unfortunately, even in some modern browsers (such as Internet Explorer 6) no support PNG transparency and therefore it is not recommended to use transparent PNG images on Web pages.

TIFF– a format specially designed for scanned images. Can use the 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 for transferring graphic information between different platforms.

PSD– format of the Adobe Photoshop graphic editor. Uses the RLE lossless compression algorithm. Allows you to save all 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 for saving intermediate results when working in Photoshop and other raster editors.

RIFF– format of the graphic editor Corel Painter. Allows you to save all information created in this program. It should be used to save intermediate results when working in Painter.

Format

Max. number of bits/pixel

Max. number of colors

Max. image size, pixel

Compression methods

Encoding Multiple Images

281 474 976 710 656

2,147,483,647 x 2,147,483,647

Deflation (variant LZ77)

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 broad class of programs for processing raster graphics. Today it is the standard in computer graphics, and all other programs are invariably compared to it.

Main program controls Adobe Photoshop concentrated in the menu bar and toolbar. A special group consists of dialog boxes – tool palettes:

    Palette Brushes controls settings for editing tools. A brush enters editing mode after double-clicking on its image in the palette. CTRL-clicking destroys the brush. Double-clicking on a free field 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 for display tools. It presents: the current coordinates of the mouse pointer, the size of the current selected area, 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. The palette window contains a thumbnail of the image 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. This set can be downloaded 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 includes several color sets, mainly from Pantone.

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

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

    Palette Contours contains a list of all created contours. When you convert a path to a selection, it is used to form a clipping path.

    Graphics Vector graphic arts Fractal graphic arts Raster image... third order. IN in general case the equation of the curve... in TIFF format can be stored intelligence about masks (contours) of images. ...

  • Graphic arts to create Web pages in Flash

    Coursework >> Computer Science

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

  • Computer graphic arts (9)

    Cheat sheet >> Computer science, programming

    Therefore, the terms “VECTOR” are often found GRAPHIC ARTS" And " RASTER GRAPHIC ARTS". In the first case, piecewise linear... mathematical models of elements are performed in order to minimize general volume information V mathematical model object M. Thus...

Basic concepts of raster graphics

What is the difference between raster graphics and vector graphics?

All two-dimensional computer graphics can be divided into 2 large classes - vector and raster.

Vector graphics – a set of various geometric shapes and more complex objects consisting of straight lines, circular arcs and Bezier curves. The main distinguishing feature is the scalability of vector images without loss of quality. However, its capabilities are limited; in particular, it is impossible to create a photographic image using vector graphics.

Raster – a two-dimensional array of “squares” (pixels) of different colors, so small that when looking at a raster image we see not a set of pixels, but a complete picture.

Bitmap Options

A raster image is characterized by two important parameters - size and resolution.

Size – this is the dimension of the array, the number of pixels horizontally and vertically.

Permission – the number of pixels per inch (or other unit of measurement) of a printed image. Thus, resolution relates the size of a raster image in pixels to the physical size in inches or centimeters of the printed image. At the same time, the resolution does not in any way affect the display on the monitor screen.

Color representation systems

There are two main systems for representing color - RGB And CMYK . The first is used in computer monitors, the second - when printing on paper. Their main difference is that on the screen the absence of color is represented by black, on paper – by white. Accordingly, mixing the maximum number of colors on the screen corresponds to white, on paper - black. Thus, the systems are opposite to each other. RGB uses Red, Green, and Blue as its primary colors, while CMYK uses its opposite colors, Cyan, Magenta, and Yellow. However, on paper, due to the imperfection of printing devices, it is not possible to create a perfectly black color by mixing, so the CMYK system adds another base color - black.

Color depth is the number of bits that store color information per pixel in an image. The number of colors used in the image depends on this parameter. Let's say 8-bit color depth is 2^8 = 256 colors. The level of quality at which the human eye is unable to distinguish a computer photographic image from a real one is 24 bits, i.e. about 16 million colors.

Raster graphics formats for the web

Of course, the volume of color information directly depends on the amount of information graphic file in bytes. Therefore, a compromise is necessary between playback quality and graphics file size, which is achieved, in particular, by optimizing graphics. There are 2 main raster graphics formats used on the web – GIF and JPG.

GIF is capable of storing information about any number of colors from 2 to 256; by reducing the number of colors, a sharp reduction in file size is achieved.

In JPG format, the image is simplified by splitting it into rectangular areas of various sizes, filled with one color or a two-color gradient.

Pixel

A raster image is a grid or raster whose cells are called pixels. In other words, you can imagine that an image consists of a finite number of squares of a certain color. These squares are called pixel (from PICture ELement) - pixel or pixel

Each pixel in a raster image has a strictly defined position and color. Any object is interpreted as a set of colored pixels. When processing raster images, it is not specific objects and contours that are edited, but the groups of pixels that make them up. Raster images provide highly accurate color and tonal gradations and are good for displaying photographs. The quality of raster images depends on the resolution of the equipment, since any image consists of a certain number of pixels. Incorrect text processing, such as resizing, can result in jagged borders and loss of fine details.

Size and resolution

The main characteristics of a raster image: size and resolution.

The size of a raster image is specified in pixels. As was said, pixels are conditional squares into which the real image is divided. In this case, the number of pixels in the horizontal and vertical lines is indicated. For example, “raster 2048 by 1536 pixels” means that the image is a matrix of 2048 pixels wide and 1536 high.

The number of pixels per unit length is called image resolution and is measured in pixels per inch ppi (pixels per inch) or dots per inch, and dpi (dots per inch) - for a monitor, printer, scanner. It determines how many pixels a line of length 1 will turn into inch.

An image with a higher resolution contains more pixels that are smaller in size. The resolution largely determines the image quality.

When it comes to input/output devices, typically units from 100 dpi to 2400 dpi are used. 100 dpi is a very mediocre quality, absolutely unsuitable for any professional activity. Laser printers usually have from 300 to 600 dpi

The size of the image on the screen determines the number of pixels in the image, the size of the monitor and its parameters. A large monitor with a 640x480 screen matrix has larger pixels than a small one with the same dimension. The resolution of the PC monitor is 96 dpi. When placing an image, you need to take this into account. For example, an image with 144 ppi on a screen with a resolution of 72 dpi is twice its actual size.

If a scanned image is presented on the monitor, the quality is determined during scanning depending on the set resolution. A subsequent increase in resolution in a graphics editor does not lead to an improvement in the image, since the data is redistributed over a larger number of pixels.

An image consists of a finite number of pixels. Each pixel in the picture has a specific color, indicated by a number.

For example, you can view an image in order from left to right and top to bottom and write down the color numbers of the pixels encountered. You'll get a line something like this:

212= 45= 67= 45= 127= 4= 78= 245= 34 ...

This line is our digitized data. Now we can compress them (since uncompressed graphics data usually has enough big size) and save to a file. In addition, this data graphics editor can manipulate, realizing all the wildest ideas of your imagination.

Color coding

All pixels have a color, indicated in a certain way by a number. How to determine what number is needed? There are a number of color encoding methods, which are divided into 2 main groups: indexed (with a palette) and full color.

The idea behind indexed rasters is that the color number is actually the number of the "paint" that the pixel is painted with. Therefore, in addition to the pixel colors themselves, the program also needs to know the “palette” from which these colors are selected. This method is similar to the methods of a real artist, but is not very well suited for processing on a computer, since the program, in addition to the pixels themselves, also has to struggle with the palette, selecting the most suitable colors.

The second method is that from the color number we can directly determine the color itself.

Color coding defines Color Depth - the number of bits (bytes) a pixel uses to represent color.

Setting this option determines the following image types.

A black and white image contains only 2 colors - black and white, coded 0 and 1 respectively. The color depth in this case is 1 bit.

The indexed image, unlike the black and white mode, has a richer palette. How much? Determine for you. As a rule, graphic editors support a palette from 2 (not necessarily black and white) to 256 colors. The number of colors in the palette determines two mutually opposite parameters - image quality and its size.

As the quality improves, the size also increases - 9, 13 and 32 KB, respectively. For example, for 6 colors - 3 bits, for 8 - also 3 bits, for 16 - 4 bits and for 256 - 8 bits.

Halftone (grayscale, Grayscale). Here we take black as 0, white as 255, and intermediate shades are indicated by the corresponding numbers. For example - 68 is a color closer to black (dark gray, let's say...). In this case, it is much more convenient to carry out mathematical operations on the image, since its number can be directly determined by color. Color depth - 8 bits.

Full color. As you know, any color can be represented as a mixture of the three main colors - red, blue and green in various proportions. This is what is used when using full-color images. Each channel - R, G or B (Red, Green, Blue - Red, Green or Blue) has its own separate parameter, indicating the amount of the corresponding component in the final color. For example - (255,64, 23) - a color containing a strong red component, a little green and very little blue. Naturally, this mode is most suitable for conveying the richness of the colors of the surrounding nature: But it also requires high costs, since the color depth here is the greatest - 3 channels of 8 bits each give 24 bits.

Raster graphics are images made up of pixels - small colored squares arranged in a rectangular grid. A pixel is the smallest unit of a digital image. The quality of a raster image directly depends on the number of pixels it consists of - the more pixels, the more detail can be displayed. Enlarging a raster image by simply increasing the scale will not work - it is impossible to increase the number of pixels, I think many were convinced of this when they tried to see small details in a small digital photograph by zooming it in on the screen; As a result of this action, it was not possible to see anything other than increasing squares (that’s exactly what they are - pixels). This trick is only possible for CIA agents in Hollywood films, when they use enlarged images from an external surveillance camera to recognize car license plates. If you are not an employee of this structure and do not own such magical equipment, nothing will work out for you.

A raster image has several characteristics. For a photo stocker, the most important things are: resolution, size and color model. Sometimes the size is also called resolution and therefore confusion occurs, to prevent this from happening, you need to have a clear idea of ​​what we're talking about and “look in context” - the size is measured in MP (megapixels), and the resolution is dpi or ppi.

Permission is the number of pixels per inch (ppi - pixel per inch) to describe the display on the screen or the number of dots per inch (dpi - dot per inch) to describe the printing of images. There are several well-established rules: for publishing an image on the Internet, a resolution of 72ppi is used, and for printing - 300dpi(ppi). Microstock image requirements are 300dpi, since many works are purchased specifically for printing.

Size- the total number of pixels in an image, usually measured in MP (megapixels), this is simply the result of multiplying the number of pixels in height by the number of pixels in width of the image. That is, if the photo size is 2000x1500, then its size will be 2000*1500=3,000,000 pixels or 3MP. To send to photo banks, the image size should not be less than 4 megapixels, and in the case of illustrations - no more than 25 megapixels.

Color model- a characteristic of an image that describes its representation based on color channels. I know of 4 color models - RGB (red, green and blue channels), CMYK (cyan, magenta, yellow and black), LAB (lightness, red-green and blue-yellow) and Grayscale (grayscale). All microstocks accept raster graphics in the RGB color model.

Advantages of raster graphics:

  1. Ability to reproduce images of any complexity level. The amount of detail reproduced in an image largely depends on the number of pixels.
  2. Accurate reproduction of color transitions.
  3. Availability of many programs for displaying and editing raster graphics. The vast majority of programs support the same raster graphics file formats. Raster representation is perhaps the “oldest” way of storing digital images.

Disadvantages of raster graphics

  1. Large file size. In fact, for each pixel it is necessary to store information about its coordinates and color.
  2. Impossibility of scaling (in particular, enlarging) an image without losing quality.

Raster graphics formats

Despite the apparent simplicity of the presentation of raster graphics, there are “wagons and small carts” in their formats! And their number continues to change - some formats are becoming obsolete, others are just beginning to be developed. Describing everything would be long and not interesting; I will only describe those that, in my opinion, may be of interest to designers and photostockers.

PNG(Portable Network Graphics) is another raster graphics format that supports transparency, not only regular transparency like GIF, but also translucency - a smooth transition of color into a transparent area. The purpose of creating PNG was precisely to replace GIF, since the company CompuServe, the developer of the GIF format, in 1995 patented the compression algorithm used to create GIF images for 10 years, which made it impossible to use for free of this format in commercial projects.

Advantages of PNG:

  1. The ability to create a full-color image with color transitions and halftones.
  2. Save graphic information using a lossless compression algorithm.
  3. The ability to use alpha channels, that is, simply put, transparency and, moreover, translucency, which allows you to create smooth color transitions into a transparent area.

PNG, in my opinion, has only 2 disadvantages:

  1. Inability to create an animated image
  2. Ambiguous “understanding” of the transparency of the PNG format by Internet browsers. Some browsers, mostly older versions, refuse to display transparent areas of a PNG image and paint them gray. But this drawback, I think, will soon cease to be relevant.

TIFF(Tagged Image File Format) - format for storing images High Quality, supports any of the existing color models, provides a wide range of color depth changes, supports working with layers. Storing information in the TIFF format is possible both with and without losses. Cameras that do not support RAW format can sometimes take photos in TIFF format.

On photo banks that have the ability to upload additional formats to the main image in JPEG format (Dreamstime.com, iStock.com), you can upload TIFF as an additional one.

The disadvantage of the format is the large weight of the file, much larger than a RAW file of the same quality - each image in TIFF weighs from 8 to 20 MB.

RAW(translated from English “raw” - raw)

The RAW format appeared thanks to digital cameras. RAW is essentially a “print” that remains on the camera’s matrix at the time of shooting, or rather as many as 3 prints - in red, green and blue. In addition to these prints, the RAW file also stores some other data, which in this case is more of a reference nature, dictating to the RAW converter with what intensity to display each of the color channels for different pixels on the screen - this is white balance, color space, etc. . Changing these parameters will not affect the original information in any way; you can change them painlessly and return to the original view at any time. It will be much more problematic to work with another raster format obtained as a result of export. Extensions for files in RAW format can be different (.cr2, .crw, .nef, etc.) depending on the brand of the camera - each camera manufacturer has its own way of storing information. To edit RAW files and convert them to other raster formats, camera manufacturers supply their own software, and the Canon RAW converter will only read RAW files shot with Canon cameras (.cr2,.crw) and will not be able to read the RAW file shot Nikon camera (.nef). There are third-party RAW converters that work with most RAW files. In general, the lack of a unified standard creates certain inconveniences when working with this format.

The disadvantages of the format are the large file size (although not as large as TIFF) and the lack of a uniform standard for generating RAW files for all manufacturers of photographic equipment.

RAW, like TIFF, can be sent to photo banks as an “additional” image format - the availability of the source can influence the designer’s decision to purchase the image.

JPEG(Joint Photographic Experts Group - the name of the developer) is the most common raster graphics format (at least on the Internet). JPEG is an example of the use of “lossy” or, in other words, “distorting compression” compression algorithms; it is most suitable for storing paintings, photographs and other realistic images with smooth color transitions, but is practically not suitable for drawings and diagrams, that is for images with sharp transitions, the compression algorithm will produce noticeable artifacts in places of sharp contrast.

It is not recommended to store intermediate versions of work in this format - each “re-saving” will lead to irreversible loss of part of the information. The compression algorithm used in this format (lossy compress) is based on “averaging” the color of adjacent pixels.

JPEG does not support working with alpha channels, that is, it cannot contain transparent pixels, but it allows you to save a clipping path in the file, which in the case of working with photo banks must be noted in the description, the presence of a clipping path (if, of course, you have made it and know what is it) - this is important information for the buyer of the image.

The JPEG format is also the main format in which photo banks accept raster images (photos and illustrations) for sale. The final version of the file sent to the microstock must be saved in the RGB color model, with a resolution of 300dpi and, of course, in 100% quality. You can also enter IPTC information (title, description, keywords) into the file - the JPEG format allows you to do this and this will significantly save you time when sending images to several photo banks.

In addition to the common raster graphics formats (GIF, JPEG, TIFF, etc.), which are “readable” by all graphic editors and image viewers, there are “native” formats of almost every editor, which can only be opened by the program in which they were made, for example, Adobe Photoshop .PSD format. When processing photographs, raster illustrations and design development, intermediate options should be saved in such formats and only final versions translate JPEG. This is necessary so that you can save the results of your work without losing information and make changes to the image or project at any time.

06. 07.2017

Blog of Dmitry Vassiyarov.

What is raster graphics and where is it used?

Hello.

In this article we will talk about what raster graphics are, what are their main characteristics, where they are found, and in what formats they are most often presented. Every person, one way or another, encounters this type of computer graphics every day, so it’s worth learning more about it.

Understanding the concepts

Let's start with the definition of such a thing as raster graphics: these are images consisting of many small squares collected into one rectangular network.

Squares are pixels (they are also called dots) - the smallest unit of measurement of a digital image; and the higher their number, the greater the number of details the file contains, which means the better quality it is.

As you already guessed, raster images primarily include photographs. Try to enlarge them as much as possible, and you will see the described squares.

Difference with pixel graphics

Despite the fact that the main element in raster graphics is pixels, they should not be confused with pixel graphics. The latter is also formed on their basis, but such images are created exclusively on a computer using raster editors. They have such a low resolution that the pixels are clearly visible.

To roughly generalize, you can find raster graphics in realistic images, and pixel graphics in those made on a computer, with clearly defined squares. But in essence, it is the same thing.

Difference from vector graphics

There is another type of computer graphics - - from which you should learn to distinguish raster graphics. Vector images do not consist of dots, but of lines and other primitive geometric elements, formulas and calculations.

They are created in special programs and are used in writing layouts, drawings, diagrams, maps, etc.

With little detail, vector drawings have much less weight than raster ones. The fact is that the files of the former do not store complete information about the content, like the latter, but only the coordinates of the picture, according to which it is recreated when opened.

Let's say to draw a square, you specify the coordinates of the corners, the fill and stroke colors. When closing the editor, only this data is saved in the file. And when you want to open it again, the program will reproduce your works according to them.

Also, unlike raster images, vector images can be scaled to any size without loss of quality.

Characteristics of raster images

The main properties of raster images are:

  • Permission. Shows how many pixels there are per unit area. The measurement is most often made in dots per inch - dpi. The higher this number, the better the image quality. For posting on the Internet, 72-100 dpi is enough, and for printing on paper - at least 300 dpi.

  • Size. Do not confuse it with the previous parameter, as many do. This characteristic indicates the total number of pixels in the image or the exact number of pixels in width and height. For example, a 1600x1200px image contains a total of 1,920,000 pixels, which is roughly 2 megapixels.
    As a rule, photo banks accept photos of a maximum of 4 megapixels, and for illustration - 25 megapixels.

  • Color space. A way to display colors in coordinates. That is, each color is represented by a dot, having its own location in the palette. If you have dealt with Photoshop, you may have noticed that when you select a shade, its exact coordinates are displayed. This is what we are talking about.
    The color model comes in the following types: RGB, CMYK, YCbCr, XYZ, etc.

  • Color depth. Calculated by the formula: N = 2ᵏ, where N is the number of colors, and k is the depth. Indicates how many bits are in each pixel's color. The maximum number of shades that an image can contain depends on this. The larger it is, the more accurate the picture will be.

Advantages and disadvantages

Raster graphics have the following advantages:

Realism. With its help, images of any complexity are created, including many details, smooth transitions from one shade to another.

  • Popularity. This type graphics are used everywhere.
  • Possibility of automated information entry. For example, when you use a scanner to make a digital copy from a real photograph.
  • Fast processing of complex images. True, except for cases when strong magnification is required.
  • Adaptation for various devices input-output (monitors, printers, cameras, phones, etc.), as well as for many viewing programs. By the way, you can create and edit raster files in programs such as Adobe PhotoShop, Corel PhotoPaint, Ulead PhotoImpact GIMP, etc.

There are also negative sides:

  • Large weight of images.
  • Impossibility of enlarging without reducing quality (pixels appear);
  • Inability to reduce without losing detail.

Raster image formats

The format is essentially what you see in the image title after the dot (.jpeg, .png, .raw, etc.). It is also called extension, which many confuse with resolution due to the similarity in sound.

I'll tell you about the main raster graphics formats:

  • JPEG (Joint Photographic Experts Group - manufacturer's name). The most common extension. This is where photographs are most often saved. But JPEG is not suitable for storing drawings and other images with sharp transitions, as they will show strong contrast. Also, do not save unfinished work in it, because with each new edit you will lose quality.

  • RAW. Translated from English as “raw”, which reflects the essence of this format. It is most often filmed in professional photographers, so that later you can carry out deep processing of frames. RAW is like a print in the RGB palette (red, green and blue channel) on the camera matrix.
    When outputting to a computer via special program this “negative” indicates with what intensity the mentioned colors should be conveyed for certain pixels, determines the white balance, stores the settings of photographic equipment at the time of shooting the exported frame, etc.

  • TIFF (Tagged Image File Format). An alternative to the previous option. Some cameras that do not support RAW can take photos in this format. It saves very high quality images with any color models. But you have to pay for this with too large files (from 8 to 20 MB).



It is increasingly replacing the previous format, since it uses the same compression algorithm, but does not reduce quality and displays all colors.

However, it does not support animation.

That's all. What is raster graphics? I think I’ve sanctified it?

See you on the pages of my blog.

Computer graphics have quietly but firmly entered our everyday lives. It has long ceased to be the lot of the elite. Every time you transfer photos from a digital camera to a computer or simply click on the “save” button to add a picture you like to your collection, you are working with computer graphics.

Is it worth spending time on theory?

Knowing the basics of how image manipulation works will serve you well. Extensions after the file name will no longer be some kind of magical gobbledygook for you, but will begin to properly deliver important information. You can consciously decide which images are best to compress so as not to waste space on your hard drive, and wisely choose which way to do this.

Editing your own photos will also move from the state of “scientific poking method” to completely new level. And for some, innocent fun with images on the screen gradually turned into quite profitable work.

Difference between raster and vector graphics

On this moment In the computer environment, vector and raster graphics are mainly used. They differ radically from each other in the way they encode information.

It's no secret that all data on a computer is recorded using binary code. Thus, any information, be it text, picture or sound, is encrypted in a certain way. In order to save a vector image, it is divided into elementary geometric figures, which, in turn, are described by the simplest mathematical formulas. Thus, for example, the letter “and” for a graphic editor will be described by two parallel segments of a given length, which are connected by a line at an angle of 45 degrees.

A raster image is divided according to a different principle. The computer splits the image into many dots, called pixels, and remembers the color and location of each pixel.

Advantages and disadvantages

If you are working with a vector drawing, you can theoretically enlarge it indefinitely. Moreover, this will in no way affect the quality of the image. Since the parameters are given in the form of geometric formulas, the computer simply processes them and fills all the spaces with the required colors. As a result, you have a clear image.

The disadvantages of raster graphics lie precisely in the fact that during compression (which in the vast majority of cases occurs when saving a file) the quality can significantly suffer. So-called graininess appears. However, it is raster graphics that are used in complex images. In vector drawings you can only create very simple pictures. So for now we'll focus on where raster graphics are used.

Areas of use

Raster images perfectly convey the content of scanned objects. With their help you can work with halftones and smooth color transitions. Photos taken with a digital camera also use raster images exclusively. This format also serves as an indispensable tool in the field of web design.

Raster graphics formats

Recall that image information in our case is encoded using dots. The unit of measurement in this encoding is the pixel. It is the smallest point that cannot be divided either in size or color.

The number of these points per given unit area is called resolution. In an image with higher resolution (a large number of individual dots), we will see a clear pattern and smooth color transitions. However, in the case when the resolution is small, the quality of the picture can suffer greatly (after all, the computer simply displays the number of dots available in its memory on the screen and stretches them to the requested size).

It can be roughly compared to language. In order to convey the same information in different languages, different numbers of letters, sounds and words are required. Also, in most cases the grammatical construction will differ. And the “translators” from these “languages” in our computers are specialized programs that either “read” it or convert it into the required format.

The main difference between the formats remains the way information is stored. Let's look at the most common ones.

BMP

This is one of the pioneers. When it was developed, raster graphics were, one might say, at the very origins of their existence. The creators didn’t bother too much and programmed the BMP to memorize each pixel sequentially. In fact, this is just copying, but with some loss of color, since the BMP format only has 256 colors.

TIFF

Quite cumbersome on the scale of digital storage, but simply irreplaceable when outputting information to print. Unlike BMP, it supports information capability. Moreover, for this you can use not one, but several different algorithms. However, unless you work in the printing industry or at least some kind of publishing, you won't really need the serious power of this format.

GIF

This is a format closer to real use (for non-specialists). It is especially famous for its ability to use animation sequences. Computer graphics made in this format also allows you to create translucent images. However, you will not be able to convey smooth color transitions. The most common use of raster graphics in the GIF format can be seen in web design. It is compatible with all platforms and also compresses information quite compactly, which is an important factor in the speed of opening Internet pages.

JPEG

The most popular format. And this is well deserved. Any raster graphics editors undoubtedly support this format. It was designed with the specific goal of getting rid of the limitations imposed by GIF file compression. in this format reaches a coefficient of 100 units. This is a big indicator. However, such compression still has its drawbacks - some data loss occurs, and it is possible that the saved image will become somewhat blurry. Since this format simply discards information it considers unimportant, there is always a risk that some details will be distorted.

JPEG 2000

An improved version of an earlier version. Image information is compressed even more compactly, and there are significantly fewer losses in quality. Most often, this format is used to store photos on a computer’s hard drive and on the Internet. However, keep in mind that if you save the same image repeatedly JPEG formats or JPEG 2000, it will lose pieces of information every time, and in the end you will get a significantly distorted picture compared to the original.

PNG

A significantly improved quality counterpart to the GIF format. Having retained literally all the advantages of its predecessor, it is devoid of its disadvantages. Used both for and in web page design. In addition, PNG, unlike GIF, is officially freely available.

PSD

Raster graphics in PSD format are processed exclusively in Adobe Photoshop. This is an internal package of this program. It supports working with layers of an edited image.

CDR

It is also an internal package for a raster graphics program. Typically, this program is used by graphic designers to create images from scratch. But the editing function is undoubtedly supported.

Raster graphics editors

And now a little about programs that work with image editing.

The most popular program among users at the moment is the Adobe Photoshop program, commonly referred to simply as “Photoshop”. This development, in fact, monopolized the work with raster images among design specialists. However, this program is paid and it does not cost that little. Therefore, developments from other companies began to appear. Some of them have already been widely used.

As for Photoshop itself, this did not affect its popularity in any way. The program is quite simple, and there is no shortage of various video courses and tutorials.

In Photoshop, you can not only make a collage of photos or add built-in effects to the image. The simplest functions of this program can be mastered very quickly, and this will open the door to unbridled flights of imagination. You can correct defects in appearance, adjust the color scheme, change the background and much, much more.

Graphics editor GIMP

As for free programs, then we can safely recommend GIMP. This graphic editor can easily supplant the popular Photoshop. It excels at all the tasks needed for raster image editing, and has some introductory features for working with vector graphics.

The GIMP program allows you to make photos more rich and vibrant, it easily removes unnecessary elements from the image and can be used for preparing professional design projects. Computer graphics created with this program look natural and fit seamlessly into the overall picture.

Graphics editor Corel DRAW

It would be wrong to ignore Corel products. In Corel DRAW, you can easily work with both raster and vector images. The capabilities of this tool are so numerous that studying the Corel DRAW program is included in the mandatory training course graphic designers in colleges.

This program is also paid, and the arsenal of its products is replenished with enviable regularity. But, despite the wide range of possibilities that this graphic editor provides the user, its intuitive interface makes the work process a pleasure.

Free graphic editors

And just a few more words about alternative programs for image editing. In most cases, they cope well with the needs of the average user, and take up much less space and resources on your computer. And it’s generally easier to work with them, since you won’t be overloaded with the need to choose among all sorts of functions, the purpose of which remains unclear.

If you like unusual and mostly humorous photographs, try using the Funny Photo Maker program. There you will find many original frames and fun visual effects.

For more serious work, Picasa is suitable. This editor is designed for use in computer networks. Its new features will make it even easier for you to design your pages in in social networks. And the built-in effects for editing will not disappoint even a seasoned specialist.

Another one interesting program- this is Paint.NET. It is very similar in its functions and capabilities to Adobe Photoshop. And the tools used in Paint.NET can seriously compete with the mentioned commercial analogue.




Top