Example :- the binary number 1010 0111 can be written as A7 in Hex.
Like all number systems, Hex digits have place values :-
Hex <--> Binary conversions :-
It is very easy to convert between Hex and Binary and vice versa as each character in Hex code represents 4 bits
Binary to Hex :-
i) we can split any binary number into blocks of 4 bits :- e.g. 1010 0111 splits into 1010 and 0111
ii) use the binary place values to work out the size of the number in decimal;
iii) change the number to Hex -
Hex to Binary :- for the Hex number 3CD4 :-
i) convert each Hex character one at a time into a 4 bit binary number :-
How numbers are represented
In our number system (the Base 10 or decimal) we use only the ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
We can make numbers of any size by giving them values depending on their position - e.g. their place value.
Using the place values of 1000's 100's 10's Units we can easily work out the size of a number - for example :-
Similarly with the Base 2 (Binary) number system we only use the two symbols 0 and 1 and the place values for Base 2 are
Check it out :- (1 x 64) + (1 x 8) + (1 x 4) + (1 x 2) => 78
Integer Numbers
Integer numbers - are all the positive and negative whole numbers - e.g. ..., -4, -3, -2, -1, 0, 1, 2, 3, 4, ... etc.
- for example - for 8 bits the number range would be 0000 0000 to 1111 1111 which is 0 to 255 (28-1)
- for 16 bits the number range would be 0000 0000 0000 0000 to 1111 1111 1111 1111 which is 0 to 65535 (216-1)
The integer numbers that we have considered so far have all been positive numbers, but what about negative numbers.
How does the computer represent Negative Integer numbers?
Using a Sign Bit - this is where the most significant bit (msb - the leftmost bit) in the number represents the sign of the number while the remaining bits represent the size of the number.
- for example a msb of 1 could indicate that the number is negative while a msb of 0 could indicate that a number is positive => 1000 0011 could mean -3 while 0000 0011 could mean +3
Problems with the sign bit system - the sign bit system however does not give us a symmetrical number system about zero where each number in the range differs from the previous number by 1.
This system also gives two values for 0 i.e. 0000 0000 and 1000 0000 and normal arithmetic operations do not give correct results.
The following two's complement representation overcomes both of the above problems.
for example - 1000 0011 would represent -128 +2 +1 => giving -125
and 0000 0011 would represent 2 + 1 => 3
The two's complement representation allows normal arithmetic operations to work correctly.
Changing a number to two's complement form :- e.g. => 1001 0111 represents -105
1) change all 1's to 0's (this is the one's complement) => 0110 1000
2) add 1 to the result (this is the two's complement) => 0110 1001 represents +105
Floating Point (Real) Numbers
Decimal numbers can be expressed in standard form as follows :- 356.78 => 3.5678 x 102
Standard form gives us a compact way of expressing very large and very small decimal numbers.
In floating point format a number such as 356.78 would be expressed as .35678 x 103
The .35678 part of the number is called the mantissa and the power of 3 is called the exponent (power).
Note that the exponent (power) indicates the actual position of the point in the number.
Similarly with Binary numbers :-
for example :- the binary number 11.0101 would be represented in floating point form as :-
In the above diagram the exponent is binary 10 which has the value 2 in decimal - indicating that the actual position of the point in the mantissa is two places to the right (due to the positive exponent).
Note in the above diagram the point is not actually stored and does not occupy one bit - its position is only assumed.
The mantissa represents the digits in the number and the exponent represents the actual position of the point in the number.
This can be written as :-
For a fractional binary number .001101 the representation would be .1101 (mantissa) and -10 (exponent).
Note that the sign of the exponent is negative because the binary number is a fraction so the actual position of the point in the mantissa is two places to the left.
In order to store a number more accurately the number of bits allocated to the mantissa would have to be increased.
The number of significant figures remainsconstant for any particular computer system.
Increasing the number of bits for the exponent increases the range of numbers that can be represented.
How graphics are represented
Bit mapped graphics and Vector graphics
For more colours more bits per pixel are needed - for example :-
Some computer systems can display 16.7 million colours , i.e. 24 bits per pixel allowing 224 colours
Although all images on a computer screen are made up of a grid or array of pixels, i.e. the screen display shows a bitmapped image - note that the images themselves can exist in different forms before they are displayed.
The term 24-bit colour display for modern monitors derives from the RGB (Red/Green/Blue) format used.
The three (RGB) colours are each represented in effect as an 8-bit greyscale which defines their hue/saturation/lightness, (hence 3*8=24 bits)
When displaying images on screen, it is very important to consider screen and video RAM. If we assume that a monitor is capable of displaying a full screen image at a maximum resolution of 1600 x 1200 pixels, using 16.7 million colours, this full screen image takes up (1600*1200*24)/8 bytes, i.e. 5.76 Mb.
This does not necessarily imply that the screen image occupies that full amount of main memory, since modern graphics cards come equipped with generous amounts of their own RAM. While 'good' graphics cards have 16, 32 or even 64Mb of RAM, note that older cards with only 4Mb are not capable of displaying photo-realistic images.
Remember, too, that if you add the storage overheads for 3D images, rotation, lighting and moving video, the memory requirements will be much more than the basic 5-6Mb.
Bit mapped graphics representation -
Bit mapped images are therefore by definition very memory hungry - the more detail and colour displayed in the image on screen => the more memory is needed to store the image. (e.g. higher resolution images use more pixels)
For example, an A4 page with a detailed colour image could use many megabytes of storage space.
Also if you move one bit mapped image overpart of another bit mapped image on screen, it will cause the foreground image to overwrite the background image as they are both trying to occupy the same area of screen memory.
Editing individual images is difficult and time consuming as it has to be processed at pixel level!
As a bit mapped image is represented as an array of bits in memory, when a bit mapped image is printed it can only produce the image resolution on paper that exists in memory.
This means that an image which has been created at 300 dots per inch can only produce an printed image to 300 dots per inch regardless of the quality of the printer.
Vector Graphics :- (sometimes referred to as Object Oriented graphics)
Vector images are limited to fairly simple shapes which are made up of simple geometric shapes (squares, rectangles, circles, triangles, etc).-
Obviously, the more complex an image the more of these basic vectors will be required to store the image, which will have memory implications.
Each time a vector image is moved, reduced or enlarged on screen it is redrawn very fast.
The vectors which describe an image take up very little storage space. Vector images can overlap each other on screen and when separated the two images are intact as they are redrawn every time they are moved.
Scalable character sets (sometimes called vector fonts) can be resized without any loss of clarity as opposed to bit mapped fonts which become blocky when enlarged
(a font is a set of printing or display characters in a particular type, style and size - an example of a scalable font is a TrueType font).
Pixel (bit-mapped) and Vector-Based Graphics Compared
Remember that graphics come in two types, pixel (bitmapped / raster))and vector (object oriented).
Normally, vector graphics are the most economical as regards storage space. However, both types of image may be compressed, with the most effective compression ratios being achieved for pixel graphics. Note that the type of compression used may compromise the image quality.
Vector graphics are also device-resolution independent, i.e. if displayed or printed on a higher-than-normal resolution monitor or printer, an improvement in image quality will be apparent. Pixel graphics, on the other hand, will deteriorate in quality if you enlarge them, the original pixels being represented by larger and larger colour blocks which distort the image.
Below you can see vector graphics on the left, the larger image being a resized version of the smaller. The other two heart images are bitmapped. Again the one on the right is a resized version. You can see that the black outline of the larger bitmap is thicker and more ragged than the original. Also notice the white space in the background. It is not usually possible to isolate a bitmap image from the grid of background pixels, although GIF images, while being bitmapped, are stored with transparency information which allows the background colour to 'show through' selected areas of the bitmap.
Both pixel-based and vector images may be cropped, i.e. unwanted parts of the image can be removed from their edges.
The cropping action is usually non-destructive, i.e. you can reveal the cropped portion again by uncropping.
Compression Techniques
Before we discuss methods of file compression, note that there are several practical steps that you can take to minimise the size of your graphics files.
1. Don't make the image any larger than it needs to be, remembering, of course, that detail may be important.
2. Use the minimum number of colours required for the effective display of your graphic
3. Use a vector-based graphics format in preference to a pixel-based one.
As well as using Huffman Encoding, all common compression techniques use one or other or a combination of the following:-
-
Reduction in the effective resolution of the image (e.g. pixels per square inch)
-
Reduction in the number of colours available per pixel (cf point 2 above)
This means that the compressed image is a compromise between the display detail required and the image's storage requirements, both as regards disk space and manipulation of the image in RAM. Fortunately, modern computer systems are now supplied with very large capacity hard disks and a generous amount of RAM. However, multimedia authoring packages do themselves require a good deal of RAM, so that you would be well advised to keep tabs on both the application's and your image's RAM requirements.
There have been recent developments in mathematical techniques to achieve non-lossy file compression, one of these being fractal compression. This is an alternative method to pixel and vector systems for defining graphics in a computer. Fractal graphics translate the natural curves of an object into mathematical formulas, from which the image can later be constructed.
Creating and Manipulating Graphics Images
Using Clip Art
Nowadays you can easily and cheaply find collections of clip art images available, usually on CD-ROM. These can easily be used in multimedia documents by using your application's Insert or Import functions.
The images may be pixel-based or vector-based graphics - be aware that your choice between these formats may be critical (see below).
One obvious advantage of vector-based graphics is that you can change the colours to suit your destination document.
Using a Pixel-Based Graphics Package
This type of graphics package gives you the tools to draw basic shapes such as line, rectangle and oblong. The shapes may be outline (the background colour shows through) or solid (filled with colour). Using the SHIFT key in conjunction with the basic tools gives you orthoangles and shapes, e.g. if you want a 45 degree angle line, use the line tool while pressing down SHIFT and drag to the 45 degree position. The line will snap in place at the correct angle. Similarly, using SHIFT with the rectangle and oblong tools will give you a square and a circle respectively.
Other tools available allow you to copy or cut portions of the image. This means that you can stitch selected bitmaps together (scanning software often has this feature). You can also create a custom 'brush' from a copied area and use it to replicate the pixel image. It is possible to select and erase/replace particular colours or manipulate the pixels in groups to simulate artistic styles such as 'posterise' and 'pointillism'.
Conversely, an advantage of a pixel-based graphics package is that, if there is a 'blemish' or 'stain' on, say, a scanned image, you can go down to the pixel level and recolour just one area. The same approach can be used to emphasise small detail lost in the scanning process. Photo-editing software is essentially pixel-based, achieving adjustments in contrast, brightness and colour-saturation by manipulating the image at the pixel level.
Using a Vector-Based Graphics Package
All of the tools available in the pixel-based graphics package are available here also, but, because you are dealing with discrete objects, you can edit each individual object separately without affecting the others, e.g. you can change the fill-colour of a square or delete only a triangle leaving the rest of the image undisturbed.
Other tools available allow you to fill objects with textures such as wood, stone or marble and to draw 3D shapes whose facets can be lit (shaded) to give realistic effects.
Operations such as rotating and flipping individual graphics objects, while possible to apply on selected areas of a bitmapped image, are much easier to realise with a vector grahics package and, of course, the operation doesn't leave 'holes' in the complete composition.
Some vector-based graphics applications offer a trace function which attempts to trace the oulines contained in a pixel-based graphic and turn each of the detected shapes into vector-graphics objects. This procedure can be a hit-or-miss affair. With most vector-graphics packages, you will probably also be able to save your graphic in a choice of several different vector formats.
Most modern spreadsheet programs allow you to produce graphs and charts, with the values in the datasheets (or worksheets) being used to plot the graphs. These are usually vector-based graphics images. Note in this connection that an embedded chart (one that is contained in the active workbook) will automatically update itself when the values on the datasheet are changed (there is a dynamic link between the chart and the datasheet values).
A stand-alone chart may also be updated automatically from an external source if you deliberately create a dynamic link between the chart and its original data source. The same is true of any embedded (not just graphics) object which is dynamically linked to its source, e.g. a dynamically linked company logo will always reflect any recent edits made to the graphics image.
Using a Graphics Tablet
You can use a graphics pad or tablet both with pixel-based and vector-based graphics applications. Someone once commented that drawing with a mouse was like drawing with a brick. A specialist tablet with an accurate pen and finely calibrated high resolution drawing area should give much better results for accurate drawing - but be prepared to practise since the technique is different from using the mouse.
What you will find is that, while the mouse uses relative coordinates, i.e. if you run out of desk space, you can pick up the mouse and reposition it nearer you, the graphics tablet uses absolute coordinates. This means, in effect, that if you want to draw an image at the top of the screen, you must place the graphics tablet's pen at the top of the drawing area before you start.
You can obtain a tablet which is pressure sensitive, e.g. the harder you press when drawing with the pen, the thicker a line you will draw.
Using a Scanner
An alternative way of capturing graphics is to use a scanner. These are now of high quality and very cheap (you can buy a new scanner for as little as £20). Note that scanned images are pixel-based, with most modern scanners having a native resolution of at least 600 dots per inch, which is good enough to produce high quality images. A higher resolution than this may be required, e.g. to scan a photographic negative in order to preserve fine detail. For this purpose, scanners with a 'true optical resolution' of 1600 x 3200 dpi and better are available.
Image Capture
The scanner captures the image by gradually moving an array of Charged Coupled Devices (CCDs) down the image and measuring the amount of light reflected from the surface of the paper.
Some scanners can interpolate (insert) extra dots by examining the colours to either side of an existing dot in the image and then intelligently inserting more detail. This approach allows image quality to be in the thousands-of-dots-per-inch range (typically manufacturers claim 9600 x 9600 dpi for interpolated scanning resolution.)
As with scanning text, you may well have to do a pre-scan and then select the images on the page for scanning separately from the text. Again, as for text, the default document format for scanned images is TIFF although you may well be offered the choice of other pixel-based formats.
As for scanning text, you should be aware that copyright rules apply to scanned images in the same way as for photocopied material.
Using A Digital Camera
The digital camera technology is not new as such, but like most areas of computing it is developing at an incredible rate. In the mid to late 90's typical cameras had a resolution of 640 x 480 pixels which was really only useful for 'coarse' photographic images and perhaps Web Page design. Also the memory capacity of these early models was limited and non-upgradeable with the added complication that you needed a computer system to view the 'shots' taken.
With new manufacturing techniques and technology improvements, it is now commonplace for cameras to capture an image in what is described as a megapixel capacity. The cameras tend to come with a range of resolutions available to capture images, with the higher resolution images requiring proportionately more storage. A megapixel image of 1280 x 960 can require as much as 4Mb of storage as a TIFF image, although compression techniques in this and other formats can significantly reduce storage requirements (compressed JPEG images are commonly used)
There are also software interpolation techniques which can take a 1024 x 768 pixel image and 'enlarge' it to 1280 x 960 and consequently provide a sharper image. Most recently, along with the advance of compression techniques and storage capacity, 2, 3, 4 and even 5 Megapixel CCD cameras are appearing. With interpolation, these are capable of a resolution of up to 5 megapixels. This sort of resolution produces photo-realistic images which are ideal for multimedia documents.
The images captured by these CCD cameras are stored in removeable CompactFlash cards (capacity 64 Mb - 512 Mb) or SmartMedia memory cards (capacity 8 Mb to 128 Mb). The number of images they can store varies from 1-16 at a cameras' highest resolutions to 400 at their lowest.
Some cameras accept standard Type I and Type II cards and, since you can get a hard disk (microdrive) version of these, you can extend the storage capacity to 340 MB with the possibility of more storage capacity as the microdrive technology develops.
Special cables are usually supplied for you to download the images via a serial or more commonly, USB connection to your PC. An alternative to this is to install a card reader on your PC and read the data directly from the card swapped from the camera to the PC.
How a Digital Camera Works
The digital camera uses the same process as the digital scanner (see above). The difference is that the digitising process is applied to the whole image at once. This implies a massive array of photo-sensors capable of processing up to 4 or 5 million pixels in real time.
The best quality digital cameras use Charge Coupled Devices (CCDs) for the sensor array but some cheaper, lower resolution cameras use CMOS technology (Complementary Metal-Oxide Semiconductor)