BACKGROUND OF THE INVENTION 
   1. Field of the Invention 
   The present invention relates to a method and an apparatus for performing a conversion process on the basis of a colorimetry result of a color patch output by an output device. 
   2. Related Background Art 
   Conventionally, a color masking method of obtaining an output color space by performing a matrix calculation on an input color space, and a method of obtaining an output color space from an input color space using a lookup table (LUT), have been widely used as methods of correcting color to improve a color reproduction effect in a color reproduction process on a printer. 
   However, since the output characteristic of a color printer includes strong nonlinearity, a global method such as the color masking method, that is, a method in which the entire output color space is affected by a change of a matrix value, has difficulty in adequately approximating the characteristic of a color printer in all color ranges. Also, in the method using the LUT, table values are often determined according to the masking method, so that the same difficulty in color reproducibility is found. 
   SUMMARY OF THE INVENTION 
   An object of the present invention is to approximate with precision the nonlinear output characteristic of an output device and thus to enable color reproduction with high precision. 
   In order to achieve the above object, the present invention is, in one aspect, a color processing method for converting a device-independent color space into a color space dependent on an output device. In this method, colorimetry values of color patches output by the output device are input, the colorimetry values representing points in the device-independent color space. Colorimetry values close to a conversion target value represented in the device-independent color space, are extracted from the input colorimetry values, the number of the extracted colorimetry values complying with brightness of the conversion target value. There is performed, according to respective distances between the conversion target value and each extracted colorimetry value in the device-independent color space, a weighting process for an output device dependent color value corresponding to respective ones of the extracted colorimetry values so as to obtain an output device dependent color value corresponding to the conversion target value. 
   The above and other objects, features and advantages of the invention will become more apparent by reference to the following detailed description of the invention taken in conjunction with the accompanying drawings. 


   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  is a diagram showing the configuration of the first preferred embodiment of the present invention; 
       FIG. 2  is a diagram showing an example of an input color→Lab LUT  102 ; 
       FIG. 3  is a diagram showing an example of a color patch  109 ; 
       FIG. 4  is a diagram showing colorimetry values obtained in a colorimetry process by a color patch colorimetry unit  110 ; 
       FIG. 5  is a diagram showing the process of selecting Lab values (Lab→DeviceRGB conversion unit  104 ); 
       FIG. 6  is a diagram showing a weight function depending on distance; 
       FIG. 7  is a diagram showing a sample point function; 
       FIG. 8  is a diagram showing the configuration according to the second preferred embodiment of the present invention; and 
       FIG. 9  is a diagram showing the configuration according to the third preferred embodiment of the present invention. 
   


   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   First Embodiment 
   The first preferred embodiment of the present invention will be described below by referring to the attached drawings. 
     FIG. 1  shows the contents of the process according to the present embodiment. An input signal is a color space signal dependent on a device, and can be, for example, an RGB signal read by a scanner A, a CMYK signal to be output to a printer B. When the present embodiment is applied to a copying machine, the signal can be the RGB signal read by the scanner. When a proof is checked, the signal can be the CMYK signal to be output to the target printer. 
   The above input signals are input to an input color→Lab conversion unit  101 , and converted into signals in a Lab space which is a color space independent of a device. According to the present embodiment, the conversion is realized by an LUT conversion using the input color→Lab LUT  102 . At this time, a table used in the conversion is to be set appropriately in an input color space. For example, when an RGB color space dependent on the scanner A is used at the input side, a three-dimensional input/three-dimensional output RGB→Lab conversion table corresponding to an RGB signal value and a Lab value dependent on the scanner A is set as an LUT. Similarly, when a CMYK color space dependent on the printer B is used at the input side, a four-dimensional input/three-dimensional output CMYK→Lab conversion table corresponding to a CMYK signal value and a Lab value dependent on the printer B is set as an LUT.  FIG. 2  shows an example of an LUT. The example shown in  FIG. 2  illustrates the correspondence between an RGB value having 8 bits for each of the R, G, and B and a Lab value, and only the Lab value is stored as an actual LUT. 
   In the input color→Lab conversion unit  101 , the address on the table is computed from the input signal to retrieve the Lab value from the LUT, interpolation calculation is performed using the retrieved Lab value, and a Lab value corresponding to the input signal is obtained. 
   The Lab signal obtained by the input color→Lab conversion unit  101  is then input to a Lab→DeviceRGB conversion unit  104 , and is converted into a signal in a DeviceRGB space that is a space dependent on a printer  107  by using DeviceRGB→Lab LUT  105 . 
   When the input color space is an RGB space, the color range is larger than the color reproduction range of the printer in most cases. Therefore, a color space compression conversion unit (or a color gamut mapping unit)  103  first performs a mapping process in the color reproduction range, and then inputs a Lab signal into the Lab→DeviceRGB conversion unit  104 . 
   A signal converted by the Lab→DeviceRGB conversion unit  104  for the DeviceRGB space is also converted by the DeviceRGB→CMYK conversion unit  106  for a CMYK color space dependent on the printer  107 , and is then transferred to the printer  107 . Various well-known methods can be used for the DeviceRGB→CMYK conversion, and thus any of those methods can be arbitrarily used. 
   According to the present embodiment, the following equations are used for conversion.
 
 K =min(1.0- R,  1.0- G,  1.0- B )
 
 C =(1.0- R )− K  
 
 M =(1.0- G )− K  
 
 Y =(1.0- B )− K  
 
