Raster Graphics and Tools for Working with Raster Graphics

Lecture



In computer graphics and digital photography, raster graphics represents a two-dimensional image as a rectangular matrix or grid of pixels, viewable on a computer display, paper, or other medium. A raster image is technically characterized by its width and height in pixels and by the number of bits per pixel. Raster images are stored in image files with various formats of distribution, production, generation, and acquisition.

Raster Graphics and Tools for Working with Raster Graphics

The smiley face in the upper left corner is a raster image. When enlarged, individual pixels look like squares. Upon further enlargement, each pixel can be analyzed, and its color can be constructed by combining values of red, green, and blue

In printing and prepress, raster graphics are known as contones (from continuous tones). By contrast, line art is usually implemented as vector graphics in digital systems.

Raster Graphics and Tools for Working with Raster Graphics

Transposing an image into a hidden raster organization (a relatively costly operation for packed formats with less than one byte per pixel); composing an additional mirroring of the raster row (almost free), either before or after, is equivalent to rotating the image by 90° in one direction or the other.

Many raster manipulations correspond directly to the mathematical formalisms of linear algebra, where mathematical objects with a matrix structure play a central role.

Etymology

The word "raster" comes from the Latin rastrum (rake), which derives from radere (to scrape). It originates from the raster scanning of cathode-ray tube (CRT) video monitors, which draw an image line by line by steering a focused electron beam magnetically or electrostatically. By association, it can also refer to a rectangular grid of pixels. The word rastrum is now used to denote a device for drawing staff lines in music notation.

Data model

Raster Graphics and Tools for Working with Raster Graphics

Simple raster graphics

The fundamental strategy underlying the raster data model is the tessellation of the plane into a two-dimensional array of squares, each called a cell or pixel (from "picture element"). In digital photography, the plane is the field of view projected onto an image sensor; in computer art, the plane is a virtual canvas; in geographic information systems, the plane is a projection of the Earth's surface. The size of each square pixel, known as the resolution or support, is constant across the entire grid. Raster or grid data may be the result of a gridding procedure.

A single numeric value is then stored for each pixel. For most images this value is the visible color, but other measurements are possible, even numeric codes for qualitative categories. Each raster grid has a defined pixel format, a data type for each number. Common pixel formats are binary, grayscale, palette-based, and full-color, where color depth determines the precision of the represented colors, and color space determines the range of color coverage (which is often less than the full range of human color vision). Most modern color raster formats represent color using 24 bits (more than 16 million distinct colors), with 8 bits (values 0–255) for each color channel (red, green, and blue). Digital sensors used for remote sensing and astronomy are often capable of detecting and storing wavelengths beyond the visible spectrum; the large raster CCD sensor at the Vera C. Rubin Observatory captures 3.2 gigapixels in a single image (6.4 GB raw) across six color channels, exceeding the spectral range of human color vision.

Applications

Image storage

Raster Graphics and Tools for Working with Raster Graphics

Using a raster to summarize a point pattern

Most computer images are stored in raster graphics formats or compressed variants, including GIF, JPEG, and PNG, which are popular on the World Wide Web. The structure of raster data is based on a (usually rectangular, square) tessellation of the 2D plane into cells, each containing a single value. To store the data in a file, the two-dimensional array must be serialized. The most common way to do this is a row-major format, in which cells along the first (usually top) row are listed from left to right, immediately followed by the cells of the second row, and so on.

In the example on the right, the tessellation cells A are overlaid on the point pattern B, resulting in an array C of quadrant counts representing the number of points in each cell. A lookup table was used to color each of the cells for visualization in image D. Here are the numbers as a sequential row-by-row array:

1 3 0 0 1 12 8 0 1 4 3 3 0 2 0 2 1 7 4 1 5 4 2 2 0 3 1 2 2 2 2 3 0 5 1 9 3 3 3 4 5 0 8 0 2 4 3 2 8 4 3 2 2 7 2 3 2 10 1 5 2 1 3 7

To reconstruct the two-dimensional grid, the file must include a header section at the beginning that contains at least the number of columns and the pixel data type (specifically the number of bits or bytes per value), so that the reader knows where each value ends in order to begin reading the next one. Headers may also include the number of rows, georeferencing parameters for geographic data, or other metadata tags, such as those specified in the Exif standard.

Image compression

