![]() |
||
![]() |
Magazine flip through pages for a mountain of extra answers |
|
With bitmapped (or, raster) graphics, you store the color for each pixel of the image. Imagine a piece of graph paper with very small grid squares. Doing bitmaps is like making a picture by coloring each square individually, one color per square. You can see that if you try scaling (changing the size) of the image, that you will have to decide how many new squares to color for each old one. This is fairly easy to do if you are enlarging the image by an integer factor (and you don't mind that blocky look); but is much more difficult for non-integer scalings or rotations. It is this difficulty that causes rescaled bitmap graphics to lose detail. Also, everything gets scaled, including edges. Try drawing a simple box and rescale to 200%. You will see that the lines making up the box are all twice as wide as before. Vector graphics are so named because originally what was stored was vector (directed line segment) information. You stored the starting point of the vector, its angle, its length, its color (well, after color came along), and its line width. Early computer graphics displays were vector devices (as opposed to today's displays which are almost all raster devices). If you recall the original Asteroids arcade game, everything looked so angular because it was done all with vectors. Nowadays, since we have a lot more storage and compute power, most vector graphics packages actually deal with many different shapes, including cubic splines, rectangles and ellipses. Basically, you need to be able to reconstruct the object according to a mathematical formula. So, for a circle, you only need to store the center coordinates, the radius, the fill color, the line color, and the line thickness to be able to reconstruct it. |
Scaling
and rotation are much cleaner than with bitmap because what you
do is transform the parameters of the mathematical formula, then
draw from the new formula. Note that this also allows you
to rescale the image without changing the width of the line segments,
which is controlled separately. For these reasons, vector objects
can be rescaled and rotated with much less loss of detail than
bitmapped images. Also, you can select and work with the
objects separately, including moving them in front of or behind
other objects, even when they are overlapping on the same layer.Transforming
from vector to bitmap is pretty straightforward. Once you draw
the The advantages of bitmaps are that you can make and edit much more detailed images, since you can control each pixel, and that restoring an image from disk requires very little computation (nowadays you have to uncompress the image, but once the pixels have been reconstructed very little math processing is required to draw the image). The advantages
of vector objects are that generally they require less storage
than bitmaps (especially for fairly simple drawings), you can
scale and rotate them with very little loss of detail, and you
can manipulate each object separately, even when on the same
layer. |
![]() |
Shape Cat tutorial is an excellent introduction to vectors in PSP. |