[Select]

Application Suite: Paint


 

32 thousand, 64 thousand and 16 million colour sprites

So far we have dealt mainly with sprites with no more than 256 colours. Paint can also create or edit sprites with 32 thousand (16 bpp), 64 thousand (newer form of 16bpp) or 16 million (24 bpp) colours, often called deep sprites.

The formats for 32 thousand and 16 million colours were introduced with RISC OS 3.5, so sprites using more than 256 colours should be backward compatible with all machines from the first RiscPC and A7000 models. However, if you wish your sprites to be understood by older machines, for example, sprites which may be used on machines running RISC OS 3.1, you should not use more that 256 colours. Sprites with 64 thousand colours have been introduced with RISC OS 6.12 and therefore need versions of the operating system later than 6.10.

For the same reason if you are creating sprites that you wish to be 'backward compatible' with older RISC OS operating system versions then it is best to avoid using alpha channels.

There is very little difference in the techniques required for dealing with 32 thousand, 64 thousand and 16 million colour sprites. The most obvious is, of course, the colour selection window. Instead of a window showing a 'patchwork quilt' of all the available colours a standard RISC OS colour picker dialogue is used.

Colour models

With up to 256 colour or 256 'greyscale' monochrome sprites the colour model is always RGB. With sprites containing more than 256 colours, you can choose between four different colour models. A colour model is simply a method of defining or describing a colour. So far we have used only the 'RGB' model which regards all colours as mixtures of the three primaries Red, Green and Blue. This is the model most commonly encountered in computer graphics because it is the way that colours are rendered on a standard colour CRT/LCD monitor. The colour picker provides three slider bars, one for each primary colour. These allow each component to be set at any of 256 positions, allowing full 24-bit mixing.

You can choose a colour by clicking anywhere in the 'colour square' or, of course, by selecting one of the 16 standard RISC OS desktop colours. You can then modify this colour by using the sliders or the 'bump' icons or by typing a value directly into the icons which show the RGB values.

The second colour model is called 'CMYK' which stands for Cyan, Magenta Yellow, Key. This uses four primaries which are the colours of the inks used in colour printing (in both commercial colour presses and in desktop machines). Key, incidentally, is the printer's name for black. You will find this model particularly useful if you wish to prepare graphics for colour printing.

There are several fundamental differences between the RGB and the CMYK models. The RGB model assumes radiant colour; the colours are additive so that 100% of all three primaries is white and 0% of all three is black. CMYK, in contrast, uses reflective colour. The colours therefore are subtracted from white, so that 0% of all four is white, while 100% of the coloured primaries cyan, magenta and yellow (we'll ignore key for the moment) is theoretically black.

The somewhat strange choice of primaries, magenta instead of red and cyan instead of blue, is for a good reason. Originally colour printing used just three primary colours, but it proved difficult to obtain a convincing black by mixing three colours. Better blacks and a wider range of colours were obtained using cyan and magenta than from more conventional reds and blues. Even so, the quality of the black obtained was variable. Moreover, it used so much ink that mechanical problems such as paper buckling ensued. Consequently a separate black ink (key) was added for printing black items and for darkening other colours.

There are some colours that cannot be reproduced exactly in four colour printing. For example, you cannot have a bright 'pillar box' red. The closest approach is the colour obtained by mixing 100% magenta and 100% yellow which is a fairly bright crimson. Similarly the closest approach to a bright grass green is that obtained by mixing 100% cyan and 100% yellow. To get a deep blue, mix 100% cyan and 100% magenta, but when printed this colour tends towards purple. You really need a colour printer to try these out, the colours seen on the monitor screen, even with the primary palette loaded, do not correspond exactly to those on paper.

As with RGB you can enter fractional percentages, making 24-bit colour available using the cyan, magenta and yellow sliders alone. But the presence of the fourth primary, key or black, adds a new dimension to colour creation. There are now 'alternative recipes' for many colours. Remember that if you mix all three coloured primaries in equal proportions, you will in theory create a shade of grey and you could create the same shade of grey by using the same percentage of key and this would print using only one third the amount of ink. In the same way, if you create a new colour consisting of, say, 60% cyan, 30% magenta and 30% yellow, you can replace 30% of each coloured primary with 30% key. In other words, the same colour could be obtained by mixing just 30% cyan with 30% key (and only half as much ink would be used in printing).

The third colour model is called 'HSV' which stands for Hue, Saturation, Value. It is preferred by some users because it is claimed to be the most intuitive of the three commonly found models, mimicking the way in which the human brain perceives colour rather than the way in which it is created.

Hue is the actual colour or wavelength, such as red, purple, green. Saturation is the intensity of the colour. At full saturation the colour is at its richest, at low saturation the colour content is faint, perhaps just a hint of colour within a grey. When saturation is zero, the colour is altogether absent and what remains is monochrome. Value is the overall brightness of the colour. If value is zero, then the 'colour' is total darkness, that is, black. If the value is 100 per cent, the colour may be white (if saturation is zero) or any bright shade of the hue, depending on the saturation setting.

The most recently added colour model is known as CIELab. This model defines every colour that the other models between them support, but whereas some of the other models can represent a colour that others can not, CIELab can represent any colour from any of the other models, it can even represent colours outside of the range that the human eye can perceive. This complete coverage of colour space makes CIELab a good choice for conversion between one model and another and allows the best possible translation with minimal loss of information.

The slider to the right of the square equates to the 'L' parameter of Lab and represents the Lightness of the colour to be chosen, the other sliders are the 'a' and 'b' parameters which are purely two dimensional co-ordinates within the imaginary three dimensional colour space described by CIELab.

Finally there is another way of choosing colours, via a palette. A new option introduced along with CIELab in the latest version of RISC OS, allows the user to choose from one of three palettes. The three palettes are RISC OS 256, Web 216 and SVG 1.1. The advantage of these are that you can directly choose colours from these palettes even when in a deep colour sprite. This means that you will be safe in the knowledge that the correct colour will be chosen from the available colours and it will therefore be as accurate as possible when output.

RISC OS 256 will select the appropriate colour for correct display in 256 colour RISC OS displays.

Web 216 allows selections from the web safe colours that were originally defined for use in Web browsers.

SVG 1.1 uses the named colours defined for SVG and that means these can be referred to by their names rather than being converted to say RGB.

Next


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)