• No results found

PAINT AND DRAW SOFTWARE FOR IMAGES

In document IPT Prelim Text 2nd Edition (Page 137-141)

TOOLS FOR INFORMATION PROCESSES:

PAINT AND DRAW SOFTWARE FOR IMAGES

In Chapter 2, we described two different techniques for organising image data, namely as a bitmap or as vectors. Bitmap images are processed using paint software applications and vector images are processed using draw applications. Be aware that many software applications are available that combine the functions of both paint and draw applications; generally such applications are able to include a bitmap image as an object within a larger vector image.

Paint Software Applications

All bitmap images, regardless of their storage format, are processed within paint applications as uncompressed bitmaps. When a compressed bitmap image is opened it is decompressed and organised into a two dimensional arrangement of individual pixels, each pixel representing a particular colour. The processing performed by paint software alters the colour values of individual pixels. When the image is later saved it is first reorganised into the desired storage format. The organisation of the stored data is often quite different to the organisation of the data whilst it is being processed by the application; this is the case for most software applications not just paint applications. For example, JPEG images for use on the web can be stored in such a way that when downloaded, first a low resolution version of the entire image is received, followed by progressively more pixels until the image appears at its full resolution. This organisation of the pixels reflects the often slow and varying speed of Internet connections.

Bitmaps with a colour depth of 24 bits in most cases use the RGB system where 8 bits are used to represent the intensity of red, 8 bits for the intensity of green and 8 bits for the intensity of blue. The RGB system is used as it corresponds directly to the red, green and blue light used by monitors to display images. As 8 bits are able to represent decimal integers from 0 to 255, each colour has a range of intensity from 0 to 255. Fig 4.2 is a screen from Microsoft Paint where the decimal red, green and blue values can be altered directly. The screen

Fig 4.2

If a bitmap image has a colour depth of 24 bits then each pixel is represented using intensities ranging from 0 to 255 for red, green and blue.

also provides the facility to alter colours using hue, saturation and luminance values.

These values can be entered directly as decimal integers or the mouse can be used on the colour swatch and luminance bar. Moving horizontally across the swatch alters the hue. Hue is the pure colour within the spectrum of light; it ranges from red through yellow, green, blue and then violet. The saturation is changed by moving vertically up and down within the swatch. Saturation is a measure of the dilution of a hue.

Luminance is controlled using the luminance bar and it alters the brightness of the colour. Regardless of the method used to edit a colour it is the red, green and blue RGB values that are used by the majority of paint applications, including Microsoft Paint, to represent the colour of each pixel. Some specialised paint applications use other methods of representation such as the hue, saturation and luminance values (HSL) or CMYK. CMYK is an acronym for cyan, magenta, yellow and key; key really means black, K is used to prevent confusion with the B used in RGB representations. The CMYK system is used within professional printing software applications as cyan, magenta, yellow and black correspond to the primary pigments used on commercial four colour printing presses.

Let us consider the functions included in most paint software applications. For ease of discussion let us assume an RGB system of representation is used. Even moderately sized bitmap images contain thousands of pixels; it would be tedious to alter the colour of each pixel individually. This is what most functions within paint applications do; they alter the colour values of multiple pixels. The processes within paint applications can be broadly split into those that operate without reference to other pixels and those that do consider the colour values of other pixels.

Let us consider examples of processes that operate without reference to other pixels. Most paint applications include a ‘negative’, ‘invert’ or ‘inverse’

function. If this function is applied to an entire bitmap image then every colour value is reversed, this process merely subtracts the current colour value from 255. If a pixel in a 24-bit image has the value 0, 0, 255 then the negative function alters these values to 255, 255, 0.

This would alter the pixel from being full intensity blue with no red or green to being no blue with full intensity red and green, hence the pixel would appear yellow. This negative process could equally be applied to a grayscale image (see Fig 4.3), in this case 8 bits are used to represent the intensity of black for each pixel, again subtracting the current value of each pixel from 255 produces the negative image. Because bitmaps are organised as a two dimensional arrangement of pixels it is a relatively simple task to perform this operation on all pixels or even on a selected group of pixels. Many processes within paint

applications operate in this manner. Consider a fill operation; a group of pixels is selected, a colour is chosen and the fill tool is selected. When the cursor is clicked within the selected area, all pixels within the area are changed to the RGB values of the chosen colour. Similarly pen, brush and shape tools are used to draw a line or shape on the image; once complete the pixels beneath the line or shape are altered to the same RGB value as the currently selected colour.

Fig 4.3

The effect of a negative function being applied to an image.

Processes that do consider the colour values of adjacent pixels require more involved processing. Consider a process that is used to blur or sharpen the edges of objects within an image. Such a process first needs to identify the edges; this involves comparing the colour values of adjacent pixels. If the colour values vary significantly then it is reasonable to assume the edge of an object has been found. To blur these edges requires the colour values to progressively change

over a larger number of pixels than is present in the existing image. To sharpen the edge the number of pixels over which the change occurs is lessened, hence the edge of the object becomes more distinct. Fig 4.4 shows the effect of these processes; on the left is the original line, the middle line is the result after the edges have been blurred and the right hand image shows the result after edge sharpening. Notice the effect on the pixels near the edge of the line compared to the original.

