Graphics on the ARM
Another RISCWorld exclusive serialisation.
As mentioned in the last chapter, numerous art packages have been published for the ARM machines since the very earliest days. One of the first was Clare's Artisan which rather unusually was confined to mode 12 and which used dither patterns to provide more than that mode's 16 colours. Its successor, ProArtisan, which uses mode 15 (256 colours and fairly high resolution at 640 x 256 pixels) still enjoys considerable popularity. Many other art packages have been similarly restricted to mode 15, which needs a comparatively miserly 160 Kbytes of screen memory and therefore is suitable for 1 Mbyte machines.
This chapter examines the capabilities of three fairly recent contrasting art packages. The first is Simon Hallam's ARCtist from the Fourth Dimension, well known for their high-quality games software, which is limited to mode 15. The other two packages are somewhat unusual in that they will run in any desktop mode. Art20 from Tekoa Graphics, a package which, unusually, was originally designed to run in mode 20 (16 colours and 640 x 512 pixels) and Revelation 2 from Longman Logotron was designed to run in all desktop modes. All three packages offer sophisticated facilities not found in Paint.
Like many art packages ARCtist is restricted to mode 15; it temporarily jumps out of the desktop environment and grabs the whole screen. This is not to evade the niceties of RISC OS, but to allow the full extent of the screen to be used for the artwork; if the artwork were contained in a conventional window (as in Paint) the top, bottom and right-hand edges would be hidden by the window frame. Although scrolling would make all of it accessible, you would never be able to see all of your picture at once. The package does partially multi-task in that it allows you to exit to RISC OS at any time, whereupon you will find any other installed RISC OS applications still as they were when you started ARCtist, and if you return to ARCtist you will find your artwork still intact.
Another point of interchangeability is that ARCtist has no file format of its own; all artwork is saved in standard RISC OS sprite format and, as such, can be loaded straight into Paint or any other applications which use sprites, including DTP packages. There is also a facility to save any rectangular area of the screen as a sprite. ARCtist is menu-driven, the menu of 19 items plus colour selector normally appearing down the left-hand edge of the screen. You can toggle the menu on and off using ADJUST, allowing you access to the area of the screen hidden beneath it. Also you can edit the list of menu items, eliminating any which you never use. The menu philosophy is that you click SELECT once over an option to select it and double-click to call up a menu of options.
The colour selector seems at first sight impossibly small, each coloured square being just four pixels wide and two high. In fact this does not really matter at all; the selected colour is displayed in a large rectangular pane just beneath the colour selector. Colours are selected by clicking MENU; whichever colour was beneath the pointer when MENU was clicked becomes the selected colour whether that colour was in the colour selector or anywhere on the screen. The trick with the colour selector is to hold MENU down and move the mouse around until the colour you want appears in the current-colour pane. But if you decide you must have something larger, the palette option on the menu puts a much larger and more logically arranged palette on the screen.
The zoom is unlike standard RISC OS zooms. It allows you to drag a small rectangle around the screen while a larger rectangle in one corner of the screen displays the area in the small rectangle at four times natural size. It does have the advantage that you can simultaneously see the detail at its natural size and at a size that is big enough to allow fine editing. Moving the pointer into the enlarged rectangle allows you to carry on using tools at the higher magnification
Unlike Paint, ArcTist offers two kinds of erase facilities. One is an undo function which reverses the effect of the last operation, although some complex operations cannot be undone. The other is a 'rubber' which simply paints the screen in whatever background colour you have chosen. (You can nominate any colour as the background colour; the screen will be filled to this colour.)
The spraygun offers a splendid range of facilities. On its coarse setting it sprays the currently selected colour like the spraygun in Paint. On its default 'shade' setting it sprays shades of the current colour, reading the colour at present on the screen and choosing the most appropriate shade; this gives gentler and more controllable effects than the coarse setting; in fact it acts almost like anti-aliasing, giving the effect of a spray that is finer than mode 15 can manage. The size of the spray area can be adjusted and a thoughtful provision is a 'masking tape' option which allows you to protect precious details from the effects of the spray.
The Draw tool is like the brush tool in Paint. By default this tool sets not individual pixels, but quite a large circular area. There is a choice of shapes, including user-definable ones, and an infinitely variable range of sizes down to single- pixel level. So you can change individual pixels or flood huge areas of screen just as you please. There is also a choice between straightforward colours or patterns. A dozen predefined patterns are supplied-you have to load them from disc-and you can grab areas off the ARCtist screen to use as patterns or create them in Paint - a further benefit of using standard sprite file format.
The line tool and all the outline tools-triangle, rectangle, polygon, circle, ellipse and curve - all draw lines one pixel wide in the currently selected colour. All are straightforward to use and depend on clicking SELECT in two or three spots. The circle is created as in Draw by clicking in the centre and drawing out the circumference until correctly sized. The polygon begins exactly like the circle, but when correctly sized you convert it to a three-, four-, five-, six-, seven- or eight-sided figure by rotating a handle from the centre. The ellipse tool works like that in Draw but after setting its major and minor axes on the second click you can rotate it and fix its orientation with the third click. The curves begin as straight lines but can be pulled away from the straight into arcs.
The text facility in ARCtist is remarkably sophisticated. Its own outline font system, quite independent of the Acorn system, allows it to produce perfectly shaped text at any size and in any colour or having a pattern in place of a fill colour.
The fill option determines whether solid operations like drawing and writing text are carried out in a colour or a pattern. Having selected fill, clicking anywhere in the screen will locally replace the colour where you clicked with the current colour or pattern. This is useful as it allows you to draw polygons with one outline colour and fill them with a different colour. It also allows you to grab a portion of the screen and use it as a pattern for fill purposes.
The tools option provides a comprehensive collection of editing facilities including both coarse and fine copying and moving of parts of the screen-the area concerned need not even be rectangular-rotate (called 'spin') an area, and rescale an area, the x- and y-axes being separately scaled.
Some of ARCtist's most sophisticated facilities are found in the Effects menu. Quad Map, for example, allows you to define a rectangular area of the sprite and subjects it to the same kind of transformation that we have come to associate with mould facilities in vector graphics. You can drag the four corners to new positions and create perspective and other effects. Edge Detect works in a user defined area and searches for the borders between coloured areas, highlighting them in the currently selected colour; everything else is changed to the current background colour. Trace Colour draws an outline in the currently selected colour around any coloured area. There are two Trace Sprite routines which also trace outlines, but they plot a named sprite rather than in a colour. A Blur effect plots darker pixels around shapes and makes them look blurred. Clean Up is almost the reverse of the spraygun and removes isolated pixels from a defined area. Anti-Alias is similar to blur but uses a wider range of colours; as in ArtWorks and the plotting of Acorn outline font characters it removes 'step' effects by introducing pixels of intermediate shades. There are three versions of a colour swap routine which handle tints in various ways. A HalfTone facility creates dither patterns; it is a colour swap in which only alternate pixels are swapped.
ARCtist has a whole submenu devoted to sprite handling. It can handle up to 30 named sprites which are stored in sprite files in standard RISC OS format. Facilities are provided to copy a rectangular or irregular shape as a named sprite (the irregular shape uses a mask) and to display a named sprite anywhere on the screen with scaling and rotation options. Utilities are provided to rename and delete sprites. There is even a simple sprite animator. Effectively this plots named sprites on the screen at preset locations and intervals, incorporates flight paths to gradually move sprites around and offers loop facilities for repeated action. It does not allow any background graphics.
The System option offers miscellaneous facilities not available elsewhere. One clears the screen to the currently selected colour, wiping out your current painting. Another sends the file to the printer, assuming of course that the appropriate printer driver is installed. The final option returns you to the desktop. Your artwork is preserved and you can return to it by clicking SELECT on the ARCtist icon.
All in all ARCtist offers some very sophisticated facilities, some of which you might be excused for thinking not possible in pixel graphics. Its shortcomings lie chiefly in three areas. Frequently I found myself hankering for a grid or some means of measuring distances. Secondly, now that RAM expansion is readily available for all the ARM machines and many users can enjoy the more consistent high resolution of modes 21 and 28, it seems a pity to be restricted to mode 15. Moreover, on an A5000 the aspect ratio of mode 15 is not right, a circle being reproduced as an ellipse rather wider than high. Thirdly, its filing provisions are limited. Although you can run the main application from a hard disc, all loads and saves must use floppy drive 0 and named directories designated for pictures, sprites and patterns. So you cannot do a direct save to or load from a hard disc or a RAMdisc, But if you are willing to live with these limitations, ARCtist will help make the most of your talent.
Art20 by Australian programmer Raymond Keefe represents a different approach to computer art. Available from Tekoa Graphics, Art20 was originally intended to provide sophisticated art facilities, but operating in mode 20. This mode offers very high resolution (640 x 512 pixels) and is available even on 1 Mbyte machines to owners of multi-sync monitors. It is, however, limited to 16 colours, although the limitations are to some extent overcome by ready access to dithering.
As the program developed, however, it was extended to use any desktop mode. If you choose a mode other than that currently in use, the mode will be changed to that mode when you enter the Paint screen and will be returned to the original mode when you leave it.
Like ARCtist its pictures are assumed to be full screen size, but portions of screens can be saved as sprites. It runs in two modes: a fully RISC OS compliant desktop mode used for previewing and filing operations and a Painting mode used for painting, editing and image processing which takes the whole screen. Subject to sufficient memory it will multi-task happily with other RISC OS software. The art files it generates are standard RISC OS sprite files, fully compatible with Paint and all other applications that use sprite files. It does have some file types of its own, however, used for storing shades, patterns and fills.
The desktop mode is entered by dropping a sprite file on to the application icon, by clicking SELECT on the application icon or by selecting New screen from the icon bar menu. The latter two options lead to a dialogue box which prompts for the required screen mode and opens a plain window. Dropping a full-screen size sprite file on to the icon leads to a dialogue box which asks whether you wish the sprite to be considered as a screen or a sprite. Dropping a smaller-than-screen sprite on to the icon causes the sprite to be added to the sprite library. Art20 maintains a library of sprites which can be used to build up pictures. If a screen is loaded, it appears in the window. If the colours are arbitrary, drag the current palette into the window. Clicking MENU within the window leads to a menu consisting mainly of file save options. The other options display information about the current picture (its mode and size), Paint enters the painting mode and Kill screen is self explanatory; it kills the screen immediately, whether or not your work has been saved.
All painting and design work takes place in the painting mode entered by clicking on the Paint option in the desktop window. This opens a window which is initially empty (unless you have loaded a file) and which fills the whole screen. Clicking MENU brings up the main menu of 11 items, most of which lead to further menus. Incidentally, the ADJUST button acts as an undo button and usually reverses the effect of the last operation, a very valuable feature.
The Palette option concerns fills generally and not just palette colours. Besides access to a palette of the 2, 4, l6 or 256 colours available in the selected screen mode, a further palette offers 16 shades, i.e. dither patterns, which are user definable and can use up to 8 colours. Also available are patterns such as bricks, with a facility to design your own if none of those offered is suitable. There is a facility to set the current background colour. A"wide choice of plot style includes NOT AND and NOT OR, useful for special effects. A colour pick option allows you to select the colour under the pointer from anywhere in the artwork. The 256-colour palette has the colours arranged in a very logical sequence of shades; a smaller palette is also available if the full-size one obscures too much of the painting.
The Pen option offers a vast range of pens, brushes and other tools, The choice is point (.i.e. single pixel), dot (i.e. circular brush), ellipse, triangle, diamond, square, rectangle, tall brush (.i.e. tall rectangle), wide brush (wide rectangle) and fast and slow spray. All (except the point option) are offered in infinitely variable sizes.
The Line option offers a choice of single or joined lines, continuous or dotted patterns and, a feature rarely found in pixel graphics, infinitely adjustable line width.
The Shape option offers a choice of circle, arc, segment, sector, ellipse, triangle, square, rectangle, parallelogram and polygon (3 to 12 sides). All are produced with one-pixel outlines, but a fill option makes them solid. Two thoughtful provisions are a rotate option which allows the finished shape to be rotated and a move option which allows the finished shape to be moved around until correctly located.
The Flood option provides a wide range of features. Simplest is a direct colour replacement whereby the area in which the pointer is located is changed to the currently selected colour or dither pattern or pattern. But there is also a wide choice of graduated fills adjustable in gradation direction, choice of colours and rate of change. There is even a radial fill. There are also options to force a named sprite into an area.
Text facilities, as in Paint, are limited to the system font. But it is scalable in both axes and may be in the full range of colours.
The area option leads to a diverse range of options concerning areas of the artwork. These allow an area defined by the user (the usual box drag routine) to be filled with a colour or pattern, copied, moved, scaled, reflected, rotated, distorted into a circle or semicircle and subjected to colour swaps. Three fascinating features are soften, sharpen and mosaic. Soften uses a Gaussian filter to reduce the amount of detail in the area by changing isolated pixels and adjacent pixels to their average colour, giving a blurring or smearing effect. It is ideal for enhancing the grainy images sometimes obtained from video digitisers. Sharpen uses the same type of filter to introduce subtle changes to the colours of pixels to highlight detail. Mosaic converts the affected area to a pattern of 'super-pixels' of user-defined size, making them the colour of the original pixel nearest the centre of the area covered. You have probably seen a similar effect used on television sometimes to conceal the identity of an interviewee.
The sprite option provides a host of operations on sprites. Like ARCtist, Art20 supports a user sprite area. Sprites can be added to it at any time by dragging them on to the application icon. Sprites can be added to a picture even if there is a difference in screen mode. The original palette colours will be reproduced as closely as possible, but pixel shape differences are not taken into account. Thus a mode 15 sprite introduced to a mode 21 screen will appear to be squashed into half its original height, but you can always re-scale it. Similarly, rectangular areas of a picture can be grabbed and designated as sprites. While the sprite option is selected, moving the pointer around the screen drags the currently selected sprite and clicking SELECT plots it at the pointer position. The Sprite menu provides all the expected facilities for scaling, reflecting and deleting sprites. The Combine menu usefully allows interesting ways of plotting sprites on the screen such as plotting alternate columns or rows; this produces a 'ghost' effect, since the detail beneath will still be partially visible. An Add feature adds two screens to produce the best ghost effect.
The Pixel Edit option provides the only zoom facility in Art20, all other options being performed at normal size. Zoom factors are up to 16:1.
The Mouse option offers a choice of mouse speeds. The default in Art20 is 1 which means that the pointer moves very slowly indeed.
One major facility was missing from early versions of Art20-printing. But since the resulting artwork is saved as a standard sprite file, it can be imported into Paint or Draw for printing, or indeed the file icon can be dropped straight on to a printer driver icon.
With its vast range of facilities, flexibility of screen mode and use of standard sprite files, Art20 could be said to be a true alternative to Paint itself. Its principal limitations are that it cannot create or edit sprites larger than screens. Also I should have been grateful for a visible grid or other measuring system (although there is a grid lock). Anyone who works with pixel graphics will find this software very valuable.
Longman Logotron's Revelation 2 cleverly combines remarkable sophistication with commendable simplicity. Developed from the earlier Revelation, it is now supplemented by Revelation Imagepro which has greatly enhanced image processing facilities, although Revelation 2 itself is by no means lacking in this area. Like Arctist and Art20, Revelation 2 creates standard Acorn sprite files, compatible with Paint and DTP packages. Like Art20 it will operate in any desktop screen mode, but some of its facilities are available only in 236-colour modes. Users are advised not to change screen mode while work is in progress, but mode changes are nevertheless permitted, Revelation 2 issuing a warning that a degradation in picture quality and facilities available may result.
There is some new terminology to master. Clicking SELECT on the application icon calls up the Page size dialogue box; pictures are called pages. The default page size is 9.03 x 7.22 cm which is approximately a quarter of a screen. Alternatively you can request a full- screen-size page or you can define your own page size by dragging the edges of the page area or clicking in the appropriate squares of the page definition grid. If you have a printer driver loaded or have another page window open, other ready-defined page sizes will be offered.
Revelation 2 works in a choice of two operating modes, special and RISC OS; both allow multitasking with other applications (if there is enough memory). In practice, the differences are subtle. In its special mode the main menu is given its own window which can be moved about or sent back, but not closed. Submenus can similarly be torn off and left permanently open. In the desktop mode the main menu is accessed when needed by clicking MENU with the pointer in a page window and this and the submenus are closed automatically after use. The page window follows all the familiar RISC OS desktop conventions. A thoughtful touch is the provision for left handed users which reverses the effects of the two outer buttons of the mouse, so that SELECT operations are easily accomplished with the index finger of the left hand.
Subject to the availability of memory, many pages may be open simultaneously and a New view facility allows you to open more than one window on to the same page.
Clicking SELECT on the Tools item in the main menu calls up a graphical display of tools not unlike that in Paint. The currently selected tool is indicated by a boundary box.
Five of the tools put colour on the page. The distinction between the brush and the crayon is subtle; the crayon creates continuous lines and the brush creates individual 'blobs' in the currently selected colour. If you drag the brush slowly, however, its blobs become a continuous line like that from the crayon. The spraygun creates a random cloud of pixels whose density can be controlled by varying the time you hold down SELECT or by adjusting a Density Slider. Incidentally all three tools are affected by the current selection in the Mark menu. This determines the si/e and shape of the blob deposited by the brush, the area sprayed by the spraycan and the width of the line made by the crayon. There is a choice of six square marks (the smallest being a single pixel), seven circular ones and six user-definable ones. Usefully the movement of these tools is affected by the direction constraint lock, which will limit movement to vertical or horizontal strokes.
The roller tool is particularly versatile. It is concerned with the filling of areas, that is shapes having a continuous boundary of differently coloured pixels. When this tool is selected, the direction lock is changed to a display which cycles through Normal fill, Fill to Boundary and Gradation as you click SELECT. Normal fill is a standard flood fill which fills the area containing the pointer with the currently selected colour. Fill to Boundary works in the same way, but only recognises boundaries whose pixels are the currently selected colour; other boundaries are ignored. Gradation is only available in 256- colour modes. It produces linear or circular graded fills and a Randomise facility allows the steps in the gradation to be blended into each other so that it appears infinitely smooth. The colour sequence in the gradation can also be edited. A Change all facility allows the roller tool to replace every pixel on the page of the colour beneath the pointer with the currently selected colour.
The drawpen provides a range of line drawing facilities including elastic straight lines and curves and a diversity of geometrical figures including squares, rectangles, triangles, parallelograms, circles, ellipses and regular polygons from 3 to 16 sides. Shapes are hollow by default, but by clicking on them again they become solid. The drawpen is unaffected by the Mark menu, but has its own line width slider allowing a choice of line width from thinnest possible to 64 OS units. There is also a choice of three line end and joint styles.
The scissors tool allows rectangular portions of the page to be cut and copied. The knife tool works in the same way but allows irregularly shaped areas to be cut. The area selected using scissors or knife is stored as the current 'motif and can be viewed by clicking on the Motifs option of the main menu. You can copy the motif back into the page using the Paste tool. In this way you can build up multiple copies of part of the page.
The Paste facility itself offers a wide range of options. Blend allows underlying colours to show through the motif being pasted. Flip mirrors allow the motif to be flipped vertically and horizontally. Rotation allows it to be rotated and a lock facility constrains rotation to steps of 5 degrees. Motifs can also be scaled before pasting by dragging a box in the page window.
Motifs are conventional sprites which Revelation 2 uses in a special way. They may be used to fill an area with a pattern rather than a simple colour. The size of a motif is immaterial. It may be a dither pattern consisting of only four pixels. Alternatively it may be a whole picture in itself. A selection of dither patterns is supplied in a Motifs directory with the package and you can easily supplement this selection with new ones of your own devising, As we have seen, motifs may be pasted-in this operation they are deposited individually at the pointer position. But a motif can also be selected as the current colour and will then be used instead of a single colour for most operations that use the current colour. Most usefully, the roller tool will fill an area with a motif, repeating it as many times as necessary, an operation called, aptly, 'motif tiling'.
The Effects tool offers five image processing operations: Trace, Edge, Blur, Sharpen and Dither. All except Dither offer three levels of sensitivity. All effects are confined to an area in which you drag an elastic box. Trace and Edge both detect the edges of coloured areas and draw them in the current colour, Trace replacing the present colours with a white background and Edge simply adding the boundaries to the existing image. Blur softens and smooths the image and Sharpen enhances contrast. Dither renders the area as a pattern of dots; if a motif is the current colour, Dither confines itself to the colours used in the motif. It can be used to reduce the numbers of colours used in an image in preparation for printing or use as a textile pattern.
The Ruler tool provides a valuable set of measurement facilities, making Revelation 2 suitable for the kind of design work that would normally be the province of vector graphics packages. The Measure option in the main menu allows you a choice of inches, centimetres or Screen units (OS units). When the Ruler is selected, an x and y co-ordinate display is added to the main menu. You can set a point and then by moving the ruler to another point, you can read the distances and the angle from the first point to the second. You can also select an angle as your datum and measured angles will be relative to this. A measurement display is also available with drawing tools.
The Colour pick tool provides an alternative means of selecting a colour. It will pick colours out of any page or from the colour menu. The hand scroller allows you to move easily around a page that is too large to fit in the screen.
Support for colour in Revelation 2 is second to none. Besides the palette colours appropriate to the current screen mode and the dither patterns available as motifs, a mixing palette is available in which you can mix your own dither patterns (in any screen mode) and your own blends (in 256-colour modes). 'The mixing palette is very simple. It is a miniature 'page'-a scribbling pad if you like-in which you can use any of the tools or effects to experiment with colours. You select from it using the Colour pick tool or you can cut a dither pattern for use as a motif.
In 256-colour modes several additional facilities are available. For instance, eight colour washes (white, yellow, cyan, green, magenta, red, blue and black) are available from the colour menu. These are effectively transparent colours. Applying a black wash over an area darkens it and a white wash lightens it, w^bile a yellow wash gives a yellowish cast (as from a tungsten lamp). You may apply a wash over the same area several times to make the effect stronger. Black washes are ideal for simulating the effect of shadows.
A Colour shift dialogue box allows adjustments to the colours in the current page. These changes may be applied either globally (to the whole page) or to the current 'colour set' (that is the current colour selection if a motif or a wash) or to all colours except the current colour set. A colour can be adjusted in various ways including gradually shifting it towards another colour, or adjusting its saturation and darkness. A useful facility is 'posterisation' which gradually reduces the total number of colours on the page. A negative facility which creates a negative image of the page.
When a page is active, its name appears as an item at the head of the main menu. This leads to a selection of operations affecting the current page. These include a valuable Undo facility, zoom (from 1:4 to 8:1) and New view -which allows windows on to the same page at different zoom settings. It also accesses the Print and Save facilities.
Two options from the Motif menu warrant mention. The Pattern option leads to a Patterns dialogue box which otters various tiling patterns. This allows you to build up pages using motifs in various orientations and various offsets. This will be valuable for designers of repeating patterns, e.g. for textiles and wallpaper.
The other option is Text. Unlike many other art and pixel graphics packages, Revelation 2 allows you to incorporate text using the outline font system as well as the System font. You should first ensure that the required colour is selected; if a motif or a wash is selected, the colour will be assumed to be black. You enter your wording in a writable field, select the required font name, height and width and the text in the chosen style becomes the current motif and can be used like any other motif or colour.
Certainly, in its versatility and its subtle simplicity Revelation 2 is streets ahead of the competition. It sets new standards against which future art and pixel graphics packages will be judged.