(Lab→DeviceRGB Conversion Process)
 
   Described below in detail are the Lab→DeviceRGB conversion unit  104  and the DeviceRGB→Lab LUT  105 . In the Lab→DeviceRGB conversion unit  104 , a conversion process is performed based on the correspondence between the DeviceRGB signal value stored in a color patch generation unit  108  and the Lab colorimetry value obtained by the color patch colorimetry unit  110 . 
   (Generation of DeviceRGB→Lab LUT  105 ) 
   First, the color patch generation unit  108  generates a color patch signal indicating a color patch image as shown in  FIG. 3 . The color patch signal is transferred to the printer  107  through a process path only passing the DeviceRGB→CMYK conversion unit  106 , and the printer  107  generates a color patch image  109 . 
   The color patch signal is generated such that the DeviceRGB space can be equally divided. In  FIG. 3 , an RGB space having 8 bits each for R, G, and B is equally divided into 9×9×9 units, and 729 patches are obtained. In this example, the color space dependent on the printer  107  is a CMYK color space. However, since it is considered that an RGB space can be converted into a CMYK color space according to the conversion rule from the RGB space, the RGB space is considered to be a color space dependent on the printer  107 . 
   Second, the color patch colorimetry unit  110  performs a colorimetry process on the obtained color patch image  109 , and a Lab colorimetry value is obtained for each patch.  FIG. 4  shows an example of the obtained Lab colorimetry value. 
   In the operation, the RGB value generated by the color patch generation unit  108  and the Lab colorimetry value obtained by the color patch colorimetry unit  110  can be obtained. Therefore, a DeviceRGB→Lab LUT for storing the correspondence between the DeviceRGB and the Lab colorimetry value on the points on which the DeviceRGB space is equally divided can be obtained. 
   (Lab→DeviceRGB Conversion) 
   A Lab→deviceRGB conversion is performed using the generated DeviceRGB→Lab LUT, but a problem occurs in the conversion. That is, when an LUT computation is performed, conventional interpolation calculation such as the interpolation on a cube, the interpolation on a tetrahedron, etc. is performed. However, the above interpolation calculation can only be performed on a table value when the table input side has a uniform grid. Nevertheless, the DeviceRGB→Lab LUT obtained in the above process does not have a uniform table value for an input Lab value. Therefore, the interpolation calculation cannot be normally performed using a Lab value as an input value. 
   Therefore, according to the present embodiment, a Lab→deviceRGB conversion is performed in the following procedure. 
   First, the distance (equal to the color difference obtained by a Lab color difference equation) between the Lab value in the DeviceRGB→Lab LUT and the input Lab signal is computed and stored. The obtained distance is expressed by d. 
   Second, N entries are selected from the DeviceRGB→Lab LUT in order from the shortest distance d for the input Lab value. 
   At this time, the Lab values are expressed as follows in order from the shortest distance.
     DeviceRGB1→Lab1 d1   DeviceRGB2→Lab2 d2   DeviceRGB3→Lab3 d3   . . .   

     FIG. 5  shows the process of selecting Lab1, Lab2, . . . 
   Third, the DeviceRGB value for an input Lab value is computed as follows.
 
 RGB=ΣRGBi×f ( di )
 
