In the last two posts, we explored the connections between computer science, graphics and animation. We observed a parent-child relationship were computer science is the parent, computer graphics is the child and computer animation is the grandchild. Now, I would like to delve deeper into technical aspects of computer graphics, focusing on key concepts that are crucial for understand.

Graphics system

A graphics system is an integrated set of hardware and software components designed to create, manage, and display visual content on a computer screen. Most graphics systems are raster-based, meaning that images are made up of pixels stored in a frame buffer.

A basic graphics system for interactive graphics is compose of:

  • Input devices: Hardware used to transfer input to the computer. Examples include: Mouse, keyboard, joysticks, data gloves, touch panels.

  • Output devices: Devices that display data from the computer’s memory. This data can be in the form of text, video, numeric data, lines, or polygons. The common display type is a cathode-ray tube (CRT), where pixels in the frame buffer are shown as points on the display surface.

  • Memory: Used to store data, information, and instructions.

  • Processor: Also known as the CPU, it is the hardware that performs calculations and executes instructions.

  • Frame buffer: A memory area, also known as the refresh buffer, where the picture definition is stored. This buffer holds the pixel data that is sent to the display device.

Note

For non-interactive graphics the systems graphics change primarly in the absent of input devices or whitout user interaction

Types of Computer Graphics

Based on the interactive we can find two types of graphics:

  • Interactive Computer Graphics: This type of computer graphics allows users to interact with and control images, creating a two-way communication between the user and the computer. Examples include video games, virtual reality (VR) and augmented reality (AR) applications, graphic design software, computer-aided design (CAD) software, simulation software, and interactive data visualization tools.

  • Non-Interactive Computer Graphics: In this type, users do not have control over the images. Examples include static images like art, photographs, or rendered images, as well as pre-rendered videos and animations, infographics, architectural visualizations, and computer-generated art.

Representation of Graphics

The output images generated by computer graphics applications can be represented as either raster or vector graphics.

  • Raster Graphics: These images are presented as a rectangular grid of colored squares called pixels. Raster images, also known as bitmap images, consist of individual pixels that collectively form an image. The more pixels an image has, the higher quality it will be, and vice versa. The number of pixels in an image depends of the file type (JPEG, GIF or PNG)

  • Vector Graphics: These images are represented by continuous geometric objects such as lines and curves. Unlike raster graphics, vector images are not based on a pixel grid. Instead, they use mathematical formulas to draw lines and curves, which can be combined to create complex images.

Vector and raster distinction by The printing connection raster-vector

Some of the differences between raster and vector include:

Aspect Raster Graphics Vector Graphics
Resolution Dependent on DPI/PPI; loses quality when resized. Not resolution-dependent; maintains quality at any size.
Uses Best for digital photos, detailed images, and online content. Ideal for digital ilustrations, logos, and scalable graphics.
File Sizes Generally larger due to pixel data. Generally smaller, relying on mathematical formulas
Compatibility Widely compatible with different software. Requires specialized software for viewing and editing.
Conversion Can be converted to vector with some limitaions. Can be converted to raster, typically without issues.
File types JPEG, PNG, GIF, BMP. SVG, EPS, PDF, AI.

Note

Although vector graphics have many advantages, advances in raster graphics hardware have been significant due to the need for more photorealistic images. This trend continues, especially with the development of more powerful GPUs that achieve unimaginable levels of graphics quality. The focus on improving raster graphics is unlikely to stop anytime soon

Graphics API

According to Marschner & Shirley, an application program interface [API] is a standard collection of functions to perform a set of related operations. A graphics API allows you to perform basic operations such as drawing images and 3D surfaces into windows on the screen. Every graphics program needs two types of APIs: a graphics API for visual output and a user-interface API for getting input from the user.

Currently, there are two main paradigms for graphics and user-interface APIs:

  • Integrated approach: n this approach, graphics and user interface APIs are integrated into portable packages that are fully standardized and supported as part of the programming language. An example is Java’s Swing, which is integrated into the Java ecosystem and provided within the Java Development Kit (JDK).

  • Separate approach: In this approach, graphics APIs such as OpenGL and Direct3D focus on high-performance graphics rendering tied to specific programming languages like C++. However, these API do not inherently include built-in user interface components. Developers need to integrate additional libraries such as Qt or SDL for tasks like interface design.

Graphics Pipeline

The graphics pipeline explains the functionaity of an standard graphycs system. It’s called pipeline because the transformation from mathematical model to pixels on the screen invovles multiple steps.

The graphics pipeline consists of four main parts:

  • Vertex geometry processing and transformation.
  • Triangle processing (through rasterization) and fragment generation.
  • Texturing and lighting.
  • Fragment-combination operations for assembling the final image.

Following I attached a basic graphics pipeline extracted from the book Computer Graphics principles and practice.

pipeline

Note

According to Marschner & Shirley:

  • The graphics pipelines are optimized for processing 3D triangles with shared vertices. Initially, ensuring correct triangle order was a critical research challenge in computer graphics, but it’s now typically addressed using a z-buffer for depth sorting

  • Efficiency in rendering depends heavily on the number of triangles rendered. For interactive applications, minimizing triangle count is often prioritized over maximizing visual fidelity. Additionally, varying the level of detail (LOD) based on viewing distance optimizes rendering performance.

References

Ref.1 = https://www.techtarget.com/whatis/definition/display

Ref.2 = Fundamentals of Computer Graphics - Fourth Edition, by Steve Marschner and Peter Shirley

Ref.3 = https://www.geeksforgeeks.org/videos/graphics-system-in-computer-graphics/

Ref.4 = https://www.allsignscuracao.com/resources/quick_reference/graphic_design.html/title/raster-images-vs-vector-graphics

Ref.5 = https://www.adobe.com/creativecloud/file-types/image/comparison/raster-vs-vector.html

Ref.6 = https://www.printcnx.com/resources-and-support/addiational-resources/raster-images-vs-vector-graphics/