Application Suite: Paint
This chapter is a reference section describing the basic elements of Paint and the tools in detail. It also outlines some of the terms, concepts and basic techniques for creating and editing sprites in Paint
Sprites have the following attributes:
Within the sprite, each pixel has a colour, chosen either from the sprite's palette, if it has one, or the palette for the screen mode it was defined in. If the sprite has a mask, you can use a special value in place of a colour, which indicates the pixel is transparent. When a sprite is painted, the existing screen display shows through the transparent pixels. By setting transparent pixels on the border of a sprite, you can construct sprites which are effectively non-rectangular, although the sprite itself must always be a rectangle.
All of these attributes are defined in the Create new sprite window, which is displayed each time you want to start a new sprite.
Paint has several windows with specialised functions:
Sprite file window
The sprite file window shows all the sprites which are defined in the file you are working on. If you prefer, you can keep just one sprite in each sprite file, though if you are designing sprites for an application you will need to keep them together. Try looking at the sprite file for the Paint application itself. Hold down Shift while double-clicking on the Paint icon in the Apps directory; this will open the application directory Double-click on the Sprites file to load it into Paint. Scroll through the sprite file window to see the range of sprites used by Paint.
The sprite file window shows the sprites at actual size if possible, or in a scaled-down form if they are large. You can edit more than one sprite file at a time; each has its own sprite file window.
Sprite windows are used for creating and editing the sprites themselves. You can have any number of sprite windows on the screen, or none. Each window contains one sprite. Open a sprite window for a sprite by double-clicking on its name in the sprite file window.
Sprite colours windows
Sprite colours windows are used for choosing the colour that you are painting with. There is a separate sprite colours window for each sprite, because different sprites may have a different range of colours available. To open or close the colours window for a particular sprite click on the palette icon in the tool window at the bottom of the sprite window.
The toolbar is normally attached to the left hand side of the paint sprite window. It is used to select and alter the tools you use for painting the picture. If you press MENU on the sprite window and move to the Utilities submenu you will see an item Show tools. If this is ticked the toolbar will be present, if it is not ticked there will be no toolbar.
Editing an existing sprite
To create a new sprite
The tool window
You will already have seen how this changes according to the tool selected, however some items are always present.
At the top left is shown the currently selected colour. This box will not only display the actual colour but also its number (from the colour selection window) and its definition in hexadecimal RRGGBB (red, green, blue) format.
Next to this is a button which will open and close the colour window.
At the top right is the Colour picker button. If you click on this and then click anywhere in the sprite window the colour that you click on will be selected in the colour window. This is very useful, especially with 32,000, 64,000 or 16 million colour sprites, as it lets you quickly re-select a colour you have used previously.
The icons in the lower part of the window set and display the Magnification or Zoom. This doesn't actually alter the size of the sprite, just the magnification for editing purposes.
The main toolbar
To use a tool to edit a sprite:
For operations such as drawing lines and rectangles, you can click ADJUST instead of SELECT. This moves the nearest previously set point to the current position. For example, in the parallelogram operation, clicking ADJUST instead of SELECT at step 3 returns you to step 2, with the first corner taken from the location at which you clicked ADJUST.
While some operations are in progress, a skeleton line or area is shown. You can cancel any of the sequences of operations described below by clicking again on the current tool in the Paint toolbar.
The illustration below shows the toolbar with each button's function indicated. There then follows a detailed description of the operation of each button. Where appropriate the relevant Tool Window which appears at the bottom if the paint window is shown.
To set a single pixel to the current colour, click SELECT over the pixel. To set several pixels, press SELECT and drag the mouse over the pixels. If you move the mouse slowly, a line will be created, but if you move it faster, the line will be broken. You can use this for shading areas of the picture. If you want to draw lines use one of the other tools instead.
If you use ADJUST instead of SELECT the pixels are cleared to the first colour in the palette. This is normally black by default except for 16 colour sprites where it is white by default.
Use sprite as a brush
This tool takes a sprite (not the one you are working on) and makes it into a 'brush'. Four simple brush shapes are provided:
Type in one of these options in the writable box and click on OK to select this simple brush shape.
However, you are more likely to want to use a sprite of your own to paint with. These could be single objects placed with a single click, like the sheep and house used in the tutorial, or patterns that you can drag over an area. Normally, you will want to give the brush sprite a transparent mask so that the shape does not appear with an unwanted surround.
There are two ways of using a sprite as a brush.
The example below can be created as follows:
The toolbox displays a box in which you can set four features:
When you have entered the values you want, click on Set Brush.
To replace one colour by another in a sprite (also called flood fill):
Colours can be changed locally or globally. In a local change, the pixels that are changed are the ones you click on, and any others which are connected to it by pixels of the same colour. In a global change, all pixels in the sprite which have the same colour as the one you click on are changed.
To select local or global changes, click SELECT on the corresponding button in the tools window. The current option is highlighted.
Move whole sprite
To move the entire sprite, press SELECT within the sprite window, drag the mouse to the new position and release SELECT. The parts of the sprite image that move outside the limits of the sprite are permanently lost.
To copy a rectangular block of pixels from one part of a sprite to another:
Step 4 may be repeated to make multiple copies of the selected block. To finish copying, click the Copy block icon in the tools window again. Note that the box you mark is actually rounded outwards to the nearest block of pixels that encloses the box.
Copy block can also be used to create a new sprite from a section of an existing sprite. The new sprite can be set up in one of the sprite files you are already editing in Paint, or it can be saved in an entirely new sprite file, either to disc or for importing into another file or application.
To perform either of these operations, first click on Export area in the Tools window. Then follow steps 2 and 3 as above to mark the block. When you release the mouse, a Save as dialogue box for the block appears. To save the block as a new sprite in a sprite file, enter a name for the sprite, and drag the icon to a Paint sprite file window.
To move a rectangular block of pixels from one part of a sprite to another:
As with Copy block, the box you mark is actually rounded outwards to the nearest block of pixels that encloses the box. Move block can be used to export a block of pixels using Export. This is identical in use to Copy block.
To create a solid line of pixels in the current colour:
To create a rectangular outline in the current colour:
To create a parallelogram outline in the current colour:
The position of the fourth corner is derived from the other three.
To create a circle outline:
To create an ellipse outline:
Circle section outlines
To create a section consisting of a circular arc:
To create a filled triangle in the current colour:
Filled rectangles are created in the same way as outline rectangles.
Filled parallelograms are created in the same way as outline parallelograms.
Filled circles are created in the same way as outline circles.
Filled ellipses are created in the same way as outline ellipses.
Filled circle segments
Filled circle segments are created by indicating the end points of an arc, using the same technique as circle outline sections. The area filled is bounded by the arc and by a straight line between the end points of the arc.
Filled circle sectors
Filled circle sectors are created by indicating the end points of an arc, using the same technique as circle outline segments. The area filled is bounded by the arc and by lines running from the end points of the arc to the centre of the circle.
To insert text into the sprite, first select the text tool. The tools window will change as shown below.
The text is drawn in the current colour.
For those who don't understand what it is, an alpha channel is a type of mask. You will be familiar with 'normal' masks. When a sprite has a mask then any 'unfilled' parts of the canvas are transparent so that the background can be seen through these areas. For example, application icon sprites normally have a mask if they're of irregular shape. With this type of mask the transparency is either 'on' or 'off', in other words you either see the solid colour of the sprite or it's completely transparent and you can see the background. With an alpha channel the 'mask' can have a variable level of transparency, in fact up to 255 levels, so that parts of the sprite can be semi-transparent, that is, you can see the actual sprite but also see the background through it.
The additional option to create an alpha channel sprite can be seen at the bottom right hand corner of the 'Create new sprite' window. When you create a sprite with an alpha channel mask, what happens when you select the mask from the colour window or 'None' as the colour picker is slightly different from what happens with a 'normal' mask.
With an alpha channel mask selected the tool window will appear like this.
Using the 'bump' icons you can vary the saturation of the alpha channel between zero and 100%. This value can also be adjusted using the Alpha settings at the bottom right of the Colour Picker window by selecting the required position on the slider and then clicking on 'None' again. Using the mask in this way and painting with 'None' selected, it is possible to edit the level of transparency of areas of an existing image without modifying the colours.
With the introduction of the Alpha settings to Colour Picker, this provides a much easier way to paint with semi-transparent colours directly in a single operation, rather than editing the degree of transparency after painting, as described above. Both methods of painting have advantages, although directly painting with variable transparency colours is likely to be most useful when creating images rather than editing them.
This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holder's permission. RISC OS is subject to continuous development and improvement as such all information is provided by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.
HTML document version r23142 (3rd November 2015)