Introduction to File Formats
Over time there have been many different file formats for representing graphics. Most are footnotes to history, with only a few ever becoming wildly popular. In this book we talk about the image formats PNG (Portable Network Graphics), JPEG (Joint Pictures Expert Group, the committee that designed the format), and GIF (Graphic Interchange Format); the animation formats SVG (Scalable Vector Graphics), SWF (used by Macromedia Flash), and to a lesser extent GIF again; and the document formats PostScript and PDF (Portable Document Format).
All of these formats fall into one of two camps: raster or vector. A raster image is composed of dots, called pixels. Almost every image on a web page is a raster image, and the PNG, JPEG, and GIF formats are raster formats. The alternative to representing a picture as a series of dots is to represent it as you might draw it, with lines, curves, and filled colors. This is a vector image. The most noticeable difference between raster and vector images is how they scale. If you zoom in on a raster image, each pixel simply becomes a larger and larger spot, which leads to chunky images. A vector image, in contrast, gives infinite magnification.
Each raster file format represents an image’s pixels differently. These formats vary in how much color information they store, whether they can handle transparency in an image, and whether you have to pay to use them. For this reason, not all graphics formats are suited for all jobs. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access