Image processing method and apparatus

Abstract: When an image is drawn, a check is made to see if the image is overwritten onto an image which has already been inputted and displayed, thereby switching. For this purpose, a color of the image to be drawn and a color of the image which has already been inputted are compared and the image of the color of a higher priority is displayed. There is no need to reset a display priority of the image by a manual operation of the operator in consideration of the priority of the image. When the image is inputted, the priority of the image can be simultaneously decided. The image can be an image inputted by a hand-writing, an image inputted by a scanner, a character pattern which is generated from a character generator, and the like.

Description: The invention relates to an image processing method and apparatus for drawing by using position indicating means such as mouse, pen, or the like. The invention also relates to an image processing method and apparatus which can edit and output an input Hitherto, when a new image is inputted to an image which has already been inputted, the newly inputted image is overwritten onto the image which has already been inputted. Hitherto, there is an editing function such that the upper/lower relation when displaying an image which has already been inputted can be changed. According to the above conventional technique, however, since a display color is unconditionally changed with respect to the overwritten portion, there is a problem such that in the case where an image is erroneously drawn onto a figure to be preserved, the figure to be preserved is erased. The above conventional technique has a drawback such that the editing operation to change the upper/lower relation when displaying an image after the image was once inputted has to be executed, so that an operability is bad. JP 01-115634 and the corresponding Patent Abstracts of Japan, vol. 013, no. 340 (M-857) discloses a two-colour printer in which the black data is stored in a black buffer 6c and the red data is stored in a red buffer 6d. In order to prevent the two colours being mixed in the same region of an image, a control means is provided in order to form the image in a predetermined colour set by a priority colour flag 6b, the colour data for the other colour within the region being deleted. EP-A-0 568 361 discloses a colour mixing system for mixing colours based on a base colour. Each colour is given a priority, this being indicative of the effect of the colour on the mix. WO-A-88/01778 and US-A-4868552 disclose a multi-colour display system in which each of a plurality of image planes are given a priority hierarchy to determine which image plane will be dominant at the positions of overlap. It is an object of one aspect of the invention to solve the problems of the conventional techniques mentioned above and to provide image processing method and apparatus in which even when an image is overwritten, a figure to be preserved is not erased. An object of another aspect of the invention is to solve the drawbacks of the conventional techniques mentioned above and to provide image processing method and apparatus in which a desired upper/lower relation can be set without needing an editing operation to change a mutual upper/lower relation of images when a plurality of images are displayed. An object of a further aspect of the invention is to provide image processing method and apparatus of a high operability in which by comparing a color set in an image to be drawn and a color of an image that has already been inputted to a position to draw the image and by overwriting an image in which a color of a high priority has been-set, the picture of the image and the setting of the priority on the display of the image can be simultaneously performed. The present invention is defined in the appended claims 1 and 10, various embodiments being specified in dependent claims. Embodiments of the present invention will now be described with reference to the accompanying drawings in which: Fig. 1 is a block diagram showing a constructional example of an image processing apparatus according to one embodiment of the invention; Fig. 2 is a flowchart for a drawing process; Fig. 3 is a diagram showing an example of the setting of priorities of colors; Fig. 4 is a diagram showing an example of a display color change table; and Fig. 5 is a flowchart for a detailed drawing process. Fig. 1 is a block diagram showing a construction of an image processing apparatus in an embodiment. Fig. 2 is a flowchart showing a drawing process. In Fig. 1, reference numeral 1 denotes a display for displaying an image as a result drawn, a menu which is necessary for various processes, a cursor of a coordinate designator 2, or the like. The display 1 is constructed by a CRT, a liquid crystal display (LCD), or the like. Reference numeral 2 denotes the coordinate designator such as mouse, pen, or the like to indicate a desired position on the display screen of the display 1. A VRAM 3 is a random access memory for storing data to be displayed. The VRAM 3 stores image data such as a figure or the like to be displayed on the display 1. A data RAM 4 is a random access memory to temporarily store data. The data RAM 4 stores various kinds of parameters such as information of the priorities of the set colors, data of the present drawing color, and the like which are used during the process. A CPU 5 executes and controls various kinds of processes, which will be explained in the embodiment, as shown in the flowchart of Fig. 2. The execution and control of the processes are executed on the basis of a control program stored in an ROM in .the CPU 5. An address bus 6 is a bus for flowing address data to designate a position (address) to read or write data in the VRAM 3 and data RAM 4. A data bus 7 is a bus for flowing the data read out from the position designated by the address data flowing on the address bus 6. A drawing process in the embodiment will now be described in accordance with the flowchart of Fig. 2. In step S1, priorities of colors to be used for drawing are set. The process in step S1 is started by selecting an item "set priority of color" from the menu displayed on the display 1. In the setting process of the priority of the color, since samples of colors which can be displayed, namely, which can be set as drawing colors are displayed on the display screen, the color to set the priority is selected from the sample colors by a method whereby a desired sample is designated by the pen or mouse is clicked or the like. In response to the selecting operation, a subwindow to input the priority to be set to the color is displayed on the display screen. A numerical value indicative of the priority to be set is inputted by using a keyboard (not shown) on the subwindow for setting the priority. In case of inputting the priority, the priority can be also inputted by indicating a soft numerical value key on the display screen by using the pen or mouse so that the color selecting operation can be continuously inputted. In step S1, the setting or changing operation of the priority of a new color is repeated with respect to each color until the operator instructs the end of setting. Fig. 3 is a table showing the priorities of the colors set in step S1. The table is stored in the data RAM 4. In Fig. 3, the priorities 4, 3, 5, 2, 6, and 1 are set with regard to red, blue, green, yellow, black, and white selected from the colors which can be displayed on the display 1, namely, which can be set in an image to be drawn by the coordinate designator 2. The smaller the numerical value is, the higher the priority becomes. In the example of Fig. 3, the priority of white is the highest and the priority of black is the lowest. In this case, the image of white is displayed over the images of all of the other colors. When an item of "end" is designated by the operator and the priority setting process of the color (S1) is finished, the priorities of the colors set until this time point are stored into the data RAM 4 and a setting process of a drawing color (step S2) is started. The drawing color setting process is also started by designating an item of "set input color" by the, operator by using the pen or mouse. The color set in step S2 and the priority data of such a color which has been stored in the data RAM 4 are stored into the data RAM 4. After the color was set in step S2, a picture which is inputted by the pen, mouse, or keyboard is displayed on the display screen by the designated color. The drawing of the picture is executed in steps S3 and S4. The detailed process of the drawing portion is shown in a flowchart of Fig. 5. In step S3, when an arbitrary point on the display screen is designated by the coordinate designator 2 or the keyboard (S11), the address in the VRAM 3 to store the color data of the designated point is indicated by the CPU 5 through the address bus 6 (S12). The color data stored in the address is sent to the CPU 5 through the data bus 7 (S13). The CPU 5 reads out the priority of the color data sent and the priority of the color to be inputted from the data RAM 4 (S14) and compares the values of those two priorities (S15). As a result of the comparison, when the priority of the color to be inputted is higher than the priority of the color displayed, the CPU 5 writes the color data of the color to be inputted into the address corresponding to the point designated in the VRAM 3 (S16). On the contrary, when the priority of the color displayed is higher than the priority of the color to be inputted, the data in the address corresponding to the point designated in the VRAM 3 is held without changing. The data in the VRAM 3 is displayed on the display 1 (S5). By the above procedure, a process such that the overwriting is enabled or disabled by allocating the priority to the color can be performed. Even if an image is overwritten, a picture to be preserved is not erased. In the above description, the overwriting process is executed with attention paid to only the priority of the color. The relation between the color and the priority in this instance is as shown in, for example, a table of Fig. 3. By expanding the table as shown in Fig. 4 and by changing output color information for the color information which was read out, not only a judgment about whether the drawn data is overwritten or not in step S4 of the flowchart of Fig. 2 is performed but also the color in case of overwriting can be changed. Explanation will now be made with respect to Fig. 4 as an example. When the color which is inputted and is set in step S2 at present is yellow and the color which was read out and displayed in step S13 is green, olive-green is outputted from Fig. 4 and the display color is changed from green to olive-green. Similarly, when the color to be inputted is yellow and the color which was read out is red, the color to be outputted is brown. On the other hand, when the color in which the color change is not set in the table such as red, blue, or the like in Fig. 4 is inputted, the display is determined in accordance with the priority in a manner similar to the case of using the table of Fig. 3. For example, when the color to be inputted is yellow and the read-out color is white, since the priority of white is higher, white is displayed as it is. When the read-out color is blue, since the priority of yellow is higher, the display color is changed from blue to yellow. Thus, in the case where the table is set as shown in Fig. 4, so long as the color to be inputted other than yellow is set, the display color is decided by the priority with the read-out color. According to the embodiment as described above, by expanding the table describing the relation between the color and the priority, when overwriting, the process such that the display color can be changed on the basis of the relation between the display color and the input color or the overwriting cannot be performed can be executed. It is possible to construct in a manner such that even if an image is overwritten, the picture to be preserved is not erased. As for the image formed by the drawing process described above, the data that is similar to that stored in the VRAM 3 is outputted from the printer (not shown) and the image can be obtained as a desired original. As a printer, a printer such as LBP, ink jet printer, or the like which can output a color image or a printer which can output a gray scale can be used. Although the embodiment has been described with respect to the example in which the picture is inputted by the pen, mouse, keyboard, or the like, the invention is not limited to it. For example, the invention can be also applied to the case where the image inputted through a scanner or a communication line is overwritten to the image which has already been inputted and the resultant image is inputted. In this case, with respect to the newly inputted image (S11), VRAM data about each dot (S12) of such an image is read out (S13), the priority is read out (S14), and a judgment about the input color and the display color is performed (S15). As an input color, so long as the input image is a color image, it is sufficient to read out the color of the dot and to store into the data RAM 4 in step S11. When the image is inputted, so long as the color is designated for the whole image (S2) irrespective of the color set in the input image, it is sufficient to store the set color into the data RAM 4. It will be understood that the input image may be a character pattern image which is generated from a character generator. In this case as well, when the character pattern of designated color and size and font style is generated from the character generator and written into the VRAM 3, it is sufficient to read out the data from the VRAM 3 (S13) with respect to each dot (S12) to develop the character pattern and to execute the processes in steps S14 to S16.