High-resolution raster grids contain a large number of pixels and thus consume a large amount of memory. This has led to the emergence of several approaches for compressing the volume of data into smaller files. The most common strategy is to search for patterns or trends in pixel values and then store a parameterized form of the pattern instead of the original data. Common raster compression algorithms include run-length encoding (RLE), JPEG, LZ (the basis for PNG and ZIP), Lempel–Ziv–Welch (LZW) (the basis for GIF), and others.

For example, run-length encoding looks for repeating values in the array and replaces them with the value and the count of its occurrences. Thus the raster above would be represented as:

values 1 3 0 1 12 8 0 1 4 3 ...
lengths 1 1 2 1 1 1 1 1 1 2 ...

This method is very effective when there are large areas with identical values, such as a line drawing, but for a photograph, where pixels usually differ slightly from their neighbors, an RLE file will be twice as large as the original.

Some compression algorithms, such as RLE and LZW, work losslessly, where the original pixel values can be perfectly reconstructed from the compressed data. Other algorithms, such as JPEG, are lossy, since the parameterized patterns are only an approximation of the original pixel values, so the latter can only be estimated from the compressed data.

Raster-to-vector conversion

Vector images (lines) can be rasterized (converted into pixels), and raster images can be vectorized (raster images converted into vector graphics) using software. In both cases some information is lost, although some vectorization operations can recreate essential information, as in the case of optical character recognition.

Displays : Electronic television and Computer monitor

Early mechanical televisions, developed in the 1920s, used raster principles. Electronic television based on cathode-ray tube displays has a raster scan with horizontal raster lines drawn from left to right, and raster lines drawn from top to bottom.

Modern flat-panel displays, such as LED monitors, still use the raster approach. Each pixel on the screen directly corresponds to a small number of bits in memory. The screen is refreshed simply by scanning the pixels and coloring them according to each set of bits. The refresh procedure, being speed-critical, is often implemented by dedicated circuitry, frequently as part of a graphics processing unit.

Using this approach, the computer contains a memory area that holds all the data to be displayed. The central processing unit writes data to this memory area, and the video controller reads it from there. The bits of data stored in this memory block are linked to the final pattern of pixels that will be used to build the image on the display.

The first scanning raster computer graphics display was invented in the late 1960s by A. Michael Noll at Bell Labs, but his patent application, filed on February 5, 1970, was rejected by the Supreme Court in 1977 due to the question of the patentability of computer software.

Printing Laser printing and Inkjet printing

In the 1970s and 1980s, pen plotters, using vector graphics, were common for creating precise drawings, especially on large-format paper. Since then, however, almost all printers produce a printed image as a raster grid, including both laser and inkjet printers. When the source information is vector-based, rendering specifications and software, such as PostScript, are used to create the raster image.

Three-dimensional rasters Voxel

Three-dimensional voxel raster graphics are used in video games, as well as in medical imaging, for example in MRI scanners.

Geographic information systems

Geographic phenomena are typically represented in raster format in GIS. A raster grid is georeferenced, so that each pixel (usually called a cell in GIS, since the part of "pixel" denoting "picture" is meaningless) represents a square area of geographic space. The value of each cell then represents some measurable (qualitative or quantitative) property of that area, usually conceptualized as a field. Examples of fields commonly represented in rasters include: temperature, population density, soil moisture, land cover, surface elevation, etc. Two sampling models are used to derive cell values from a field: in a lattice, the value is measured at the central point of each cell; in a grid, the value is a summary (usually the mean or mode) of the value across the entire cell.

Image resolution

Raster graphics is resolution-dependent, meaning it cannot be scaled to an arbitrary resolution without loss of apparent quality. This property contrasts with the capabilities of vector graphics, which scales easily to the quality of the device displaying it. Raster graphics handles photographs and photorealistic images more practically than vector graphics, while vector graphics is often better suited for typesetting or graphic design. Modern computer monitors typically display about 72–130 pixels per inch (PPI), and some modern consumer printers can resolve 2400 dots per inch (DPI) or more; determining the most appropriate image resolution for a given printer resolution can be difficult, since the printed output may have a higher level of detail than a viewer can distinguish on a monitor. Generally, a resolution of 150 to 300 PPI is well suited for printing using the 4-color process (CMYK).

