Color values processing apparatus capable of optimizing a processing description

Abstract: A color values processing description which represents a procedure of color values processing is analyzed by use of a partial reservation table and a total reservation table. The color values processing description is changed based on results of the analysis. For example, two consecutive operations of the same type, such as normalizing operations, gamma correcting operations or look-up table referencing operations, are unified into a single operation.

Description: BACKGROUND OF THE INVENTION The present invention relates to a color values processing apparatus capable of performing color processing at high speed and with high accuracy in document processing. In generating and outputting a color document, for instance, in outputting by a printer a color document displayed on a CRT, there are needed operations such as converting a color expression based on an additive mixture system used with the CRT to that based on a subtractive mixture system with printing inks. There exist following references which relate to the above color processing. 1) CES (Color Encoding Standard) XNSS-289107 This is a standard for representing a color in a PDL called InterPress (standard used in Fuji Xerox Co., Ltd.) and a RES (Raster Encoding Standard). 2) ISO, Information Processing -Text and Office Systems- Office Document Architecture (ODA) and Interchange Format Amendment 2: Support for Color (October 1991), ISO-DIS 8613/Amd. 2 This is a standard for representing a color in an ODA document. Correction data in a 3x3 matrix, a look-up table or other forms can be used in the standard. 3) Toru Yamasaki, "Color Technologies for Document Exchange," Journal of the Institute of Image Electronics Engineers of Japan, Vol. 20, No. 6, pp. 617-622. This paper describes results of a survey on color technologies in the document exchange. As described in reference 3), the above type of conventional color processing systems are constructed with the assumption that the color processing is performed by individual devices such as an image scanner, printer and CRT display; that is, they are not provided in a unified manner. As a result, the conventional color processing systems cannot accommodate the case where an individual device cannot perform color processing and therefore a conversion operation is necessary. Conventionally, since respective steps of a color-related portion of a document processing are performed independently of each other, a bottleneck may occur due to differences in processing capability among the respective steps and there cannot be performed an optimization by totally considering all the steps. Document WO-A-92/06557 discloses a color image processing system employing look-up tables for transformation from a first coordinate space to a second coordinate space. The system receives a user's selection of an image transformation to be performed on the array of input pixel values. In response to the user's selection, a plurality of transformed definitions are automatically selected from stored transform definitions. Each transform definition includes sample values representing an input/output relation of a predetermined image transformation. From these selected transform definitions, a composite transform definition is generated containing sample values of an input/output relation of a composite image transformation which is equivalent to the several image transformations effectively selected by the user. The step of generating the composite transform definition contains the preparing of at least one multi-dimensional grid table containing the sample values of the composites transform definition. Further, at least one input table is prepared containing, for each input color value, a grid table address of a corresponding entry of the grid table. With the use of such grid tables, an interpolation is performed to reach the desired output color values. Because the known system uses predetermined transform definitions and grid tables just mentioned the system is not flexible and the amount of computation is increased. Because of the interpolation, calculation errors necessarily occur. SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a color values processing apparatus which enables dynamic optimization of the color processing itself. This object is solved by the features of claim 1. Preferred embodiments are subject of the dependent claims. Referring to Fig. 1, a color values processing apparatus according to the invention has, as basic constitution, a color values processing description storing means 12 for storing a color values processing description which represents a procedure of processing color values, a color values processing description analyzing means 13 for analyzing the color values processing description, a color values processing description changing means 14 for changing the procedure of the color values processing description, a color values processing means 11 for processing color values of a pixel based on the procedure of the color values processing description. With the above constitution, the color values processing procedure, which is written in a prescribed color values processing description syntax, is stored in the color values processing description storing means 12. The color values processing description analyzing means analyzes the color values processing description. After the color values processing description changing means 14 has changed the color values processing description based on the analysis results in accordance with a purpose of the process, the color values processing means 11 processes color values based on the color processing description thus changed. According to the invention, since the color processing description can be changed, the color values processing can be optimized dynamically and thereby performed at high speed with high accuracy. The degree of freedom of the process can be increased. Further, since the color values processing description does not depend on the processing system, it becomes possible to interchange processes. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing basic constitution of the present invention; Fig. 2 is a block diagram showing constitution of a first embodiment of the invention; Fig. 3 shows an example of a color values processing description syntax; Fig. 4 is an example of a color values processing description according to the syntax of Fig. 3; Fig. 5 is a flowchart showing an example of the operation of a color values processing description analyzing unit; Fig. 6 shows an example of reservation words tables used in a color values processing description analysis; Fig. 7 shows an example of analysis results of a color values processing description; Fig. 8 shows a conversion from two consecutive matrix operations to a single matrix operation; Fig. 9 shows a conversion from two consecutive gamma correcting operations to a single gamma correcting operation; Fig. 10 shows a conversion from two consecutive look-up table referencing operations to a single look-up table referencing operation; Fig. 11 is a flowchart showing an example of the operation of a color values processing unit; Fig. 12 is a block diagram showing constitution of a second embodiment of the invention; Fig. 13 is a flowchart showing an example of a color values rounding process; Fig. 14 is a block diagram showing a third embodiment of the invention; Fig. 15 is a block diagram showing a fourth embodiment of the invention; Fig. 16 shows examples of processing cost difference tables for operation replacement; Fig. 17 is a block diagram showing a fifth embodiment of the invention; and Fig. 18 is a block diagram showing least hardware constitution for implementing the invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of the present invention are described hereinafter with reference to the accompanying drawings. First embodiment Fig. 2 is a block diagram showing general constitution of a color values processing apparatus according to a first embodiment of the invention. The color values processing apparatus consists of a color values storing unit 20 for storing color values of a pixel, a color values processing unit 21 for performing color values operations on the color values stored in the color values storing unit 20 in accordance with a content of a color values processing description stored in a color values processing description storing unit 22, the color values processing description storing unit 22 for storing the color values processing description that describes a color values processing procedure according to a certain form, a color values processing description analyzing unit 23 for analyzing the color values processing description stored in the color values processing description storing unit 22, a partial reservation words table 24 and a total reservation words table 25 to be used in the analysis by the unit 23, an analysis results storing unit 26 for storing results of the analysis by the unit 23, and a color values processing description reduction unit 27 for reducing the color values processing description based on the analysis results. Fig. 3 shows an example of color values processing description syntax for representing the color values processing procedure that is to be stored in the color values processing description storing unit 22. The syntax of Fig. 3, in which the description grammar is written in the known BNF method, is a grammar mainly intended for the color system conversion. Fig. 4 shows an example of a description of color values processing, which represents a procedure of conversion from the XYZ color system to the CIE RGB color system. In Fig. 4, "input_colorspace: "XYZ"" represents a color system before the conversion, and "output_color space: "CIE_RGB"" represents a color system after the conversion. The procedure itself is described after "procedure_list:." In this case, "type: "MATRIX"" means that a matrix operation is performed, in which matrix components described in "parameter: {....}" are used. Fig. 5 is a flowchart showing an example of the operation of the color values processing description analyzing unit 23. For the description analysis, an analyzing program may be generated by a parser generator based on the syntax of Fig. 3. The flowchart of Fig. 5 mainly consists of table retrieval and table conversion. In step S51, one of words of the color values processing description are read from the color values processing description storing unit 22. In step S52, it is judged whether all the words have been processed. If the judgment is affirmative, the analysis is finished. If the judgment is negative, the following process is effected for the word just read. First, in step S53 the word is compared with words of the partial reservation words table 24. If a partial reservation word is found in the table 24 that coincides with the word read above (step S54), in step S55 a subroutine corresponding to that reservation word is called and executed. When the execution of the subroutine is finished or if no reservation word is found in the partial reservation words table 24 (step S54), in step S56 the word read above is compared with words of the total reservation words table 25. If a reservation word is found that coincides with the word read above (step S57), in step S58 the partial reservation words table 24 is replaced and a stack operation is performed. If no reservation word is found in the total reservation words table 25 (step S57), a symbol is registered in step S59. Fig. 6 shows an example of the reservation words tables. Reservation words to be applied to the entire description are set in the total reservation words table 25. Reservation words to be applied to a partial description are set in the partial reservation words tables 24-1 and 24-2, which are replaced with each other in accordance with the situation to change the analyzing mode. In the example of Fig. 6, the partial reservation words table 24-1 used for analysis of the entire color values processing description, and the partial reservation words table 24-2 is used for its specific description of a parameter analysis "procedure_list." Most of operations of the reservation words tables are simple conversion to an internal expression. Fig. 7 shows examples of analysis results that are stored in the analysis results storing unit 26. In these examples, the analysis result takes a form called a "structure" which depends on the programming language, i.e., depends on the processing system. The color values processing description reduction unit 27 reduces the color values processing description based on the above analysis results. Fig. 8 shows an example of altering the procedure of the color values processing description. In this example, two consecutive matrix operations of the color values processing procedure are replaced with a single matrix operation, to halve the actual operation. For example, if a matrix M1 is for conversion from the RGB color system of a CRT to the XYZ color system and a matrix M2 is for conversion from the XYZ color system to the CMY color system of a printer, the procedure of the conversion via the XYZ color system can be changed to a direct conversion procedure. Therefore, it becomes possible to connect various devices in any combination only by having procedures for mutual conversion with the XYZ color system prepared in the respective devices. Further, since direct conversion is performed in actually calculating the color values, there can be obtained an advantage of reduction of processing costs. The above procedure is very advantageous when it is applied to a plural sets of color values, for instance, tens of thousands of pixel color values in image processing. The procedure alteration (reduction) by unifying operations of the same kind in the above manner can also be applied to the normalizing operation, gamma correction operation and look-up table referencing operation. The normalizing operation itself is represented in the form of dividing an input value by a reference value. In the case of two consecutive normalizing operations, an input value is first divided by reference value 1 and then by reference value 2, which results in (input value)/{(reference value 1)×(reference value 2)}. Therefore, these two operations are changed to a single normalizing operation having (reference value 1)×(reference value 2) as a new reference value. The gamma correction operation is an operation of raising an input value to the γth power (γ: gamma parameter). Therefore, two consecutive gamma correction operations are changed to a single gamma operation having a product of two power values as a new gamma parameter (see Fig. 9). The look-up table referencing operation is an operation of accessing an array using an input value as its address and outputting an accessed entry. Therefore, two look-up table referencing operations are changed to a single look-up table referencing operation in which a new table has, as its entries, results of two times of referencing for all the input values (see Fig. 10). The color values processing unit 21 processes actual color values after a color values processing description that represents a final processing procedure. Fig. 11 is a flowchart showing an example of the operation of the unit 21. In this example, the color values processing is a combination of the basic operations including normalization, gamma correction, logarithmic correction, look-up table referencing and matrix operation, and the operation type is judged for respective steps of the processing procedure (steps S1103-S1107) and performing corresponding operations (steps S1108-S1113). A raster image is an example of color values to which the above type of processing is to be applied. Since a raster image is associated with an extremely large number of pixel values, the processing cost can be reduced in proportion to the number of pixel values when one kind of color values processing is simplified. Second embodiment As shown in a block diagram of Fig. 12, a second embodiment has constitution in which a rounding processing unit 120 is added to the first embodiment. That is, in Fig. 12, the color values storing unit 20, color values processing unit 21, color values processing description storing unit 22, color values processing description analyzing unit 23, partial reservation words table 24, total reservation words table 25, analysis results storing unit 26 and color values processing description reduction unit 27 are the same as those of the first embodiment of Fig. 2. In Fig. 12, the same units as in Fig. 2 are represented by the same reference numerals. (Similarly in the following embodiments, the same functional units are given the same reference numerals.) The rounding processing unit 120, which is added in the second embodiment, consists of a color value ranges storing portion 121 for storing ranges of color values, a color values rounding processing storing portion 122 for storing a value indicating an operation to be effected when a color value exceeds the range stored in the color value ranges storing portion 122, and a color values rounding processing portion 123 for performing a color values rounding operation in accordance with the value stored in the color values rounding processing storing portion 122. Fig. 13 is a flowchart showing the color values rounding process. In this example, specified one of a "cutting operation", a "remainder operation" and a "no operation" is effected for each case of overflow and underflow. An overflow/underflow judgment in steps S131 and S135 is performed based on the "minimums/maximums of ranges" of the analysis results stored in the analysis results storing unit 26 (see Fig. 7). Specification in steps S132 and S136 of the operation to be effected in the occurrence of the overflow/underflow is performed using the entries of the "operations in the occurrence of overflow/underflow" (see Fig. 7). When a color value exceeds the range, it is set at the minimum or maximum in the cutting operation (steps S133 and S137), set at a value obtained by adding to the minimum a remainder of the color value divided by the range (i.e., maximum - minimum) in the remainder operation (steps S134 and S138), and no operation is performed in the remaining case. The cutting operation has an advantage that the reproduction range can be set. This operation is particularly effective where the ranges of the input values are fixed, as in the case of the look-up table referencing operation. The remainder operation has an advantage that it can deal with coordinate systems such as the polar coordinate system and the cylindrical coordinate system in which coordinates return to original values after one round. The "no operation" has an advantage that the error of a color value does not increase during the process. Further, it is possible to apply the process to only a part of the range by using a range that is smaller than the actual reproduction range and effecting the "no operation." According to the second embodiment, in which selection can be made from a plurality of operation types as described above, the color values rounding processing can be performed in accordance of the purpose of the color values processing. (The degree of freedom is increased.) Third embodiment Fig. 14 is a block diagram showing constitution of a third embodiment. In the reduction operation of the first embodiment (Fig. 2) and the second embodiment (Fig. 12), the same types of operations as shown in Figs. 8-10 are altered, i.e., unified. On the other hand, in the third embodiment, an operation is converted to a different type of operation. An apparatus according to the third embodiment has the color values storing unit 20, color values processing unit 21, color values processing description storing unit 22, color values processing description analyzing unit 23, partial reservation words table 24, total reservation words table 25 and analysis results storing unit 26, which are the same as in the above embodiments. Further, the apparatus of the third embodiment has a conversion-to-different-type-of-operation unit 141 instead of the color values processing description reduction unit 27. The unit 141 performs conversion to a different type of operation such as rendering into an integer, a look-up table operation (one-dimensional), a direct look-up table operation (three- or four-dimensional). The rendering into an integer may be implemented by a judgment portion for judging whether operations of a described processing procedure are performed in the form of a real number, and a processing procedure replacing portion for replacing a real number operation with an integer operation. (These two portions are not shown in the drawings.) The rendering into an integer simplifies calculations of the color values processing and thereby reduces the processing cost. Examples of the conversion to a look-up table (one-dimensional) include replacement of a normalizing operation, gamma correction, logarithmic correction, etc. with a look-up table referencing operation. In this conversion, output values of a one-input/one-output type operation are calculated in advance for input values in a predetermined range, to enable table referencing. This conversion is particularly effective in the case where a complex real number operation, such as gamma correction or logarithmic correction, is required. Another example of the rendering into an integer is replacement with a fixed point operation/conversion of matrix coefficients to a look-up table. In the direct look-up table referencing operation, a three-dimensional array is accessed using input three stimuli of the three primary colors as addresses. In particular, in the case of an integer operation, any processing procedure can be represented by a direct look-up table. Therefore, a plurality of operations can be unified to a single operation using a direct look-up table. More specifically, actual color processing is performed for all the combinations of input three stimuli of the three primary colors, and results are employed as entries of a direct look-up table. In this manner, a direct look-up table referencing operation equivalent to the actual color values processing can be obtained. In general, the direct look-up table referencing operation is performed at high speed. Therefore, the conversion to a direct look-up table enables any color values processing to be performed in a minimum processing time. Fourth embodiment Fig. 15 shows constitution of a fourth embodiment. A color values processing description changing unit 150 has both of the color values processing description reduction unit 27 and the conversion-to-different-type-of-operation unit 151. Conversions are selected so as to minimize the processing cost. To this end, further provided are a color values processing costs storing unit 152 for storing costs of respective operations of the color values processing description, and a color values processing conversion selecting unit 153 for selectively using conversions of the unit 27 or unit 151 based on the values stored in the color values processing costs storing unit 152. As an example of data to be stored in the color values processing cost storing unit 152, part (a) of Fig. 16 shows a processing cost difference table including cost differences due to various conversions. The color values processing conversion selecting unit 153 employs conversions which reduce the processing cost. In the case of the cost difference table of part (a) of Fig. 16, the processing cost is reduced (with a large effect of replacement) by replacing the gamma correction with the look-up table referencing operation. Therefore, this replacement is effected. In machines having such hardware as a coprocessor and an accelerator, a processing cost difference table as shown in part (b) of Fig. 16 is provided. Since there exists no cost difference between the gamma correction and the look-up table reference operation (no effect of replacement), this conversion is not effected. Therefore, the color values processing description reduction unit 27 is selected. As described above, the fourth embodiment has an advantage that the operation replacement can be effected suitably for various machines by providing processing costs tables that reflect characteristics of the respective machines. Fifth embodiment Fig. 17 is a block diagram showing constitution of a fifth embodiment, which is characterized by a color values processing description combining unit 172 for combining a plurality of color values processing descriptions. For example, if a processing description for conversion from the RGB color space for a scanner to the XYZ color space and a processing description for conversion from the XYZ color space to the CMY color space for a printer are performed sequentially, the RGB color space for the scanner can be converted to the CMY color space for the printer. Therefore, a processing description for a direct conversion from the RGB color space for the scanner to the CMY color space for the printer is prepared by combining, in advance, the two processing descriptions by means of the color values processing description combining unit 172. In the case of the processing description structure shown in Fig. 7, a combined processing description is obtained by setting parameters of the first stage for the input color space, parameters of the second stage for the parameters of the output color space/range processing, and a combination of two processing procedure lists for the processing procedure list. Fig. 18 shows an example of least hardware constitution for implementing the color values processing apparatuses of the above embodiments. Programs and necessary data for the processes of the respective units are stored in a storage device 182, and a computing device 181 executes the respective programs. According to the invention, since the color values processing description is simplified/optimized by the color values processing description changing means, the color values processing can be performed at high speed and with high accuracy. Further, since the present invention makes it possible to describe a process without depending on the device that performs the process, not only the degree of freedom of the device constitution and the process is increased, but also the device constitution can be reduced, for instance, operation devices of the color values processing can be put together so as to be placed at a single location.

