Sub topic 2
What Happens When You Scale an Image
This chapter assumes you know what a screen pixel is and recognize common extensions such as .jpg, .png, and .svg.
Scaling and Resolution
A raster image stores color values in a fixed pixel grid. When you enlarge it, the software must create extra pixels through interpolation. The result can look soft, blocky, or both. Enlarging cannot restore detail that the original file never stored.
A vector image stores paths, points, curves, and styles. When you enlarge it, the software recalculates the shapes for the new size. Edges stay sharp because the image is rendered again instead of stretched from a fixed grid.
<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>The viewBox defines the drawing coordinates. The width and height define its displayed size, so changing the display size does not reduce the path's mathematical detail.
Color Depth and Color Modes
Color depth is the number of bits used to describe each pixel's color. More bits allow more color values and smoother gradients. RGB is the screen-oriented mode using red, green, and blue channels. CMYK uses cyan, magenta, yellow, and black for many print workflows. Converting between modes can change colors, especially bright screen colors that printers cannot reproduce.
Lossy and Lossless Compression
Lossless compression reduces file size without changing image data. PNG commonly uses it. Lossy compression removes detail that is considered less noticeable. JPEG uses lossy compression, so repeated editing and saving can create blocks, ringing, and blurry edges.
Common Raster Formats
| Format | Compression | Good fit |
|---|---|---|
| JPEG | Lossy | Photographs |
| PNG | Lossless | Transparency, screenshots, sharp graphics |
| GIF | Limited color, lossless | Simple animation |
| WebP | Lossy or lossless | Efficient web images |
Common Vector Formats
SVG is a web-friendly, text-based vector format. PDF can contain vectors, text, and raster images, so inspect its contents before calling it fully vector. EPS is an older exchange format for print workflows. AI is Adobe Illustrator's editable project format and may contain both vector and raster content.
Exercise
Which model should you choose for a logo that must work on a business card and a large sign?
Show answer
Choose vector graphics, such as SVG or an Illustrator source file, because the paths can be rendered sharply at both sizes.