1/76
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What are bitmap graphics?
Bitmap graphics (raster graphics) are images composed of a grid of tiny squares called pixels, where each pixel has a specific color and position, forming the complete image.
What is a pixel?
A pixel is a tiny square in a bitmap image, short for "picture element," representing a single color at a specific position.
How is the quality of a bitmap image measured?
By its resolution, measured in pixels per inch (PPI) or dots per inch (DPI). Higher resolution means more pixels and sharper images.
Name common bitmap file formats.
JPEG, PNG, GIF, BMP, TIFF.
What are the pros of bitmap graphics?
Ideal for photographs, detailed textures, and complex images with many colors
Widely supported across software and devices
Easy to edit pixel-by-pixel for fine adjustments (e.g., photo retouching)
What are the cons of bitmap graphics?
Loses quality when scaled up (pixelation)
Large file sizes for high-resolution images
Not suitable for logos or graphics that need to scale to different sizes
Give examples of bitmap graphics usage.
Digital photography (portraits, landscapes)
Textured artwork (digital paintings)
Web images (banners, thumbnails)
What are vector graphics?
Vector graphics are images created using mathematical equations, lines, curves, and shapes, rather than defining individual pixels.
How do vector graphics differ from bitmap graphics?
Vector graphics scale infinitely without losing quality, because they are based on mathematical formulas, whereas bitmaps depend on pixels and resolution.
What are vectors in vector graphics?
Points, lines, and curves defined by mathematical formulas that form an image’s geometry.
Name a common file format for vector graphics.
SVG (Scalable Vector Graphics).
What are the pros of vector graphics?
Perfect for logos, icons, and scalable illustrations
Small file sizes for simple designs
Easy to edit shapes, colors, and paths with precision
What are the cons of vector graphics?
Not suitable for complex images like photographs
Requires vector-compatible software (e.g., Adobe Illustrator)
Can be time-consuming to create intricate designs
Give examples of vector graphics usage.
Logos, icons, typography, and scalable illustrations.
What is a matrix in computer graphics?
A matrix is a rectangular array of numbers arranged in rows and columns, used to represent transformations of objects in 2D or 3D space.
Why do we use matrices in graphics?
They provide a mathematical way to efficiently transform objects (move, scale, rotate) and allow multiple transformations to be combined into a single matrix.
What matrix sizes are commonly used in 2D and 3D graphics?
2D: 2x2 or 3x3 matrices; 3D: 4x4 matrices.
How are matrices used differently in vector vs bitmap graphics?
Vector: Transformations manipulate paths directly, maintaining quality.
Bitmap: Transformations adjust pixel coordinates, which can cause pixelation when scaling or rotating.
What types of transformations are commonly applied using matrices?
Translation (moving), scaling (resizing), and rotation (turning).
What is translation in graphics?
Translation moves an object by shifting its coordinates by a distance (tx, ty) along the x and y axes.
How is translation represented as a 3x3 matrix using homogeneous coordinates?
[ 1 0 tx ]
[ 0 1 ty ]
[ 0 0 1 ]
Example: Translate the point (2,3) by tx=4 and ty=1. What is the new coordinate?
(6, 4) after using the translation matrix and homogeneous coordinates (2,3,1).
What is the shortcut for simple translation?
Simply add tx to x and ty to y (e.g., 2+4, 3+1). This only works for translation.
What is scaling in graphics?
Scaling changes the size of an object by multiplying its coordinates by scale factors (sx, sy).
How is scaling represented as a 3x3 matrix?
[ sx 0 0 ]
[ 0 sy 0 ]
[ 0 0 1 ]
Example: Scale the point (4,5) by sx=3 and sy=2. New coordinate?
(12, 10)
What is rotation in graphics?
Rotation shifts a point around the origin by an angle θ. The transformation involves trigonometric functions (sin and cos).
How is rotation represented as a 3x3 matrix?
[ cosθ -sinθ 0 ]
[ sinθ cosθ 0 ]
[ 0 0 1 ]
What are homogeneous coordinates and why are they used?
Homogeneous coordinates add an extra coordinate (usually 1) to simplify matrix multiplication for translation, scaling, and rotation.
What is the general rule for all matrix transformations in graphics?
Matrix multiplication follows the same pattern for translation, scaling, and rotation. Always multiply the transformation matrix by the point in homogeneous coordinates.
Why is drawing lines on a computer screen important in graphics?
Lines are fundamental for shapes, game visuals, and rendering vector designs on a pixel-based screen.
How are lines represented on a screen?
Screens use a pixel grid (bitmap), so drawing a line involves selecting pixels to approximate a continuous path between points.
What is rasterization?
Rasterization is the process of converting shapes or vector paths into pixels on a grid so they can be displayed on a screen.
What is Bresenham’s Line Algorithm?
An efficient method to draw straight lines on a pixel grid by selecting pixels closest to the true line between two points. Developed by Jack Bresenham in 1962.
Applications of Bresenham’s Line Algorithm?
- Computer graphics (games, CAD, UI)
Vector-to-bitmap conversion (PDFs, SVGs)
Embedded systems (low-power or resource-constrained devices)
Pros of Bresenham’s Line Algorithm?
- Efficient: uses integer arithmetic
Accurate: selects pixels closest to the true line
Simple to implement
Versatile: extends to circles and other shapes
Cons of Bresenham’s Line Algorithm?
- Limited to bitmaps
Slope restrictions (needs adjustment for steep lines)
No anti-aliasing by default (can produce jagged edges)
Why not just use y = mx + c for lines on a screen?
- Screens use a pixel grid, only integer coordinates can be plotted
y = mx + c gives decimals, requiring rounding, which causes gaps or inaccuracies
Floating-point calculations are slower; Bresenham uses integer arithmetic
What is the Midpoint Circle Algorithm?
An efficient method to draw circles on a pixel grid by selecting pixels closest to the circle’s edge. Similar in approach to Bresenham’s Line Algorithm.
How does Bresenham’s Midpoint Circle Algorithm work?
- Uses integer arithmetic to minimize error
Computes one octant (1/8 of the circle) and mirrors pixels to the other seven octants using symmetry
Pros of Bresenham’s Midpoint Circle Algorithm?
- Efficient (integer math)
Accurate (closest pixels to circle edge)
Simple to code
Symmetry reduces calculations
Cons of Bresenham’s Midpoint Circle Algorithm?
- Bitmap-specific (not for vector curves)
Produces slightly jagged circles without anti-aliasing
Only works for circles; ellipses need modified algorithms
What is anti-aliasing in graphics?
A technique used to smooth jagged edges on a pixel grid by blending edge pixels with the background.
Why is anti-aliasing needed?
- Pixels are square, so diagonal or curved lines appear “staircased”
Anti-aliasing softens these jagged edges to make lines look continuous
How does anti-aliasing work?
- Adjusts pixel color intensity based on coverage
Partially covered pixels are blended with line color and background
Common methods: supersampling, multisampling
Difference between bitmap and vector graphics regarding anti-aliasing?
Bitmap: anti-aliasing is crucial to smooth pixel edges
Vector: inherently smooth due to mathematical curves
What is image rendering in computer graphics?
The process of creating a visual image from a digital model or scene by turning data like shapes, colors, and lighting into pixels on a screen.
Where is image rendering used?
- Games
Movies
Digital displays
It produces 2D images from 2D or 3D descriptions.
How can rendering be thought of?
Like the computer "drawing" a picture, deciding the color of each pixel based on objects, their positions, and light effects.
What is rasterization?
A fast method that converts shapes (lines, triangles) into pixels on a bitmap grid, projecting objects onto the screen and coloring pixels based on simple lighting and textures.
Which algorithms are commonly used in rasterization?
- Bresenham’s Line Algorithm (lines)
Midpoint Circle Algorithm (circles)
Pros and details of rasterization?
- Quick and efficient
Suitable for real-time applications (games)
Struggles with realistic lighting (reflections, shadows)
Produces jagged edges without anti-aliasing
What is ray tracing?
A realistic rendering method that traces light rays from the camera through each pixel, calculating interactions with objects (e.g., reflections and shadows).
Common algorithm used in ray tracing?
Whitted Ray Tracing – traces rays for reflections, refractions, and shadows.
Pros and details of ray tracing?
- Produces photorealistic images
Accurate lighting and realistic shadows/reflections
Slow, used in films or high-end games
Enhances realism but less common for simple bitmap tasks
Key difference between rasterization and ray tracing?
Rasterization is fast but less realistic; ray tracing is slow but produces photorealistic results.
Why is rasterization preferred in games?
Because it is quick, efficient, and suitable for real-time rendering, even though it approximates lighting and shadows.
Why is ray tracing used in films or high-end graphics?
It provides realistic lighting, shadows, and reflections for photorealistic visuals, even though it is computationally intensive.
What is lighting in computer graphics?
Lighting determines how light sources affect an object’s appearance, defining its color and brightness on a pixel grid.
Name the three main types of lighting in graphics.
- Ambient lighting
Diffuse lighting
Specular lighting
What is ambient lighting?
Uniform, non-directional light that illuminates all objects equally, providing baseline brightness and preventing areas from being completely dark.
How is ambient lighting applied in rendering?
It’s a simple constant added to pixel colors, used in both rasterization and ray tracing.
What is diffuse lighting?
Light that scatters evenly across a surface, with intensity depending on the angle between the light source and the surface’s normal, creating realistic shading.
How is diffuse lighting calculated?
Using Lambert’s cosine law to determine brightness based on the angle of incidence.
How is diffuse lighting implemented in rasterisation vs ray tracing?
- Rasterisation: computed per pixel for speed
Ray tracing: traced more precisely, accounting for exact light angles and global illumination
What is specular lighting?
Shiny highlights on reflective surfaces, depending on the light source, surface normal, and viewer position.
Which shading model is commonly used for specular lighting?
Phong shading – intensity peaks when reflected light aligns with the viewer’s perspective.
How is specular lighting handled in rasterisation vs ray tracing?
- Rasterisation: approximates highlights for speed
Ray tracing: accurately simulates reflections by tracing light rays
Name some lighting effects in graphics.
- Soft shadows
Global illumination
Caustics
Ambient occlusion
How do lighting effects differ between rasterisation and ray tracing?
- Ray tracing: naturally produces realistic effects
Rasterisation: approximates effects using shadow maps and other shortcuts
What are shadows in computer graphics?
Dark areas created when objects block light, adding depth and realism to a scene.
How are shadows implemented in rasterisation vs ray tracing?
- Rasterisation: shadow maps (fast but less precise, may need anti-aliasing)
Ray tracing: accurate shadows with soft or hard edges depending on light type
How do shadows affect bitmap rendering?
They interact with textures and lighting, requiring pixel color adjustments and careful computation to avoid visual artifacts.
What are reflections in computer graphics?
Simulations of light bouncing off surfaces, adding realism by showing mirrored or distorted images.
Types of reflections and examples of surfaces:
- Specular: mirrored images, polished mirrors, calm water
Imperfect specular: shiny but blurred/distorted, varnished wood, rippled water
Diffuse: scattered light, rough surfaces like stone, paper, clothing
How are reflections handled in rasterisation vs ray tracing?
- Ray tracing: accurately traces rays for realistic specular and imperfect reflections
Rasterisation: uses environment maps (precomputed textures) for faster but less precise reflections
Why are lighting, shadows, and reflections important in graphics?
They make scenes more lifelike, enhance realism in textures and objects, and are used heavily in films and games for visual impact.