Sub topic 10
Strengths and limitations side by side
This chapter assumes you know how a raster image stores a grid of pixels and how a vector image stores paths, points and styles. It also assumes you know that raster images depend on pixel dimensions and vector images do not. Here you will compare the two models on the points that decide real projects.
The core difference in one view
A raster file records what each pixel looks like. A vector file records how to draw shapes. Nearly every strength and weakness below follows from that one choice.
| Concern | Raster | Vector |
|---|---|---|
| Scaling up | Blurs or shows blocky pixels | Stays sharp at any size |
| Scaling down | Works, but loses detail | Works, but fine strokes may need adjusting |
| Photographic detail | Excellent | Poor, needs huge numbers of shapes |
| Flat color and clean edges | Fine, but edges can look soft | Excellent |
| File size | Grows with pixel count | Grows with shape complexity |
| Editing | Change pixels, often destructively | Change shapes, colors and curves individually |
| Typical formats | JPEG, PNG, GIF, WebP | SVG, PDF, EPS, AI |
Where raster wins
Raster handles continuous tone. A photo of a mountain lake has millions of subtle color shifts, and no small set of shapes can describe that. A grid of pixels records it directly, and lossy compression keeps the file small.
Raster also supports painterly and textured work, such as brush strokes, film grain, soft shadows and blended gradients. Photo retouching tools work on pixels, so they can change one blemish without touching anything else.
Where vector wins
Vector handles geometry. A logo built from a rectangle and a circle needs only a few numbers per shape, so the file is tiny. Because the viewer redraws the shapes at whatever size it needs, you can use the same file on a business card and on a billboard.
Vector files are also easy to edit. You can select a shape, change its fill, move one anchor point, or swap a font. Nothing is baked in.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="300" height="300">
<path d="M10 80 C 40 10, 65 10, 95 80" fill="none" stroke="#222" stroke-width="4"/>
</svg>Changing width and height to 600 redraws this curve at double the size with no loss. A raster copy would have to invent new pixels instead.
Limitations to watch for
Each model has failure modes. Knowing them helps you avoid common mistakes.
- Raster scaling up. The software must guess at pixels that were never captured. The result looks soft or jagged.
- Raster file size. An uncompressed 1920 by 1080 image at 3 bytes per pixel takes about 5.9 MiB. Large images need compression, and lossy compression can add visible artifacts.
- Raster edits that stack up. Repeated saves in a lossy format such as JPEG degrade the image each time.
- Vector photo realism. A photo converted to vectors needs thousands of tiny shapes. The file can become larger than the photo and still look flat.
- Vector complexity. A drawing with many thousands of paths, filters or gradients can render slowly in a browser or print workflow.
- Vector compatibility. Fonts, effects and special features may display differently in different programs unless you outline text or embed resources.
width, height = 1920, 1080
bytes_per_pixel = 3 # 8 bits each for red, green and blue
size_bytes = width * height * bytes_per_pixel
print(size_bytes) # 6220800 bytes, about 5.9 MiB uncompressedA vector file does not have this formula. Its size depends on how many shapes and points it holds, not on the output size.
A common misconception
Vector does not mean "better quality". It means resolution independent. A vector file with a poorly drawn shape looks bad at every size. A high-resolution raster photo can look far better than any vector approximation of the same scene. Quality depends on matching the model to the content.
Summary
Choose raster when the content is rich in tone and texture. Choose vector when the content is built from shapes and must stay crisp at many sizes. The next chapter turns these trade-offs into a decision process for specific jobs.
Exercise
A client sends a 300 by 200 pixel PNG of their logo and asks for it on a large banner. Explain why the result will look poor, and name the better source file type.
Show answer
A PNG is raster, so enlarging it forces the software to invent pixels, which makes the edges blurry or blocky. A vector file such as SVG, PDF, EPS or AI redraws the shapes at the banner size and stays sharp, so ask the client for the vector original.
Exercise
Why is a photograph usually a poor fit for vector storage?
Show answer
A photo has continuous tone and fine detail, so describing it with shapes needs a very large number of paths. The file becomes large and the image looks flat or posterized compared with a raster photo.