Sub topic 11
Choosing the right model for the job
This chapter assumes you already know how raster images store pixels, how vector images store paths, and how each one behaves when scaled. It also assumes you know the common formats (JPEG, PNG, GIF, WebP, SVG, PDF, EPS). Here you turn that knowledge into a decision you can make quickly and defend.
The working model: ask three questions
Most choices come down to three questions about the image.
- Is the content made of shapes or of continuous tone? Logos, icons, charts and flat illustrations are built from clean shapes with solid or simple gradient fills. Photographs and painterly artwork contain millions of subtle color changes that no short list of shapes can describe.
- At what sizes will it be used? If one asset must appear as a favicon and also as a billboard, resolution independence matters. If it only appears at one known size, it matters much less.
- What will happen to the file next? Will someone edit it, print it, animate it, or load it on a phone over a slow connection?
Common use cases
| Task | Best model | Typical format | Reason |
|---|---|---|---|
| Logo | Vector | SVG, PDF, EPS | Must stay sharp from favicon to signage |
| Photograph | Raster | JPEG, WebP | Continuous tone needs per-pixel data |
| Icon set | Vector | SVG | Small files, easy recoloring, crisp at any density |
| Flat illustration | Vector | SVG, AI | Editable shapes, scalable |
| Screenshot | Raster | PNG | Sharp text edges, lossless |
| Textured painting | Raster | PNG, TIFF | Brush texture is pixel detail |
| Print brochure | Both | Vector text and logos, raster photos in one file |
The same page often needs both. A web page can use a vector logo next to a raster hero photo, and both are placed with the same img element:
<img src="logo.svg" alt="Company logo" width="120">
<img src="photo.jpg" alt="Mountain lake at sunrise" width="600" height="400">Check the cost, not just the category
A rule of thumb gives you a starting point. The file size is what confirms it. Uncompressed raster size grows with pixel count, which is why photos need compression:
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 logo like the one below is a few hundred bytes, whatever size it is displayed at:
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" 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>The reverse also happens. A vector with tens of thousands of tiny paths, such as an auto-traced photo, can be larger and slower to render than a JPEG.
Common errors
- Using a raster logo "because it looks fine". It looks fine at the size you tested. It turns blurry when someone enlarges it for a banner. Keep a vector master and export raster copies as needed.
- Saving a photo as PNG. PNG is lossless, so photos become several times larger than the same image as JPEG or WebP with little visible gain.
- Saving a logo as JPEG. Lossy compression leaves speckles around sharp edges and flat color.
- Forcing vector onto photographic content. Tracing a photo gives a posterized look and a heavy file.
- Assuming one file serves every purpose. Keep an editable master, then export for each destination.
Mixed cases
Some images combine both models. A poster with a photo background, a vector logo and live text is a good example. Layered formats and PDF can hold both kinds of content. Choose by element, not by document: each element gets the model that suits its content.
Exercise
A client sends you three assets: a company logo, a product photograph, and a bar chart made of flat colored rectangles with labels. All three go on a website, and the logo must also appear on a printed banner. Which model and format would you choose for each, and why?
Show answer
Logo: vector (SVG for the web, PDF or EPS for the banner), because it must stay sharp at very different sizes. Product photograph: raster, as JPEG or WebP, because it has continuous tone and compression keeps the file small. Bar chart: vector (SVG), because it is made of simple shapes and text, stays crisp on high-density screens, and has a small file size.
Exercise
A teammate exports a 4000 by 3000 pixel photo as PNG and the file is much larger than expected. What went wrong, and what would you do?
Show answer
PNG uses lossless compression, which handles photographic detail poorly. Export the photo as JPEG or WebP instead, using a quality setting that gives acceptable appearance, and resize it to the largest size the page actually displays.