Theory
Two ways to represent a picture
At the deepest level, there are two ways to represent an image in a computer, and this choice runs through everything: file formats, displays, and how you draw. Either you record the colour of every pixel (raster), or you record the shapes that make up the image (vector).
You have glimpsed this with files and displays; this lesson states it as the core paradigm. Raster graphics is pixels; vector graphics is geometric objects. Each is powerful for different content, and understanding the trade-off is fundamental to the whole subject.
Theory
Raster: a grid of pixels
Raster graphics (also called bitmap) represents an image as a grid of pixels, each storing a colour. The image is literally a rectangle of coloured dots.
Because it has a fixed number of pixels, raster is resolution-dependent: scaling it up beyond its native size stretches the pixels and degrades quality (blur or blockiness). Its memory use grows with resolution (more pixels, bigger data). But raster excels at photographs and continuous-tone images, where colour varies subtly from point to point, exactly what a grid of independently coloured pixels captures. Cameras, scanners, and screens are all raster.
Theory
Vector: geometric objects
Vector graphics represents an image as geometric primitives, points, lines, curves, and shapes, defined mathematically (by coordinates and equations), together with attributes like colour and fill.
Because the image is a set of mathematical descriptions, it is resolution-independent: it can be redrawn at any size with no loss of quality, and simple graphics have small files. Vector excels at line art, logos, diagrams, and fonts, anything made of clean shapes that must stay crisp at any scale. It is less suited to photographs, whose subtle detail is hard to express as shapes. So vector trades photographic richness for perfect scalability.
At a glance
| Aspect | Raster graphics | Vector graphics |
|---|---|---|
| Represents | A grid of coloured pixels | Geometric objects (lines, curves, shapes) |
| Resolution | Dependent (fixed pixels) | Independent (scales freely) |
| Scaling up | Degrades (blur/blocky) | Stays sharp |
| Best for | Photographs, continuous-tone images | Line art, logos, diagrams, fonts |
Quiz
Which statement correctly distinguishes raster from vector graphics?
- Raster stores geometric shapes; vector stores pixels
- Raster stores a grid of pixels (resolution-dependent); vector stores geometric objects defined mathematically (resolution-independent)
- Both are resolution-independent and identical
- Vector is only for photographs
Show the answer
Raster stores a grid of pixels (resolution-dependent); vector stores geometric objects defined mathematically (resolution-independent)
Raster graphics stores the image as a grid of coloured pixels and is resolution-dependent (a fixed pixel count, so it degrades when scaled up), while vector graphics stores geometric objects defined mathematically and is resolution-independent (scales to any size without quality loss). Option A reverses the two. Option C is wrong: they are NOT identical, raster is resolution-dependent, vector is not, which is the whole distinction. Option D is backwards: vector suits line art, logos, and diagrams; PHOTOGRAPHS are better as raster. Pixels (raster) versus objects (vector), and the resolution behaviour that follows, is the core difference.
Think first
How does this raster-vs-vector idea connect files, displays, and drawing?
You have met raster vs vector for files, for displays, and now as a paradigm. How do these tie together? Then tap.
Show the answer
They are all the SAME underlying pixels-versus-objects distinction, appearing at different layers of the graphics pipeline, which is why the idea keeps returning. At the REPRESENTATION level (this lesson), an image is either a grid of pixels (raster) or a set of geometric objects (vector). That choice flows straight into FILE FORMATS: raster representations are stored in bitmap files like JPEG and PNG, while vector representations are stored in files like SVG and EPS, so the file simply records whichever form the image is in. It also connects to DISPLAYS: a raster-scan display naturally shows raster images by refreshing a frame buffer of pixels, while a random-scan (vector) display naturally draws vector line-art by tracing strokes, each display technology matches one representation. And it shapes DRAWING: on the dominant raster displays, even a vector shape must ultimately be converted into pixels to appear on screen, which is exactly what line-drawing algorithms (DDA, Bresenham) and shape-drawing algorithms do, they RASTERISE geometric objects into the pixel grid. So the paradigm unifies the subject: you often DESCRIBE graphics as vectors (clean, scalable objects) because that is efficient and editable, but you DISPLAY them on raster devices, so the computer must rasterise, turn the objects into the right pixels. Understanding that images can be thought of as pixels or as objects, and that we routinely convert between them, is the conceptual spine that the rest of this course builds on. One distinction, showing up in how images are represented, stored, displayed, and drawn.
Summary
Key takeaways
- There are two core ways to represent an image: raster (pixels) or vector (geometric objects).
- Raster graphics stores a grid of coloured pixels; it is resolution-dependent, so scaling up degrades quality.
- Raster excels at photographs and continuous-tone images; its memory grows with resolution.
- Vector graphics stores geometric primitives (lines, curves, shapes) defined mathematically; it is resolution-independent.
- Vector scales to any size without quality loss and suits line art, logos, diagrams, and fonts; less suited to photos.
- This pixels-vs-objects distinction underlies file formats, display types, and the need to rasterise vectors onto raster screens.
- Memory hook: raster is pixels (fixed, photo-friendly), vector is objects (scalable, shape-friendly).