However, for printing technologies that perform color mixing through dithering (halftoning) rather than through overlay (practically all home/office inkjet and laser printers), printer DPI and image PPI have a completely different meaning, and this can be misleading. Since in the dithering process the printer creates one image pixel from several printer dots to increase color depth, the printer's DPI setting must be set much higher than the desired PPI to ensure sufficient color depth without compromising image resolution. Thus, for example, printing an image at 250 PPI may actually require a printer setting of 1200 DPI.

Raster image editors

Raster image editors, such as PaintShop Pro, Corel Painter, Adobe Photoshop, Paint.NET, Microsoft Paint, Krita, and GIMP, revolve around editing pixels, as opposed to vector image editors, such as Xfig, CorelDRAW, Adobe Illustrator, or Inkscape, which revolve around editing lines and shapes (vectors). When an image is rendered in a raster image editor, it consists of millions of pixels. At its core, a raster image editor works by manipulating each individual pixel. Most pixel-based image editors work using the RGB color model, but some also allow the use of other color models, such as the CMYK color model.

Tools for working with raster graphics.

Software tools for processing raster images. The concept of layers and channels. Working in the Adobe Photoshop raster editor.

A raster image consists of pixels — small colored dots, each with a specific color and location. Software tools for processing raster images allow such images to be edited by changing their appearance, adding effects, adjusting colors, and performing many other operations.

Popular programs for processing raster images:

  1. Adobe Photoshop — one of the most powerful editors for professional image processing.
  2. GIMP — a free alternative to Photoshop with broad functionality.
  3. Corel PHOTO-PAINT — part of the CorelDRAW suite, suitable for working with raster images.
  4. Paint.NET — a simple editor for basic operations.

The concept of layers and channels

Layers

Layers are a key concept in image processing, allowing you to work with different elements of an image independently of each other.

  • What is a layer? It is a separate level of the image that can be edited, moved, or changed without affecting other elements.
  • Examples of use: adding text, inserting objects, applying effects.
  • Advantages:
    • Simplifying work with composition.
    • The ability to edit individual elements.
    • Using masks to hide or partially display layers.

Channels

Channels contain information about the color and transparency of an image.

  • What is a channel? It is a data layer containing information about the brightness of a specific color (for example, red, green, blue in RGB).
  • Alpha channel: an additional channel for storing transparency information.
  • Application: adjusting color, contrast, highlighting areas of the image.

Working in the Adobe Photoshop raster editor

Adobe Photoshop — a professional tool for image processing with a wide range of functions.

Main stages of work:

  1. Creating or opening an image.

    • Use the File → Open menu to open an image.
    • For a new project — File → New, specifying dimensions and resolution.
  2. Working with layers.

    • The Layers panel allows you to create new layers (New Layer), change their order, and add masks.
    • Layer transparency and blending modes are available at the top of the panel.
  3. Using tools.

    • Brush, eraser, fill — for drawing and editing.
    • Selection tools (rectangular, lasso, magnetic lasso) — for working with specific parts of the image.
    • Clone and stamp — for removing defects.
  4. Color correction.

    • The Image → Adjustments menu contains tools for changing brightness, contrast, white balance, saturation, and other parameters.
  5. Working with channels.

    • The Channels panel displays data about the color channels of the image.
    • Channels can be edited to create selections, work with masks and effects.
  6. Saving.

    • To save the project in a format that supports layers: File → Save As → PSD.
    • To export to other formats: File → Export → Export As (JPEG, PNG, TIFF, etc.).

Advantages of Adobe Photoshop:

  • Support for layers and masks.
  • Working with various color spaces (RGB, CMYK, LAB, etc.).
  • A wide range of built-in tools for retouching, drawing, and creating effects.

Layer interaction capabilities. Image correction. Using masks.

Layer interaction capabilities in Adobe Photoshop

Layers in Photoshop allow you to work with images on separate levels, making processing more flexible and convenient. Interaction between layers opens up wide possibilities for creating complex compositions and effects.

