Sub topic 1
Raster and Vector Graphics: What They Are and When to Use Each
Prerequisites
This chapter assumes you know what a screen pixel is and recognize common image extensions such as .jpg, .png, and .svg.
How computers represent images
A digital image is data that tells a device what to display. The two main models are raster and vector.
A raster image stores color values in a rectangular grid. A vector image stores instructions for drawing shapes, such as lines, curves, fills, and text. Software converts either model into colored pixels when it displays the image on a screen.
Raster graphics: an image made of pixels
A raster image is a grid of pixels. Each pixel stores a color value. A 1920 × 1080 image contains 2,073,600 pixel positions. More pixels can capture more detail, but they also require more storage.
Raster images are well suited to photographs and textured artwork because every pixel can have a different color. Common raster formats include JPEG, PNG, GIF, and WebP.
Vector graphics: an image made of shapes
A vector image describes geometry instead of recording every pixel. A path is a set of points and curves. Styles specify properties such as fill color, stroke width, and transparency.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
<rect x="10" y="10" width="80" height="80" fill="#2a6fdb"/>
<circle cx="150" cy="50" r="40" fill="#e5484d"/>
</svg>This description can be rendered at different sizes. Vector formats such as SVG, PDF, EPS, and AI are common for logos, icons, diagrams, and clean illustrations.
| Model | Stores | Typical use |
|---|---|---|
| Raster | Colored pixels | Photographs |
| Vector | Shapes and styles | Logos and icons |
Resolution, pixel dimensions and PPI/DPI
Pixel dimensions state the grid size, such as 1200 × 800 pixels. Resolution often refers to the amount of image detail, but it can also mean a print setting.
PPI means pixels per inch and describes image density for screens or layout. DPI means dots per inch and usually describes printer output. Changing a PPI value without adding pixels does not create new detail.
Exercise
Which model is usually the better starting point for a company logo?
Show answer
Vector, because its shapes can be rendered at many sizes without depending on a fixed pixel grid.