Resizing, stretching or skewing bitmap images involves processes that either increase or decrease the total number of pixels in an image. Such processes require the paint software to estimate new colour values for each pixel. For example, if an original bitmap image has a resolution of 200 by 200 pixels and is enlarged to 400 by 400 pixels then instead of 40,000 pixels we now have 160,000; the number of pixels has increased by a factor of 4. Simple enlargement could just produce a block of four pixels with identical colour values to each of the original pixels or it could average the colour values of adjacent pixels when producing the new pixels. Similarly if a bitmap is reduced in size by a factor of 4 the software averages the colour values of each block of four adjacent pixels to produce each new pixel. In either case the image will lose some of its original clarity.

Draw Software Applications

Draw applications are used to process vector images. Vector images are composed of a series of different shapes, or objects, whose individual attributes or properties can be changed independently. For example, a circle has attributes such as the colour and thickness of the line, the fill colour used and its position and size

relative to other objects. When a new shape is drawn a new instance of an object is created, this object does not affect any existing objects. For example, in Fig 4.5 a square has been drawn on top of a circle, the circle remains unaltered underneath the square. Vector images are therefore structured as an arrangement of different objects where each object is represented as a particular type with particular attributes.

GROUP TASK Discussion

How does the organisation of bitmap data assist paint applications to perform the processes described above? Discuss.

GROUP TASK Activity

Open an image in a paint software application. Try using some of the tools and functions available in the application. List tools and functions that consider the colour of adjacent pixels and those that do not.

Fig 4.5

The complete circle exists under the square.

Fig 4.4

The effect of blurring and sharpening the edges of a line.

As vector images are represented mathematically they can be resized without loss of clarity. Resizing a vector image does not alter the organisation of the vector image data, rather it alters the size of the bitmap used to display the image. Monitors and printers can only display bitmap images, hence a vector image must be organised into a bitmap of the desired resolution prior to display. The mathematical description of each object allows bitmaps to be created at any resolution without loss of clarity;

hence a single vector image can be displayed at the maximum resolution available on the display device.

Processing in draw applications alters the attributes of objects that make up a vector image. Attributes of most objects include; line thickness, fill pattern and colour. Many processes are able to alter the attributes of multiple objects within an image. If a number of objects are selected then it is common for just the attributes present in all the selected objects to be available. Alterations to an attribute are applied to all the selected objects. To simplify this process most draw applications include the ability to group objects together, once grouped then only the attributes common to all the objects in the group can be edited. Furthermore, grouped objects can be repositioned within the image as if they were a single object.

Resizing and reshaping of objects is commonly implemented using handles or nodes.

These nodes are significant points on the object used to determine its shape and size.

On a rectangle or square the four corner points are sufficient to determine its shape and size, these four nodes need only determine the position of each point, joining the points with straight lines creates the shape. More complex shapes use nodes that contain further information used to determine the shape of the line running through the node. Bezier curves are common objects used in draw applications; in fact many clipart images are entirely composed of Bezier curves.

The shape of a Bezier curve is determined by the attributes of each node. In simple terms each node contains two points, an anchor point and a control point. In most draw applications each of these points can be selected and moved using the mouse.

The anchor point lies on the curve, whereas the control point is used to define a straight line to the anchor point. This

line is always a tangent to the curve; it just touches the curve at the anchor point.

Longer lines have more influence over the curve; they appear to attract the curve to them, shorter lines tend to repel the curve. The curve shown in Fig 4.6 is actually two Bezier curves, one from point A to B and another from B to C. The node at B contains three points, an anchor point and two control points. If the curve is to be smooth at B then these three points must lie on a straight line, if they do not lie on a straight line then a sharp corner would be produced. The control point to the left of B determines the shape of the curve as it is produced from B to A and the control point to the right of B determines the curve as it is produced from B to C.

Within many images it is not the actual Bezier curve itself that forms the images rather it is the fill colour applied to the curve that creates the image. Notice that in Fig 4.6 the actual Bezier curve is of a uniform thickness from point A to point C, lines that occur in nature or that have been drawn by an artist are rarely so uniform. On the other hand the filled section of the curve in Fig 4.6 changes more naturally. The original brain image used as an icon for many of the group tasks in this text is entirely composed of filled Bezier curves.

A

B

C

Fig 4.6

Bezier curves are common objects available in most draw software applications.

Consider the following:

Right clicking on a Bezier curve drawn within Microsoft Word opens a menu containing an ‘Edit Points’ function. If this function is selected then nodes appear on the curve, if one of these nodes is then right clicked the screen shown in Fig 4.7 appears. This screen includes settings that can be applied to the selected node (or point). Selecting ‘straight point’

ensures both control points and the anchor point lie on a straight line (point D in Fig 4.7), a smooth point is a straight point where the anchor point is always in the middle of the two control points (point E) and a corner point allows the control points to be moved to any position (point F). Various other attributes of the curve can be edited by selecting ‘Format AutoShape’.

In document IPT Prelim Text 2nd Edition (Page 137-141)