Main ways layers interact:

  1. Layer blending modes:
    These modes determine how one layer interacts with those below it.

    • Example modes:
      • Normal — standard blending.
      • Multiply — darkens the image by mixing colors.
      • Screen — lightens the image.
      • Overlay — increases contrast.
    • Application: creating light effects, color correction, texture overlays.
  2. Opacity and fill:

    • Opacity controls the overall transparency of the layer.
    • Fill affects the transparency of the layer's content but does not affect effects (such as a stroke or shadow).
  3. Grouped layers:

    • Layers can be grouped (Ctrl + G), which simplifies managing compositions.
    • Groups allow applying adjustment layers and masks to multiple elements at once.
  4. Merging layers:

    • Layers can be merged (Merge Layers) or flattened into one (Flatten Image) to reduce file size.
  5. Linking layers:

    • Linking layers (Link Layers) allows you to move and transform them as a single object.
  6. Adjustment layers:

    • These layers apply correction (brightness, contrast, color balance, etc.) only to selected elements or to the entire composition, without altering the original image.

Image correction

Correction allows you to improve an image by changing its color, brightness, contrast, and other parameters.

Main correction tools:

  1. Adjustment layers:

    • Brightness/Contrast — changing brightness and contrast.
    • Hue/Saturation — adjusting hue, saturation, and lightness of color.
    • Levels — correcting highlights, midtones, and shadows.
    • Curves — more precise adjustment of brightness and color.
    • Color Balance — changing the ratio of primary colors (red, green, blue).
  2. Adjustments panel:

    • Quick access to adjustment layers via the Adjustments panel.
  3. Manual correction:

    • Tools such as the Dodge Tool (lightening) and Burn Tool (darkening), for local correction.
    • Clone Stamp and Healing Brush for removing defects.
  4. Filters:

    • Applying filters for noise reduction, sharpening, blurring, or artistic effects.

Using masks in Photoshop

Masks allow you to hide or partially display layer elements without deleting them. This is one of the most powerful tools for precise editing.

Types of masks:

  1. Layer Mask:

    • Created via the Add Layer Mask button in the layers panel.
    • White reveals the layer's content, black hides it.
    • Shades of gray create partial transparency.
  2. Vector Mask:

    • Uses curves and shapes to create a mask.
    • Created via the Layer → Vector Mask menu.
  3. Clipping Mask:

    • Applies the content of the upper layer only to the visible area of the layer below.
    • Created via Alt + Click between layers.

Advantages of using masks:

  • No irreversible changes — the mask can be easily edited or removed.
  • Precise work with selections, gradients, and textures.
  • The ability to combine with adjustment layers.

Examples of using masks:

  1. Removing the background:
    • Hiding unwanted areas using a brush on the layer mask.
  2. Creating smooth transitions:
    • Applying gradients on the mask for a soft blending of images.
  3. Local correction:
    • Applying an adjustment layer with a mask to change color or brightness only in a specific area.

Masks and layer interaction provide enormous scope for creativity, allowing you to create complex and professional-looking compositions.

Shape cropping in a raster editor.

Shape cropping is the process of cutting out an image within a specified shape, such as a circle, star, text, or arbitrary outline. This technique is used to create interesting compositions, collages, or graphic designs.

Steps for performing shape cropping in Adobe Photoshop:

1. Using the selection tool

  1. Create a selection of the desired shape:
    • Choose the Elliptical Marquee Tool (Rectangular Marquee → Elliptical Marquee) to create circles and ellipses.
    • For an arbitrary shape, use the Lasso Tool.
    • For precise work with outlines, use the Pen Tool to create selections based on a vector path.
  2. Apply the selection:
    • Draw the shape on the image.
    • Go to the Select → Inverse menu and press Delete to remove the areas outside the selected shape.

2. Using layer masks

  1. Create a shape:

    • Choose the Shape Tool (Rectangle, Ellipse, Polygon, etc.).
    • Draw the shape on a new layer overlapping the image.
  2. Apply the mask:

    • Drag the image onto the top layer.
    • Create a Clipping Mask using Alt + Click between layers in the Layers panel.
    • The image will be cropped to the shape.

3. Cropping to text

  1. Add text:
    • Choose the Type Tool and write the desired word or phrase.
  2. Apply the clipping mask:
    • Drag the image onto the text layer.
    • Create a Clipping Mask (Alt + Click) so the image fills the letters of the text.

4. Shape cropping using a vector mask

  1. Create a vector path:
    • Use the Pen Tool to draw an arbitrary shape.
  2. Add a vector mask:
    • Select the image layer.
    • Go to the Layer → Vector Mask → Current Path menu. The crop will be performed according to the given shape.

