Week 3: Organizing Content with Lists and Images
Learn how to structure information using lists and embed visual media.
Explore Chapter 3Common Web Image Formats
Choosing the right image format is important for balancing quality and file size (which affects page load speed).
- JPEG (or JPG): Best for photographs and complex images with lots of colors and gradients. It uses lossy compression (some quality is lost to reduce file size). Does not support transparency.
- PNG (Portable Network Graphics): Best for graphics with sharp lines, text, logos, and images requiring transparency. Uses lossless compression (no quality loss). File sizes can be larger than JPEGs for complex images.
- GIF (Graphics Interchange Format): Best for simple animations and graphics with limited colors (up to 256). Supports transparency (but not partial transparency like PNG). Often replaced by PNG for static images and video/CSS for animations.
- SVG (Scalable Vector Graphics): An XML-based vector image format. Ideal for logos, icons, and illustrations that need to scale perfectly without losing quality (resolution-independent). Can be styled with CSS and manipulated with JavaScript.
- WebP: A modern format developed by Google offering both lossy and lossless compression, often providing smaller file sizes than JPEG or PNG at similar quality. Browser support is widespread but not universal (check compatibility).
Consider the image content and requirements (transparency, animation, scalability) when selecting a format.