I=N
 
 f ( x )=1/(1 +x ^4)
 
   In this case, f(x) is a function having the curve as shown in  FIG. 6 . That is, the interpolation calculation is performed with a larger weight assigned to an RGB value having a shorter distance in the Lab space. 
   The number N of the table values in the interpolation calculation can be constant (e.g., 8) in the Lab space. 
   However, in the method of the DeviceRGB→CMYK conversion unit, as shown in  FIG. 4 , the colorimetry values concentrate on a low brightness L* area. Therefore, a problem can occur when N is a constant. In this area, when N is too small, the distance between the input Lab value and the Lab value of the sample point is too short. Accordingly, the interpolation calculation is performed on a small number of sample points using a large weight. As a result, problems such as a gradation jump in the DeviceRGB space, a bad white balance in a low brightness range, etc., occur. 
   Therefore, when the interpolation calculation is performed by changing the number of samples depending on the value of the L of the input Lab value as shown in  FIG. 7 , the effect of solving the above problems can be obtained. Furthermore, in a high brightness range, the number of samples in the interpolation calculation can be limited, thereby suppressing unclear color. In the function N(L) shown in  FIG. 7 , the ¼ exponent function is shown as an example with the value of 128 assigned to L=0, and the value of 4 assigned to L=100. 
   (Color Space Compression) 
   Described below is the color space compression method used by the color space compression conversion unit  103 . There are various methods of color space compression. For example, a color space compression process is performed in a uniform color space as disclosed by Japanese Patent Application Laid-Open No. 8-130655. 
   Another example is a method of setting a color space compression conversion condition using a Lab colorimetry value obtained by the color patch colorimetry unit  110 . 
   In this color space compression method, a predetermined number (e.g., 8) of Lab values are selected from the DeviceRGB→Lab LUT such that the distance d between the input color outside the color reproduction range and the Lab value of the point of the vertical line down onto the color reproduction range from the input color is short, and that the Lab value is positioned on the outside edge of the color reproduction range. The data of the position of the outside edge of the color reproduction range is the data of the position on the 6 planes of a cube forming a DeviceRGB space. That is, the data of the position of the outside edge of the color reproduction range can be detected in advance based on the RGB value generated by the color patch generation unit  108 . 
   As in the above method of obtaining the DeviceRGB for the input Lab value, the interpolating process is performed using a predetermined number of Lab values weighted by the distance d, and a conversion Lab value in the color reproduction range corresponding to the input color outside the color reproduction range is obtained. 
   In this color space compression method, an input color outside the color reproduction range can be converted into a color near the outside edge of the color reproduction range having a Lab value of a color close to an input color. That is, a color outside the color reproduction range can be successfully converted into a clear color. 
   Second Embodiment 
     FIG. 8  shows the configuration of the second embodiment, that is, a modification of the first embodiment, of the present invention. According to the present embodiment, unlike the first embodiment, the conversion from a device independent color space to a printer-dependent color space is performed in the LUT process as in the conversion from an input color to a device independent color space. 
   After an input color→Lab conversion unit  801  and an input color→Lab LUT  802  perform the same processes as the input color→Lab conversion unit  101  and the input color→Lab LUT  102  according to the first embodiment, a Lab→CMYK conversion unit  803  performs an LUT conversion using a Lab→CMYK LUT  804 . The CMYK signal processed in the Lab→CMYK conversion is transmitted to a printer  805  and output. The Lab→CMYK LUT  804  is created as follows. A DeviceRGB color patch image is converted into a DeviceCMYK by a DeviceRGB→CMYK conversion unit  807 , and is output on the printer unit  805 . 
   An output color patch  808  is processed by a color patch colorimetry unit  809 , and an LUT is created by a Lab→CMYK LUT creation unit  810  based on the obtained colorimetry value and the RGB value generated by the color patch generation unit  806 . 
   The process of the Lab→CMYK LUT creation unit  810  can be performed by performing the color space compression process according to the first embodiment, the Lab→DeviceRGB conversion process, and the DeviceRGB→CMYK conversion on the grid value of the Lab input into the LUT. 
   For example, if the Lab value is processed as an eight-bit signal, then the grid of the Lab is configured with the value of L ranging from 0 to 255, and with the value of a, b ranging from −128 to 127 in 16 units. When the above processes are performed on each grid value, a Lab→CMYK LUT can be created. 
   With the above configuration, the conversion performed in the first embodiment from the Lab color space to the CMYK color space can be performed using the LUT, thereby efficiently performing the computation. 
   Third Embodiment 
   According to the present embodiment, the configuration used in the case in which an sRGB color space which has become a standard color space on the Internet is used as an input color space is described. The correspondence between the sRGB color space and the XYZ color space is defined, and the sRGB color space can be considered a device independent color space. Therefore, if the sRGB color value is converted into an XYZ value and a Lab value, and the conversion is performed from the Lab value to the printer color space as described above, the signal in the sRGB color space can be reproduced on a printer. 
     FIG. 9  shows the configuration according to the present embodiment. The input sRGB signal is converted into a CMYK value in the LUT conversion process using an sRBG→CMYK LUT  902  by an sRBG→CMYK conversion unit  901 , transmitted to a printer  903 , and output. The sRGB→CMYK LUT  902  is created by a sRGB→CMYK generation unit  908  based on the colorimetry value obtained by performing the colorimetry process on a color patch  906  by a color patch colorimetry unit  907  and the RBG value generated by a color patch generation unit  904 . The color patch is output by the printer, by using the Device CMYK obtained by converting the Device RBG of the color patch generation unit  904  with use of the Device RBG→CMYK conversion unit  905 . 
   An sRGB→CMYK LUT is created as follows. Assume that an input sRGB signal is processed as an eight-bit signal, and sRGB grids are configured as 17×17×17 grids. After performing operations of converting sRGB→XYZ and XYZ→Lab by a definition equation, the above Lab→DeviceRGB conversion process and DeviceRGB→CMYK conversion process are performed on each grid value, thereby obtaining an sRGB→CMYK LUT. 
   {Modification} 
   In the above embodiments, a Lab is used as a color space independent of a device, but other spaces such as XYZ, Luv, etc., can also be used. 
   Furthermore, a printer is used as an output device, but other output devices such as a printing device, etc., can also be used. Similarly, a color signal to be transferred to a printer unit is not limited to a YMCK signal, but other color signals can be used. 
   In the above embodiments, the number of patches is 729, but other numbers of patches can also be used. 
   While the number N of the table values for use in the interpolation calculation is set based on the brightness L as shown in  FIG. 4 , it may be set three-dimensionally in consideration of a and b addition to the brightness L. 
   Additionally, the present invention also includes the above devices operated by a program stored in the computer (CPU or MPU) of a system or a device connected to the devices to realize the function of the above embodiments and to operate the devices by providing a program code of the software for realizing the function of the above embodiments. 
   In this case, the functions of the above embodiments are realized by the program code of the software. The program code and a unit for providing the program code for the computer, for example, a storage medium storing the program code configure the present invention. 
   As a storage medium storing the program code can be a floppy disk, a hard disk, an optical disk, a magneto-optical disk, CD-ROM, a magnetic tape, a non-volatile memory card, ROM, etc. 
   Furthermore, the present invention obviously includes the program code not only in the realization of the functions of the above embodiment by executing the program code provided for the computer, but also in the realization of the functions of the above embodiments in cooperation with the OS (operating system) operated in the computer, or other application software, etc. 
   Additionally, the present invention obviously includes the program code in the realization of the functions of the above embodiments when the program code is stored in the memory of a computer function extension board or a function extension unit connected to the computer, and the CPU, etc., in the function extension board or the function extension unit performs a part or all of the actual process according to an instruction of the program code. 
   As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the present invention is not limited to the specific embodiments thereof expect as defined in the appended claims.
To approximate with precision the nonlinear output characteristic of an output device and enable high-precise color reproduction, a method is provided to convert a device-independent color space into an output device-dependent color space. A colorimetry value of a color patch output by the output device and represented in the device-independent color space is input, and a colorimetry value close to a conversion target value represented in the device-independent color space is extracted from the input colorimetry value. According to a distance between the input and extracted colorimetry values in the device-independent color space, there is performed a weighting process for a color value corresponding to the extracted colorimetry value and represented in the output device-dependent color space, to obtain a color value corresponding to the input colorimetry value and represented in the output device-dependent color space.