Fundamentals · Lesson 4/10

Images & Vectors

Raster versus vector, file formats, ratios, export settings and compression.

5 min read30 of 52

Raster versus vector

When you work with photos, charts, icons, illustrations and other graphics, you need to distinguish two main categories: raster images and vectors.

Raster (PNG, JPG)
Vector (SVG)
Try it: zoom in
Both icons look similar at 1x. Zoom in: the raster one is a grid of pixels and gets blocky, while the vector one is math and stays sharp at any size.

Raster images

Made of pixels, so they have a fixed resolution. They can't be scaled up without becoming blurry or pixelated. Ideal for photographs and complex images with a lot of detail and shading.

Vectors

Made of mathematically defined paths and curves, so they can be resized to any size without losing quality. Ideal for logos, icons, typography and simple illustrations.

Example from my Figma file: Raster versus vector

Resolution

Resolution measures the level of detail in an image. For digital images, it is expressed in pixels per inch (PPI); for print, in dots per inch (DPI). High-resolution images (300 PPI and above) are for print; low-resolution images (72 PPI and below) are for screens. Resolution affects quality, file size and usability.

Example from my Figma file: Resolution

Scalability, file size and editing

  • Scalability: raster images blur when enlarged; vectors stay sharp at any size.
  • File size: raster images are usually larger, because they store every pixel. Vectors are much smaller, because they only store the equations.
  • Editing: raster images are edited pixel by pixel, in tools like Photoshop. Vectors are easy to manipulate by adjusting paths and curves, in tools like Illustrator or Figma.
Example from my Figma file: Scalability, file size and editing
Example from my Figma file: Scalability, file size and editing
Example from my Figma file: Scalability, file size and editing
Example from my Figma file: Scalability, file size and editing

File formats

Raster

The most common raster formats are JPG, PNG, TIFF and BMP. The last two are rarely used for digital assets anymore.

  • JPG (JPEG) uses lossy compression: some quality is lost, but files are small. Great for photographs.
  • PNG supports transparency and lossless compression, but files are larger.
  • WebP and AVIF are modern formats that give smaller files at similar quality. Developers often convert images to them automatically.

I recommend PNG only when the image needs transparency, and JPG for everything else. JPG can be heavily compressed before quality loss becomes noticeable, which means faster loading.

Vectors

Vector files are small and don't need compression. Use SVG, the most standardized and optimized format. If a vector illustration is very complex, with many layers and effects, the SVG can become heavy. In that case, consider exporting it as JPG or PNG.

Ratios and dimensions

The aspect ratio is the proportional relationship between width and height, written as 4:3, 16:9 or 1:1. It defines the shape: 1:1 is square, 16:9 is widescreen. Each platform has its recommended ratios, so design images to match them.

The dimensions are the actual pixels, like 1440 × 720. To find the ratio, divide width by height: 1000 / 750 = 1.33, so the ratio is 4:3.

1440 × 810
Try it: aspect ratio
The ratio fixes the shape; the width sets the dimensions. Height = width × (second number ÷ first number).
Example from my Figma file: Ratios and dimensions
Example from my Figma file: Ratios and dimensions
Example from my Figma file: Ratios and dimensions
Example from my Figma file: Ratios and dimensions

Exporting

Figma exports raster images at 1x (actual size), 2x or 3x. I recommend exporting at 2x so they look sharp on every device, including retina screens. The source image needs enough resolution, or 2x and 3x exports will look blurry.

Example from my Figma file: Exporting
Example from my Figma file: Exporting

Compression

Compression reduces file size, which speeds up loading and improves performance. You only need to worry about it with raster images.

  • For PNG and JPG, I use ImageOptim, and it's free.
  • If a JPG is still too big, save it from Photoshop at quality 6 (below that, quality loss is noticeable), then run it through ImageOptim. The size drops dramatically without a visible loss.
Example from my Figma file: Compression
Example from my Figma file: Compression
Example from my Figma file: Compression

When to compress

Figma struggles with big images, which slow down loading and performance. Compress images when exporting assets for developers, and also before placing them in Figma.

If you compressed an image before inserting it in Figma, keep a copy on your computer or cloud to deliver to developers. Don't export it from Figma again, or you'll lose the compression. When you build flows with screenshots, for example for an audit, compress them all before importing.

Video

To compress video, use HandBrake. It reduces file size dramatically without affecting quality, and it's free and open source.

Quiz

Check what you learned

  1. Which format is best for a logo that must look sharp at any size?
  2. When should you export a raster image as PNG instead of JPG?
  3. An image is 1600 × 900 px. What is its aspect ratio?
  4. At what scale do I recommend exporting images?

Exercise

Prepare assets for developers

Practice exporting and compressing.

0/4 steps done