5. Using selection and a mask for smooth edges

  1. Create a selection (for example, a circle or an arbitrary shape).
  2. Go to the Select → Modify → Feather menu and set the feather radius.
  3. Apply a layer mask to hide areas beyond the boundaries of the selection. This will create a soft transition.

Tips:

  • To preserve a transparent background, save cropped images in PNG format.
  • If you need to change the shape later, use layers and masks instead of directly deleting pixels.
  • Work with copies of the original image to avoid data loss.

Shape cropping makes images more expressive and helps bring creative ideas to life in graphic design.

Additional plugins for implementing various effects.

Plugins extend the capabilities of raster editors, such as Adobe Photoshop and GIMP, by adding new tools, effects, and functions. They save time and allow you to achieve professional results.

1. Popular plugins for Adobe Photoshop

a) Effects and styles

  1. Nik Collection (by DxO)

    • A set of 8 powerful plugins for color correction, retouching, and creating vintage and artistic effects.
    • Tools: Color Efex Pro (color correction filters), Silver Efex Pro (black-and-white photography), Analog Efex Pro (vintage effects).
    • Free or paid version.
  2. Topaz Labs Plugins

    • Topaz DeNoise AI — AI-based noise reduction.
    • Topaz Sharpen AI — sharpening.
    • Topaz Gigapixel AI — increasing image resolution without loss of quality.
  3. Alien Skin Exposure X

    • Creating analog film photography effects.
    • Supports RAW processing and texture adjustment.

b) 3D and texturing

  1. PixelSquid
    • A plugin for working with 3D objects. Allows you to add and edit objects, rotating them at any angle.
  2. Filter Forge
    • A generator of textures, patterns, and photo effects. Supports creating custom filters.

c) Retouching and portrait processing

  1. Portraiture (by Imagenomic)

    • Semi-automatic skin retouching, removal of blemishes, smoothing, and adding a natural glow.
  2. Beauty Box (by Digital Anarchy)

    • A tool for professional retouching in video and photography.

d) Artistic effects

  1. Flaming Pear Plugins
    • Tools for creating unusual effects, such as simulating reflections in water, spherical distortions (Flood, Flexify).
  2. AKVIS Plugins
    • AKVIS Sketch — converting photographs into pencil drawings.
    • AKVIS ArtSuite — frames and decorative effects for photographs.

2. Plugins for GIMP (a free raster editor)

  1. G'MIC (GREYC’s Magic for Image Computing)

    • A set of more than 500 filters: blur, textures, artistic effects, sharpening enhancement.
    • Works through the built-in GIMP interface.
  2. Resynthesizer

    • An analog of Photoshop's Content-Aware Fill tool. Allows filling removed areas with content based on the surrounding image.
  3. Liquid Rescale

    • An implementation of resizing that preserves important objects (analogous to Content-Aware Scale in Photoshop).

3. General plugins and effects for working with textures and backgrounds

  1. Digital Film Tools

    • Creating cinematic effects, textures, and filters for photography and video.
  2. ON1 Effects

    • Presets for color correction, vignettes, gradients, and textures. Suitable for photographers.
  3. Magic Bullet Looks (by Red Giant)

    • Applying professional color schemes and effects to create a cinematic style.

4. How to install plugins in Adobe Photoshop?

  1. Download the plugin from the developer's official website.
  2. Move the plugin files to the folder:
    Windows: C:\Program Files\Adobe\Adobe Photoshop\Plug-ins
    Mac: Applications/Adobe Photoshop/Plug-ins
  3. Restart Photoshop. The new plugin will be available in the Filter menu or Window → Extensions.

5. Features of using plugins

  • Compatibility: Make sure the plugin supports your version of Photoshop or GIMP.
  • Free vs. Paid: Many plugins have trial versions, allowing you to evaluate them before purchase.
  • Optimization: Some plugins require a powerful computer, especially if they use AI.

Plugins significantly extend the functionality of editors and simplify the completion of complex tasks

See also

  • Comparison of raster graphics editors
  • Dithering
  • Halftone
  • Pixel-art scaling algorithms
  • Raster graphics editor
  • Raster graphics file formats
  • Raster image processor
  • Raster scan
  • Rasterisation
  • Text semigraphics
  • Texture atlas
  • Vector graphics – a contrasting graphical method

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "computer graphics"

Terms: computer graphics