Types of two- and three-dimensional computer graphics
By the way it is created, computer graphics is two-dimensional (2D) or three-dimensional (3D). In 3D graphics the surface of an object is covered with a net of small triangles, then painted, lit and given shadows; this step is called rendering and needs many calculations. Three-dimensional graphics is used in animation, computer games and virtual reality; in a virtual-reality headset a separate picture is made for each eye. 2D graphics has three kinds. In raster graphics the picture consists of pixels in rows and columns: photographs, scanners and phone cameras work this way; its size is the number of columns and rows and its density is measured in dpi. A raster can hold a high-quality photo, but it needs much memory and becomes blurry when enlarged. In vector graphics the picture is stored as a list of simple shapes (segment, circle, curve) and their parameters; it takes little space and keeps its quality when the scale changes, but it cannot store a photograph; fonts are also drawn from vectors. In fractal graphics shapes made of self-similar parts (a snowflake, the branching of a tree) are created from simple formulas; the term “fractal” was introduced to science in 1975.
| Kind | What is stored | When enlarged |
|---|---|---|
| Raster | a grid of pixels | becomes blurry |
| Vector | a description of shapes | keeps its quality |
| Fractal | a repeating formula | is recomputed by the formula |
Looking at a head of cauliflower in a mahalla market, you see that its big florets divide into smaller florets, which divide again, and each piece looks like the whole head. The same pattern repeats at different sizes. On a computer such natural shapes can be drawn with a short rule.
Cartographers, font designers and sign makers use drawings whose quality does not break down when the scale changes.
Draw a tree or a snowflake in your notebook: draw one branch and repeat it smaller and smaller. Is the pattern repeating itself?
| dpi | Width | Height |
|---|---|---|
| 300 | 2400:300 = 8 | 1800:300 = 6 |
| 150 | 2400:150 = 16 | 1800:150 = 12 |
| Vector record | Raster 100×100 | |
|---|---|---|
| size, bytes | 46 | 30 000 |
| enlarged 10 times | unchanged | 100 times more pixels |
“Which graphics?”: the teacher reads a list of pictures (photo, logo, snowflake, tree branching, X-ray image). Pairs show on a card whether each one is raster, vector or fractal and give a one-sentence reason.