Claims: An image processing apparatus for drawing by using a designating means comprising: storage means (3) for storing an image and colour information for the image; characterized by comprising: memory means (4) for storing a priority table indicating the priorities of a plurality of colours; setting means for setting colour information to perform data drawing; means responsive to said designating means (2) for designating a point so as to input an image having the colour information set by said setting means; reading means (5) for reading out colour information of the image stored at the position for the point in said storage means (3); comparing means (5) for comparing the priority of the colour information read out by said reading means (5) with the priority of the colour information set by said setting means based on the said priority table; and control means (5) for controlling said storage means (3) so as to overwrite the colour information set by said setting means at said position for the point in said storage means (3) when and only when the priority of the colour information set by said setting means is higher than the priority of the colour information read out by said reading means (5). An apparatus according to claim 1, in which said priority table further indicates output colour information for a combination of colours, and said control means controls the overwriting of output colour information at said position for a point in said storage means (3) when a combination of the colour information set by said setting means and the colour information read out by said reading means (5) is stored in the priority table. An apparatus according to claim 1 or claim 2, further comprising priority setting means for setting each priority for each colour stored in said memory means (4). An apparatus according to any of claims 1-3, in which said designating means is a pen (2). An apparatus according to any of claims 1-3, in which said designating means is a mouse (2). An apparatus according to any of claims 1-3, in which said designating means is a keyboard. An apparatus according to any preceding claim, in which said image is a character pattern. An apparatus according to any preceding claim, further comprising means for causing a display means (1) to display the image stored in said storing means. An apparatus according to any preceding claim, further comprising means for outputting the image stored in said storing means to a printer. An image processing method for drawing using a designating means comprising the steps of: storing an image and colour information for the image; characterized by comprising the steps of: storing a priority table indicating the priorities of a plurality of colours; setting colour information to perform data drawing (S2); designating a point with said designation means so as to input an image having the colour information set in said setting step (S11); reading out colour information of the image stored at the position of the designated point; comparing the priority of the colour information read out in said reading step (S13) with the priority of the colour information set in said setting step (S15) based on the said priority table; and controlling said step of storing an image and colour information so as to overwrite the colour information set in said setting step at the position of the designated point when and only when the priority of the colour information set in said setting step is higher than the priority of the colour information read out in said reading step. An method according to claim 10, wherein said priority table further indicates output colour information for a combination of colours, and overwriting of the output colour information at the position of the designated point is controlled in said control step when a combination of the colour information set in said setting step and the colour information read out in the said reading step is stored in the priority table. A method according to claim 10 or claim 11, further comprising the step of setting each priority for each colour stored in said storing step. A method according to any of claims 10-12, wherein said designating step is responsive to signals from a pen (2). A method according to any of claims 10-12, wherein said designating step is responsive to signals from a mouse (2). A method according to any of claims 10-12, wherein said designating step is responsive to signals from a keyboard. A method according to any of claims 10-15, wherein said image is a character pattern. A method according to any of claims 10-15, further comprising the step of causing the image stored in said storing step to be displayed. A method according to any of claims 10-15, further comprising the step of outputting the image stored in said storing step to a printer. A computer program directly loadable into the internal memory of a computer, comprising software code portions for performing the steps of the method claimed in any one of claims 10 to 19 when said product is run on a computer. A computer readable storage medium for storing a computer program according to claim 19.

Inventors: ARAI TSUNEKAZU, HARADA TAKASHI, MATSUBAYASHI KAZUHIRO, MORI SHIGEKI, SAKAGUCHI KATSUHIKO, ARAI, TSUNEKAZU, HARADA, TAKASHI, MATSUBAYASHI, KAZUHIRO, MORI, SHIGEKI, SAKAGUCHI, KATSUHIKO
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1996
Main classification: G06T11
IPC codes: G06T11, G06T15