Claims: A color values processing apparatus comprising means (12, 22) for storing a color values processing description representing a color values processing procedure of color values conversion between color values processing systems, and color values processing means (11, 21) for converting color values of a first color values processing system to those of a second color values processing system by using the stored color values processing description, characterized in, that the color values processing apparatus further comprises means (13, 23) for analyzing the color values processing description to thereby detect a particular type of operation of the processing procedure, and means (14, 26, 27) for changing the particular procedure in accordance with the detected type of operation, and that the color values processing means (11, 21) converts the color values of the first color values processing system to those of the second color values processing system by using the changed color values processing description. The color values processing apparatus of claim 1, wherein the changing means (14, 26, 27) comprises means for converting a plurality of consecutive operations of the same type included in the processing procedure to a single operation. The color values processing apparatus of claim 2, wherein the converting means converts a plurality of consecutive normalizing operations to a single normalizing operation. The color values processing apparatus of claim 2, wherein the converting means converts a plurality of consecutive gamma correcting operations to a single gamma correcting operation. The color values processing apparatus of claim 2, wherein the converting means converts a plurality of consecutive look-up table referencing operations to a single look-up table referencing operation. The color values processing apparatus of claim 2, wherein the converting means converts the processing procedure to a single multi-dimensional direct look-up table referencing operation. The color values processing apparatus of claim 1, further comprising: means (121) for storing ranges of the color values; means (122) for storing data indicating a rounding operation to be performed when the color value exceeds the range; and means (123) for performing the rounding operation indicated by the data. The color values processing apparatus of claim 1, further comprising: means for judging whether the procedure is performed in a real number; and means for changing the procedure so that it is performed in an integer when the judging means has judged that the procedure is performed in a real number. The color values processing apparatus of claim 1, wherein the changing means (14, 26, 27) comprises means (152) for storing costs of operations included in the procedure, and means (153) for selecting conversions of the operations based on the costs. The color values processing apparatus of claim 1, further comprising means (172) for combining a plurality of color values processing descriptions into a single color values processing description.

Inventors: KURAHASHI MASAYUKI, MAEDA MASAHIRO, SEKI NORIAKI, TSUZUKI TOSHIYUKI, YAMASAKI TORU, KURAHASHI, MASAYUKI, MAEDA, MASAHIRO, SEKI, NORIAKI, TSUZUKI, TOSHIYUKI, YAMASAKI, TORU
Applicants: FUJI XEROX CO LTD, FUJI XEROX CO., LTD.
Application year: 1993
Main classification: H04N1
IPC codes: H04N1, G06T1, G06T5, G06T11