A method of controlling colours of an image in order to print the image
DESCRIPTION Technical field The present invention relates to a method of controlling colours of an image for printing, and is directed towards the conversion of the colours of the image from a first, input colour space to a second, output colour space, according to the preamble to main Claim 1. Technological background
In the technical field of digital colour control on desktop platforms, there is a known requirement to achieve a faithful reproduction of the colours of an image displayed on a computer monitor when the image is transferred (printed) onto physical substrates.
As is known, the conversion of the colours of the monitor image into printer colours is complex since the monitor colour space (the additive mixture of the colours red R, green G and blue B, the so-called RGB space) and the printer colour space (the subtractive mixture of the colours cyan C, magenta M, yellow Y and black K, the so-called CMYK space) are not superimposable . In particular, the RGB colour space is more extensive than the CMYK colour space.
This problem is particularly marked when the image displayed on the monitor is printed on materials other than paper such as, for example, wood, ceramics, textiles, etc. Often, in these circumstances, one or more of the colours constituting components of the CMYK colour space is not available, for example, because this colour may be subject to deterioration during the subsequent processing of the material on which the image has been printed, or because the
basic colour suitable for printing on the specific preselected material does not exist in production.
According to the prior art, when images displayed on a monitor are to be reproduced on such substrates, colour- specialist graphic designers are consulted; the designers modify manually those colour areas of the image displayed on the monitor which, when printed, would be of a very- different colour from that displayed. The original colour is thus replaced by one or more different colours the printing result of which is known and the combination of which reproduces the same visual effect as the original colour.
However, this colour modification operation is very lengthy and onerous and, since it is performed manually, is also difficult to reproduce. Description of the invention
The main object of the present invention is to provide a method of controlling the colour of images for printing, particularly on materials such as wood and ceramic materials, which is designed to overcome the limitations discussed with reference to the prior art mentioned.
This object and others which will become clearer from the following description are achieved by the invention by a colour-control method having the characteristics specified in the appended claims.
Brief description of the drawings
The characteristics and the advantages of the invention will become clearer from the detailed description of a preferred embodiment thereof, described by way of non- limiting example, with reference to the appended drawings, in which:
- Figure 1 is a schematic view of a device for controlling the colours of an image, operating in accordance with the method of the invention,
- Figure 2 is a flow chart showing schematically some of the steps of the method of the invention,
- Figure 3 is a schematic structural diagram showing, by way of example, some of the steps of the method of the invention.
Preferred embodiment of the invention With reference initially to Figure 1, means for controlling the colours of an image 2 are indicated 1 and comprise a computer la on the monitor 3 of which the image 2 is displayed. The file 2a containing the data relating to the image 2 is stored in a memory 4 accessible to the computer la.
A printer 5 for printing images on a substrate 6 of preselected material such as, for example, wood or ceramic material, is also connected to the computer la.
The monitor 3 is of a standard type, that is, with a rectangular matrix of pixels 7 (shown schematically in Figure 3) the colours of which are determined by mixtures of predetermined quantities of red (R) , green (G) and blue (B) components which constitute a base in a first, monitor colour space, that is, the RGB input space. A set of three colour coordinates (R,G,B) is thus associated with the colour of each pixel, each coordinate being given by a number which is variable from 0 to 255 and represents the "quantity" of red, green or blue present in the colour of the pixel in question. The image 2 displayed on the monitor 3 is converted into a multi-channel bitmap file 20 which can be printed by
the printer 5 to produce, on the substrate 6, by the method according to the invention described in detail below with reference to the flow chart of Figure 2, an accurate reproduction of the colours displayed on the monitor 3. According to a principal characteristic of the method of the invention, the user enters in the memory 4, or in an additional memory 13 accessible to the computer la, the components of a suitable base in a second, output colour space (step 100 of the flow chart of Figure 2) which are defined by their RGB coordinates. The components of this base are selected in dependence on the material constituting the substrate 6 on which the image is printed. In particular, the components of the base correspond to non- toxic colours which are not liable to alteration in subsequent stages of the processing of the substrate 6 and are commercially available for the colouring of the selected material . These components of the base of the second colour space correspond to the inks available in the printer 5.
Initially, an image 10 enlarged N times (in Figure 3, N equals 3) is associated with the digital image 2 stored in the memory 4 (step 101 of the flow chart of Figure 2) . In particular, each pixel 7 of the starting image 2 is associated with N2 pixels 7a of the enlarged image 10, each of which is attributed the same colour coordinates (R, G, B) as the pixel 7.
A first pixel Px is then selected in the enlarged image 10 (step 102) and the colour coordinates (R,G,B) of the R, G, B components of its colour in the first colour space of the monitor 3 are determined. The percentage at which each component of the base of the second colour space is present in the colour of the
selected pixel Px is determined (step 103) by a comparison of the colour coordinates (R, G, B) of Px with the stored components of the second colour space. When the percentages present have been determined, the predominant component amongst them, that is, the component having the highest percentage, is identified (step 104) . The colour of the pixel Px is thus identified by means of the percentages of the second colour-space components, that is, new colour coordinates in the second colour space are associated with the pixel Px.
The first pixel Px is thus associated (step 105) with a monochrome pixel PM having as its colour purely the predominant component of the colour of the first pixel Px, that is, 100% of its colour is equal to the predominant component of the colour of )?1.
Other pixels of the enlarged image 10 are also correlated with the first pixel Px and their colours are modified in dependence on the components of the second colour space which are present in the first pixel Px in percentages other than the highest (step 106) . More particularly, the correlated pixels correspond to pixels P^ geometrically adjacent the first pixel Px. If Px is not part of an edge of the enlarged image 10, there are 8 adjacent pixels and only some of them have their colour coordinates modified, as described below. The values of the percentages present other than the highest percentage are divided into a number of fractions equal to the number of modifiable adjacent pixels, that is, those adjacent pixels with which a monochrome pixel has not previously been associated. The colours of the modifiable adjacent pixels are consequently modified by increasing, in proportion to the above-mentioned
fractions, the percentage values of those components which have percentages other than the highest percentage in the first pixel .
Steps 102-106 are then repeated for a plurality of pixels 7a included, for example, within a predefined area of the enlarged image 10, or for all of the pixels of the enlarged image 10 (step 107) , so as to obtain a second image 15 formed exclusively by monochrome pixels PM in the second colour space . The pixels 7a are selected sequentially, starting with a pixel having a predetermined arbitrary position and continuing with the selection of the pixels 7a disposed along a row.
In the monochrome image 15, all of the pixels PM the colour of which is given by 100% of the same component are selected and a bitmap channel 19 is created for them (step (108) . This step is performed for all of the components of the second colour space and a number of bitmap channels, all indicated 19, equal to the number of components the second space is thus created. Each bitmap channel 19 is constituted by a matrix with a number of pixels Pc equal to that of the enlarged image 15. For each pixel Pc, there is a corresponding bit which may have only two states: white or black. A bit associated with a pixel Pc of a bitmap channel 19 of a predetermined component is black if the corresponding pixel PM in the same position in the monochrome image 15 has a colour given by 100% of the component of the bitmap channel; otherwise it is white.
The above-mentioned plurality of bitmap channels is combined in a single multi-channel bitmap file 20 (step 109) .
The resolution is then reduced N times, thus changing from bitmap to grey scale (step 110) . In other words, a single pixel is associated with N2 pixels of the multichannel bitmap 20 and its colour is given by the superimposition of the colours (white or black) of the N2 starting pixels.
The multi-channel bitmap file 20 is then sent to the printer 5 for printing on the substrate 6.
A practical example of the colour control of a pixel of the image 2 by means of the above-described method according to the invention is shown schematically in Figure 3. The components of the base of the second colour space are given by: C(0,200,255) , M(200, 0, 127) , 0(200,40,0), Y(255, 200, 0) , G1 (0,200,0), K(0,0,0). This base is used particularly for vinyl-sheet and ceramic substrates 6.
The preselected image 2 is enlarged N=3 times to produce the enlarged image 10.
The pixel 7, which is assumed to belong to a corner of the image 2, with colour coordinates (R,G,B) of (46,40,51), is thus associated with nine pixels 7a of the enlarged image
10, all with the same colour coordinates as the pixel 7. A pixel P-L belonging to a corner of the enlarged image 10 is then selected and its component in the second colour space which is present in the highest percentage is identified; in this case, this is the component C, which is present at 20%.
The pixel Px is then associated with the monochrome pixel PM which contributes to the generation of the second monochrome image 15, the colour of which is given by 100% of C. The coordinates of the components which are not predominant (in this case 18% of K) , are divided into a number of fractions equal to the number of modifiable adjacent pixels PMi (where
i=l,2,3) which are correlated with the pixel ?1; in this case, the number is three. There are therefore three fractions having values equal to 9% of K. The colour of each of the adjacent pixels is thus modified in dependence on these fractions and is equal to (20% of C, 0, 0, 0, 0, 0, 18 + 9% of K) for Pmι, as well as for P^ and P^.
The pixel PKD1 is then selected as the first pixel t?1 ' and the monochrome pixel PM' having 100% of K is associated therewith since, in this case, the predominant component is the component K. The percentage relating to component C is divided by the modifiable adjacent pixels Pωi(i=l,2,3,4) . of which there are four, given that one of the adjacent pixels had already been selected. The colours of the adjacent pixels are thus modified in dependence on fractions of values equal to 5% for component C.
The above-described selection is continued for all of the pixels of the image 10 or for a preselected area thereof .
A second image 15 composed of monochrome pixels in the components set for the second colour space is thus obtained. 7 bitmap channels 19 are thus created, one for each second colour-space component, and these are grouped in a single multi-channel bitmap file 20.
Figure 3 shows a portion of the C bitmap channel given by 4 black pixels Pc and 5 white ones. The multi-channel bitmap 20 is then reduced by N=3 and a single pixel of a colour equal to 44% of grey is associated with the 9 pixels shown above.
The multi-channel bitmap 20, stored in the memory 4 or 13, is printed on the substrate 6 by means of the printer 5.
There is also provision for possible printing on a substrate 6 of coloured material. In this case, data relating to the basic background colour/s of the preselected coloured material, in particular its RGB colour coordinates, are entered in the memory 4 or 13. The aforesaid colour is then converted into the second colour space and the resulting components are subtracted from the colours of the pixels of the image. For example, if the background colour is given by 5% Y and 20% K, these percentage values are subtracted from each pixel of the image.
In the foregoing description of the method of the invention, 8 bits have been assigned to each component of the first colour space. However, the method of the invention provides for the use of an arbitrary number of bits for each component.
Moreover, the conversion of colours from the first, RGB colour space to a second space set by the user has been described; it is clear, however, that the method according to the invention controls the colours of an image from an arbitrary first colour space which is not necessarily the same as that of the monitor.
The invention thus achieves the objects proposed, offering many advantages over known solutions.
In the first place, the method according to the invention enables the colours of an image to be controlled automatically in order to obtain an accurate reproduction of them upon printing.
The colour control is thus very quick and can be reproduced an arbitrary number of times without the need for skilled personnel such as graphic designers.
The method according to the invention also enables images to be printed on a large variety of materials, nevertheless producing a reasonably accurate reproduction of the colours on each of them.
Not least, the method according to the invention permits printing on coloured materials without colour distortion in relation to the image displayed on the computer monitor.