The present invention relates to an color mapping technique.
There is known an image processing apparatus that receives a digital original described in a predetermined color space, performs, for each color in the color space, mapping to a color gamut that can be reproduced by a printer, and outputs the original. Japanese Patent Laid-Open No. 2020-27948 describes “perceptual” mapping and “absolute colorimetric” mapping. In addition, Japanese Patent Laid-Open No. 07-203234 describes deciding the presence/absence of color space compression and the compression direction for an input color image signal.
If “perceptual” mapping described in Japanese Patent Laid-Open No. 2020-27948 is performed, chroma may lower even for a color that can be reproduced by the printer in the color space of the digital original. If “absolute colorimetric” mapping is performed, color degeneration that the distance between colors after mapping becomes smaller than the distance between colors before mapping may occur in a plurality of colors included in the digital original among a plurality of colors outside the reproduction color gamut of the printer. In addition, in Japanese Patent Laid-Open No. 07-203234, there are concerns about the effect of reducing the degree of color degeneration because unique compression is performed in the chroma direction for the input color image signal.
The present invention provides a technique of making it possible to perform color conversion to reduce the degree of color degeneration.
According to the first aspect of the present disclosure, there is provided an image processing apparatus comprising: an acquisition unit configured to acquire a first color information group included in a first area of image data and a second color information group included in a second area of the image data; a correction unit configured to correct first color conversion information corresponding to the first area based on the first color information group, and correct second color conversion information corresponding to the second area based on the second color information group; a generation unit configured to generate third color conversion information based on the corrected first color conversion information and the corrected second color conversion information; and a conversion unit configured to color-convert color information of the first area and color information of the second area using the third color conversion information generated by the generation unit.
According to the second aspect of the present disclosure, there is provided an image processing method executed by an image processing apparatus, comprising: acquiring a first color information group included in a first area of image data and a second color information group included in a second area of the image data; correcting first color conversion information corresponding to the first area based on the first color information group, and correcting second color conversion information corresponding to the second area based on the second color information group; generating third color conversion information based on the corrected first color conversion information and the corrected second color conversion information; and color-converting color information of the first area and color information of the second area using the generated third color conversion information.
According to the third aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing a computer program for causing a computer to function as: an acquisition unit configured to acquire a first color information group included in a first area of image data and a second color information group included in a second area of the image data; a correction unit configured to correct first color conversion information corresponding to the first area based on the first color information group, and correct second color conversion information corresponding to the second area based on the second color information group; a generation unit configured to generate third color conversion information based on the corrected first color conversion information and the corrected second color conversion information; and a conversion unit configured to color-convert color information of the first area and color information of the second area using the third color conversion information generated by the generation unit.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
Hereinafter, embodiments will be described in detail with reference to the attached drawings. Note, the following embodiments are not intended to limit the scope of the claimed invention. Multiple features are described in the embodiments, but limitation is not made to an invention that requires all such features, and multiple such features may be combined as appropriate. Furthermore, in the attached drawings, the same reference numerals are given to the same or similar configurations, and redundant description thereof is omitted.
First, terms used in this specification are defined in advance, as follows.
A color reproduction region indicates the range of colors that can be reproduced in an arbitrary color space. The color reproduction region is also called a color reproduction range, a color gamut, or a gamut. A gamut volume is an index representing the extent of this color reproduction region. The gamut volume is a three-dimensional volume in an arbitrary color space. Chromaticity points forming the color reproduction region are sometimes discrete. For example, a specific color reproduction region is represented by 729 points on CIE-L*a*b*, and points between them are obtained by using a well-known interpolating operation such as tetrahedral interpolation or cubic interpolation. In this case, as the corresponding gamut volume, it is possible to use a volume obtained by calculating the volumes on CIE-L*a*b* of tetrahedrons or cubes forming the color reproduction region and accumulating the calculated volumes, in accordance with the interpolating operation method.
The color reproduction region and the color gamut in this specification are not limited to a specific color space. In this specification, however, a color reproduction region in the CIE-L*a*b* space will be explained as an example. Similarly, the numerical value of a color reproduction region in this specification indicates a volume obtained by accumulation in the CIE-L*a*b* space on the premise of tetrahedral interpolation.
Gamut mapping is conversion processing between different color gamuts. For example, gamut mapping is mapping of an input color gamut to an output color gamut. Conversion in the same color gamut is not called gamut mapping. Perceptual/Saturation/Colorimetric, and the like of the ICC profile are general. In the mapping processing, conversion may be performed using one 3D LUT. Furthermore, the mapping processing may be performed after conversion of a color space into a standard color space. For example, if an input color space is sRGB, conversion into the CIE-L*a*b* color space is performed. The mapping processing to an output color gamut is performed on the CIE-L*a*b* color space. The mapping processing may be processing using a 3D LUT or processing using a conversion formula. Conversion between the input color space and the output color space may be performed simultaneously. For example, the input color space may be the sRGB color space, and conversion into RGB values or CMYK values unique to a printing apparatus may be performed at the time of output.
Original data indicates whole input digital data as a processing target, and may be data of one page (single page) or data of a plurality of pages. The data of the single page may be represented as image data or a drawing command. If the data of the single page is represented as a drawing command, the data may be rendered based on the drawing command, converted into image data, and then processed. The image data is data of an image formed by a plurality of pixels that are two-dimensionally arranged. Each pixel holds information indicating a color in a color space. Examples of the information indicating a color are, for example, RGB values, CMYK values, a K value, CIE-L*a*b* values, HSV values, and HLS values.
In this specification, the fact that when performing gamut mapping for arbitrary two colors, the distance between the colors after mapping in a predetermined color space is smaller than the distance between the colors before mapping is defined as color degeneration. More specifically, assume that there are a color A and a color B in a digital original, and mapping to the color gamut of a printer is performed to convert the color A into a color C and the color B into a color D. In this case, the fact that the distance between the colors C and Dis smaller than the distance between the colors A and B is defined as color degeneration. If color degeneration occurs, colors that are recognized as different colors in the digital original are recognized as identical colors when the original is printed. For example, in a graph, different items are recognized as different items by different colors. When color degeneration occurs, different colors may be recognized as identical colors and thus the different items in the graph may erroneously be recognized as identical items. The predetermined color space in which the distance between the colors is calculated may be an arbitrary color space. Examples of the color space are the sRGB color space, the Adobe RGB color space, the CIE-L*a*b* color space, the CIE-LUV color space, the XYZ color space, the xyY color space, the HSV color space, and the HLS color space.
An example of the configuration of a system according to this embodiment will be described first with reference to a block diagram shown
The image processing apparatus 101 will be described first. The image processing apparatus 101 is a computer apparatus such as a personal computer (PC), a tablet terminal apparatus, a smartphone, or a server.
A CPU 102 executes various processes using computer programs and data stored in a RAM 103. This causes the CPU 102 to control the overall operation of the image processing apparatus 101 and to execute or control various processes to be described as those performed by the image processing apparatus 101. For example, the CPU 102 acquires a command from the user via a Human Interface Device (HID) I/F (not shown), and executes various image processes in accordance with the acquired command and computer programs saved in a storage medium 104.
The RAM 103 includes an area for storing a computer program and data loaded from the storage medium 104 and an area for storing data received from an external apparatus via a data transfer I/F 106. In addition, the RAM 103 includes a work area used by the CPU 102 or an image processing accelerator 105 to execute processing. As described above, the RAM 103 can provide various areas.
The storage medium 104 is a nonvolatile memory device such as a hard disk. The storage medium 104 saves an operating system (OS), computer programs and data for causing the CPU 102 or the image processing accelerator 105 to execute various processes to be described as those performed by the image processing apparatus 101, and the like. The computer programs and data saved in the storage medium 104 are appropriately loaded into the RAM 103 under the control of the CPU 102, and are to be processed by the CPU 102 or the image processing accelerator 105.
The image processing accelerator 105 is hardware capable of executing image processing faster than the CPU 102. The image processing accelerator 105 is activated when the CPU 102 writes a parameter and data necessary for image processing at a predetermined address of the RAM 103. The image processing accelerator 105 loads the above-described parameter and data, and then executes the image processing for the data. Note that the image processing accelerator 105 is not an essential element, and the CPU 102 may execute equivalent processing. More specifically, the image processing accelerator 105 is a GPU or an exclusively designed electric circuit. The above-described parameter can be saved in the storage medium 104 or can be acquired from an external apparatus via the data transfer I/F 106. The data transfer I/F 106 is a communication interface for performing data communication with an external apparatus via the network 107.
The printing apparatus 108 will be described next. The printing apparatus 108 is an apparatus having a function of printing (recording) an image and characters on a print medium such as paper, and is, for example, a printer or a multi-function peripheral.
A CPU 111 executes various processes using computer programs and data stored in a RAM 112. This causes the CPU 111 to control the overall operation of the printing apparatus 108 and to execute or control various processes to be described as those performed by the printing apparatus 108.
The RAM 112 includes an area for storing a computer program and data loaded from a storage medium 113 and an area for storing data received from an external apparatus via a data transfer I/F 110. In addition, the RAM 112 includes a work area used by the CPU 111 or an image processing accelerator 109 to execute processing. As described above, the RAM 112 can provide various areas.
The storage medium 113 is a nonvolatile memory device such as a hard disk. The storage medium 113 saves an operating system (OS), computer programs and data for causing the CPU 111 or the image processing accelerator 109 to execute various processes to be described as those performed by the printing apparatus 108, and the like. The computer programs and data saved in the storage medium 113 are appropriately loaded into the RAM 112 under the control of the CPU 111, and are to be processed by the CPU 111 or the image processing accelerator 109.
The image processing accelerator 109 is hardware capable of executing image processing faster than the CPU 111. The image processing accelerator 109 is activated when the CPU 111 writes a parameter and data necessary for image processing at a predetermined address of the RAM 112. The image processing accelerator 109 loads the above-described parameter and data, and then executes the image processing for the data. Note that the image processing accelerator 109 is not an essential element, and the CPU 111 may execute equivalent processing. More specifically, the image processing accelerator 109 is a GPU or an exclusively designed electric circuit. The above-described parameter can be saved in the storage medium 113 or can be acquired from an external apparatus via the data transfer I/F 110. The data transfer I/F 110 is a communication interface for performing data communication with an external apparatus via the network 107.
The image processing to be performed by the CPU 111 or the image processing accelerator 109 will now be explained. This image processing is, for example, processing of generating, based on print data acquired from the image processing apparatus 101, data indicating the dot formation position of ink in each scan by a printhead 115. The CPU 111 or the image processing accelerator 109 performs color conversion processing and quantization processing for the acquired print data.
The color conversion processing is processing of performing color separation to ink concentrations to be handled by the printing apparatus 108. For example, the acquired print data contains image data indicating an image. In a case where the image data is data indicating an image in a color space coordinate system such as sRGB as the expression colors of a monitor, data indicating an image by color coordinates (R, G, B) of the sRGB is converted into ink data (CMYK) to be handled by the printing apparatus 108. The color conversion method is implemented by matrix operation processing or processing using a three-dimensional lookup table (LUT) or a four-dimensional LUT.
The printing apparatus 108 according to this embodiment uses inks of black (K), cyan (C), magenta (M), and yellow (Y) as an example. Therefore, RGB image data is converted into image data having 8-bit color information of each of K, C, M, and Y. The color information of each color corresponds to the application amount of each ink. As for the number of ink colors, four colors of K, C, M, and Y have been described as an example. However, to improve image quality, it is also possible to additionally use other ink colors such as light cyan (Lc), light magenta (Lm), and gray (Gy) having low concentrations. In this case, ink signals corresponding to the inks are generated.
After the color conversion processing, quantization processing is performed for the ink data. This quantization processing is processing of decreasing the number of tone levels of the ink data. In this embodiment, quantization is performed by using a dither matrix in which thresholds to be compared with the values of the ink data are arrayed in individual pixels. After the quantization processing, binary data indicating whether to form a dot in each dot formation position is finally generated.
After the image processing is performed, a printhead controller 114 transfers the binary data to the printhead 115. At the same time, the CPU 111 performs printing control via the printhead controller 114 so as to operate a carriage motor for operating the printhead 115, and to operate a conveyance motor for conveying a print medium. The printhead 115 scans the print medium and also discharges ink droplets onto the print medium, thereby forming an image on the print medium.
Assume that the printhead 115 includes print nozzle arrays (115c, 115m, 115y, and 115k) of four color inks of cyan (C), magenta (M), yellow (Y), and black (K). The printhead 115 will be described with reference to
In this embodiment, an image is printed on a unit area for one nozzle array by N scans. The printhead 115 includes a carriage 116, the nozzle arrays 115k, 115c, 115m, and 115y, and an optical sensor 118. The carriage 116 on which the nozzle arrays 115k, 115c, 115m, and 115y and the optical sensor 118 are mounted can reciprocally move along the X direction (a main scan direction) in
The overall processing of the image processing apparatus 101 will be described with reference to a flowchart shown in
The processing according to the flowchart shown in
In step S101, the CPU 102 acquires, into the RAM 103, original data saved in the storage medium 104. Note that the method of acquiring original data into the RAM 103 is not limited to a specific method. For example, the CPU 102 may acquire, into the RAM 103, original data received from an external apparatus via the data transfer I/F 106.
The CPU 102 performs color information acquisition of acquiring image data (input image data) including color information from the original data acquired into the RAM 103. The image data includes, as color information, values representing a color expressed in a predetermined color space. In the color information acquisition, the values representing a color are acquired from the original data. The values representing a color are, for example, sRGB data, Adobe RGB data, CIE-L*a*b* data, CIE-LUV data, XYZ color system data, xyY color system data, HSV data, or HLS data.
In step S102, the CPU 102 performs color information conversion for the image data using color conversion information saved in advance in the storage medium 104. The color conversion information according to this embodiment is a gamut mapping table, and gamut mapping is performed for the color information of each pixel of the image data. The image data after gamut mapping is stored/saved in the RAM 103 or the storage medium 104 by the CPU 102. More specifically, the gamut mapping table is a three-dimensional lookup table. By the three-dimensional lookup table, a combination of output pixel values (Rout, Gout, Bout) can be calculated with respect to a combination of input pixel values (Rin, Gin, Bin). If each of the input pixel values Rin, Gin, and Bin has 256 tones, a table Table1[256][256][256][3] having 256×256×256=16,777,216 sets of output pixel values in total is preferably used as a gamut mapping table.
In this embodiment, the CPU 102 performs color conversion of the image data using the above-described gamut mapping table. More specifically, the CPU 102 acquires the image data in which each pixel has color information (Rout, Gout, Bout) by performing, for each pixel (each pixel having color information (Rin, Gin, Bin)) of the image data acquired in step S101, processing given by
Note that a known contrivance to reduce the table size of the gamut mapping table, such as decreasing the number of grids of the gamut mapping table from 256 to, for example, 16 and interpolating table values of a plurality of grids to decide output values, may be used.
In step S103, the CPU 102 creates a color degeneration-corrected table (TBL) using the image data acquired in step S101, the image data after gamut mapping acquired in step S102, and the gamut mapping table. The format of the color degeneration-corrected table is the same as that of the gamut mapping table. Details of the processing of step S103 will be described later.
In step S104, the CPU 102 generates corrected image data that has undergone color degeneration correction by converting the color information of the image data acquired in step S101 using the color degeneration-corrected table created in step S103. The generated corrected image data is stored/saved in the RAM 103 or the storage medium 104 by the CPU 102.
In step S105, the CPU 102 outputs the corrected image data generated in step S104 to an external apparatus via the data transfer I/F 106. For example, the CPU 102 may generate print data by converting the corrected image data into data in a print format, and output the print data to the printing apparatus 108. The gamut mapping may be mapping from the sRGB color space to the color reproduction gamut of the printing apparatus 108. In this case, it is possible to suppress decreases in chroma and color difference caused by the gamut mapping to the color reproduction gamut of the printing apparatus 108.
Details of the processing of step S103 will be described next with reference to a flowchart shown in
The CPU 102 executes the color information detection processing for each pixel included in the image data. Then, the CPU 102 determines whether the color information of the pixel is different from the unique color information detected until now. If it is determined that the color information of the pixel is unique color information, the CPU 102 registers the color information of the pixel in the unique color list. As the determination method, it is determined whether the color information of a target pixel is color information included in the unique color list, and if it is determined that the color information is not included, the color information of the target pixel is registered in the unique color list. This processing makes it possible to register the unique color information included in the image data in the unique color list.
In the above description, if the image data is sRGB data, each of the input values has 256 tones, and unique color information is thus detected from 256×256×256=16,777,216 colors in total. In this case, the number of pieces of color information is enormous, thereby decreasing the processing speed. Therefore, the CPU 102 may detect the unique color information discretely. For example, the 256 tones may be reduced to 16 tones, and then unique color information may be detected. If the number of colors is reduced, color information may be reduced to the color information of the closest grid. As described above, it is possible to detect unique color information from 16×16×16=4,096 colors in total, thereby improving the processing speed.
In step S202, based on the unique color list generated in step S201, the CPU 102 detects the number of combinations of pieces of color information subjected to color degeneration, among the combinations of the pieces of color information included in the image data. The processing of step S202 will be described with reference to a schematic view shown in
A color gamut 401 is the color gamut of the input image data. A color gamut 402 is the color gamut of the image data generated from the input image data by the gamut mapping in step S102. The input image data includes color information 403 and color information 404. Color information 405 is color information obtained by performing the gamut mapping for the color information 403. Color information 406 is color information obtained by performing the gamut mapping for the color information 404. In a case where a color difference 408 between the color information 405 and the color information 406 is smaller than a color difference 407 between the color information 403 and the color information 404, it is determined that color degeneration has occurred. The determination processing is repeated as many times as the number of combinations of the pieces of color information registered in the unique color list. As a color difference calculation method, a Euclidean distance in a color space is used. In this embodiment, a description will be made using a Euclidean distance (to be referred to as a color difference ΔE hereinafter) in the CIE-L*a*b* color space as an example. Since the CIE-L*a*b* color space is a visual uniform color space, the Euclidean distance can be approximated into the change amount of the color information. Therefore, a person perceives that the color information becomes closer as the Euclidean distance on the CIE-L*a*b* color space is smaller and that the color information is farther apart as the Euclidean distance is larger. The color information in the CIE-L*a*b* color space is represented in a color space with three axes of L*, a*, and b*. The color information 403 is represented by L403, a403, and b403. The color information 404 is represented by L404, a404, and b404. The color information 405 is represented by L405, a405, and b405. The color information 406 is represented by L406, a406, and b406. If the input image data is represented in another color space, it is converted into the CIE-L*a*b* color space using a known technique. The color difference 407 (ΔE407) and the color difference 408 (ΔE408) can be obtained by:
In a case where ΔE408 is smaller than ΔE407, it is determined that color degeneration has occurred. Furthermore, in a case where ΔE408 does not have such magnitude that a color information difference can be identified, it is determined that color degeneration has occurred. This is because if there is such color difference between the color information 405 and the color information 406 that the pieces of color information can be identified as different pieces of color information based on the human visual characteristic, it is unnecessary to correct the color difference. In terms of the visual characteristic, 2.0 may be used as the color difference ΔE with which the pieces of color information can be identified as different pieces of color information. That is, in a case where ΔE408 is smaller than ΔE407 and is smaller than 2.0, it may be determined that color degeneration has occurred.
In step S203, the CPU 102 determines whether “the number of combinations of pieces of color information subjected to color degeneration” that is detected in step S202 is 0. If “the number of combinations of pieces of color information subjected to color degeneration” is 0, the process advances to step S204; otherwise, the CPU 102 determines that the image data requires color degeneration correction, and the process advances to step S205. Since the image data does not require color degeneration correction, the CPU 102 makes a setting (no correction) of excluding the image data from the target of color degeneration correction in step S204.
On the other hand, color degeneration correction changes color information. For this reason, a color change occurs even in the combinations of pieces of color information not subjected to color degeneration, and this color change is unnecessary. The necessity of color degeneration correction may be determined based on the total number of combinations of pieces of unique color information and the number of combinations of pieces of color information subjected to color degeneration. More specifically, in a case where the majority of all the combinations of the pieces of unique color information are combinations of the pieces of color information subjected to color degeneration, it may be determined that color degeneration correction is necessary. This can suppress a trouble of a color change caused by color degeneration correction.
In step S205, based on the image data, the image data after gamut mapping, and the gamut mapping table, the CPU 102 performs color degeneration correction for the combinations of the colors subjected to color degeneration. Details of the processing in step S205 will be described with reference to
The color information 403 and the color information 404 are pieces of input color information included in the input image data. The color information 405 is color information obtained by performing color conversion for the color information 403 by gamut mapping. The color information 406 is color information obtained by performing color conversion for the color information 404 by gamut mapping. Referring to
Next, the above-described color degeneration correction will be described in detail. A color difference correction amount 409 that increases the color difference ΔE is obtained from ΔE408. In terms of the visual characteristic, the color difference ΔE with which the pieces of color information can be recognized as different pieces of color information is the difference between 2.0 and ΔE408 which is the color difference correction amount 409. For example, the difference between ΔE407 and ΔE408 is the color difference correction amount 409. The result of correcting the color information 405 by the color difference correction amount 409 on an extension from the color information 406 to the color information 405 in the CIE-L*a*b* color space is color information 410. The color information 410 is separated from the color information 406 by a color difference obtained by adding ΔE408 and the color difference correction amount 409. The color information 410 is on the extension from the color information 406 to the color information 405 in the above example, but this embodiment is not limited to this. As long as the color difference ΔE between the color information 406 and the color information 410 is equal to the color difference obtained by adding the color difference ΔE408 and the color difference correction amount 409, the direction can be any of the lightness direction, the chroma direction, and the hue angle direction in the CIE-L*a*b* color space. Not only one direction but also any combination of the lightness direction, the chroma direction, and the hue angle direction may be used. Furthermore, in the above example, color degeneration is corrected by changing the color information 405 but the color information 406 may be changed. Alternatively, both the color information 405 and the color information 406 may be corrected. If the color information 406 is corrected, the color information 406 cannot be corrected outside the color gamut 402, and thus the color information 406 is corrected (moved) to the boundary surface of the color gamut 402. Then, with respect to the shortage of the color difference ΔE, the color information 405 may be corrected, thereby performing color degeneration correction.
Next, in step S206, the CPU 102 changes the gamut mapping table (GMTBL) using the result of the color degeneration correction performed in step S205. The gamut mapping table before the change is a table for converting the color information 403 as an input color into the color information 405 as an output color. In accordance with the result of the color degeneration correction performed in step S205, the gamut mapping table is changed to a table for converting the color information 403 as an input color into the color information 410 as an output color. The Gamut mapping table change is repeated as many times as the number of combinations of the colors subjected to color degeneration.
That is, if the CPU 102 determines that a combination of the first color information included in the first area in the image data and the second color information included in the second area in the image data is a combination of pieces of color information subjected to color degeneration, the CPU 102 corrects color conversion information so that the color difference before color conversion between the first color information and the second color information and the color difference after the color conversion between the first color information and the second color information are equal to or smaller than a predetermined color difference.
With the above-described processing, by applying the color degeneration-corrected gamut mapping table to the input image data, the distance between the colors can be increased for each of the combinations of the pieces of color information subjected to color degeneration among the combinations of the pieces of unique color information included in the input image data. As a result, it is possible to reduce color degeneration with respect to the combinations of the pieces of color information subjected to color degeneration. This is because if the input image data is sRGB data, the gamut mapping table is created on the premise that the input image data has pieces of color information of 16,777,216 colors. The gamut mapping table created on this premise is created in consideration of the color degeneration and chroma even for color information that is not included in the input image data. In this embodiment, it is possible to adaptively correct the gamut mapping table with respect to the input image data by detecting the color information included in the input image data. Then, it is possible to create the gamut mapping table only for the color information included in the input image data. As a result, it is possible to perform preferred adaptive gamut mapping for the input image data, thereby reducing color degeneration.
In this embodiment, the processing in a case where the input image data includes one page has been explained. However, the input image data may include a plurality of pages. In a case where the input image data includes a plurality of pages, the processing according to the flowchart shown in
However, if correction is performed for each page, a color degeneration-corrected TBL is newly created for each page. In a case where the image processing apparatus 101 having the arrangement shown in
In step S501, the CPU 102 analyzes a page that has not been analyzed in the image data. In step S502, based on the result of the analysis in step S501, the CPU 102 determines whether color degeneration correction is necessary. If, as a result of the determination processing, it is determined that color degeneration correction is necessary, the process advances to step S503; otherwise, the process advances to step S505.
In this example, as a criterion for determining that color degeneration correction is necessary, a case where color degeneration occurs as a result of performing mapping for an input color in the page or a case where color degeneration of a predetermined proportion or more occurs for an input color in the page may be used. Assume here that it is determined that color degeneration correction is necessary for all image data (original pages) 1600, 1602, and 1604 of an original shown in
In step S503, with respect to the page for which it is determined that color degeneration correction is necessary, the CPU 102 creates a color degeneration-corrected TBL. A method of creating a color degeneration-corrected TBL is the same as in step S103 described above.
In step S504, the CPU 102 stores/saves the color degeneration-corrected TBL created in step S503 in the RAM 103 or the storage medium 104. In step S505, the CPU 102 determines whether the analysis processing of step S501 has been performed for the image data of all the pages.
If, as a result of the determination processing, the analysis processing of step S501 has been performed for the image data of all the pages, the process advances to step S506. On the other hand, if there remains the image data of a page for which the analysis processing of step S501 has not been performed, the process returns to step S501.
In step S506, the CPU 102 performs processing of combining the color degeneration-corrected TBLs. Details of the processing in step S506 will be described with reference to a flowchart shown in
In
In step S601, the CPU 102 acquires information of input colors in the page for which the color degeneration-corrected TBL has been created in step S503 (information representing the input colors in the page, the hue angles of the input colors, and whether the colors are common to colors existing in another page).
In step S602, the CPU 102 determines whether there exists a color common to another page among the input colors in each page having undergone color degeneration correction. The common color may indicate completely identical colors or colors with a color difference equal to or smaller than a predetermined color difference. An example of calculation of the color difference will be described below.
As a color difference calculation method, a Euclidean distance in a color space is used. In this embodiment, a Euclidean distance (to be referred to as the color difference ΔE hereinafter) in the CIE-L*a*b* color space is used as an example. Since the CIE-L*a*b* color space is a visual uniform color space, a numerical color change or difference on the CIE-L*a*b* color space can be approximated into a change that can be recognized by the human eye. An input color 1607 as one of the input colors of the original page 1600 and an input color 1610 as one of the input colors of the original page 1602 will be exemplified.
On the CIE-L*a*b* color space, the input color 1607 is represented by L1607, a1607, and b1607, and the input color 1610 is represented by L1610, a1610, and b1610. A color difference ΔE1611 between the input colors 1607 and 1610 can be obtained by:
If ΔE1611 is 0, the input colors 1607 and 1610 are completely identical colors, and are determined as the common color. Alternatively, if the color difference ΔE1611 does not have such magnitude that the color difference can be identified, the input color 1607 and an input color 1611 cannot be recognized as different colors by the human eye, and can thus be determined as the common color. In terms of the visual characteristic, 2.0 is used as the color difference ΔE with which the colors can be identified as different colors. That is, in a case where the color difference ΔE1611 falls within a range of 0 (inclusive) to 2.0 (inclusive), the colors are determined as the common color.
In this example, there exists one common color between the original pages 1602 and 1604, and there is no common color in the remaining combinations of the pages. In the table 1901 shown in
Next, in step S602, the CPU 102 determines whether there exist TBLs that can be combined. A condition for determining that TBLs can be combined will be described. A condition for determining that the first TBL and the second TBL can be combined is that there is no common color between pages for which the respective TBLs have been created.
The above-described determination processing is performed in step S602. If it is determined that there are no TBLs that can be combined, the processing according to the flowchart shown in
On the other hand, if it is determined that there are TBLs that can be combined, the process advances to step S603. In step S603, the CPU 102 performs TBL combining processing. The TBL combining processing will be described by exemplifying
A gamut mapping table 2001 indicates a gamut mapping table used to perform the gamut mapping in step S102. Each row of the gamut mapping table 2001 describes RGB values (output values) output as a result of performing the gamut mapping for input RGB values (input values). As a result of performing color degeneration correction for the gamut mapping table 2001, color degeneration-corrected TBLs 2002 and 2003 are obtained.
In the color degeneration-corrected TBL 2002, color degeneration correction has been performed for the fourth, sixth, and seventh rows of the gamut mapping table 2001. In the color degeneration-corrected TBL 2003, color degeneration correction has been performed for the first, second, third, and eighth rows of the gamut mapping table 2001. A row for which color degeneration correction has been performed since the input values are common in each color degeneration-corrected TBL can be copied to the corresponding row of a combined TBL, thereby combining the TBLs. The combined TBL is a combined color degeneration-corrected TBL 2004. Then, the combined color degeneration-corrected TBL 2004 is applied to an application target corresponding to the color degeneration-corrected TBL 2002 and an application target corresponding to the color degeneration-corrected TBL 2003, instead of the color degeneration-corrected TBL 2002 and the color degeneration-corrected TBL 2003, respectively.
After the end of the TBL combining processing in step S603, the TBL combining processing in step S506 ends and the process advances to step S507. In step S507, the CPU 102 corrects the page by applying the combined color degeneration-corrected TBL to each page, similar to step S104.
With the above-described processing, the number of color degeneration-corrected TBLs generated for respective pages decreases in a case where input colors are different for each page without reducing the effect of color degeneration correction, thereby reducing the TBL transfer time and thus shortening the total processing time.
Note that in this embodiment, determination processing is performed for the input colors of each page. However, determination processing may be performed for a color degeneration-corrected TBL generated for each page, and combining processing may be performed for the TBLs based on the determination result. The TBL combining processing in this case will be described with reference to a flowchart shown in
In step S701, the CPU 102 sets a combination of TBLs to be combined. For example, assume that a combination of color degeneration-corrected TBLs 2202 and 2203 shown in
Next, in step S702, the CPU 102 detects corrected grids for each TBL. For example, the first, second, third, and eighth rows are detected in the color degeneration-corrected TBL 2202 and the first, sixth, and seventh rows are detected in the color degeneration-corrected TBL 2203.
Next, in step S703, the CPU 102 determines whether there exist identical correction target grids between the TBLs to be combined. In this example, since the first rows are identical, it is determined that “there exist identical correction target grids between the TBLs to be combined” (YES), and the process advances to step S704.
In this example, for example, if a color degeneration-corrected TBL 2201 and the color degeneration-corrected TBL 2202 are set as a combination of TBLs to be combined, there are no identical correction target grids. Therefore, it is determined that “there are no identical correction target grids between the TBLs to be combined” (NO), and the process advances to step S603.
In step S704, the CPU 102 determines whether the correction values are the same. In a case where the correction values are the same, colors whose correction values are completely the same or colors with a color difference equal to or smaller than a predetermined color difference may be indicated. A color difference calculation method is as described above. In this example, the process advances on the premise that colors whose correction values are completely the same are identical. For example, the correction values of the first row of the color degeneration-corrected TBL 2202 are Rout1′, Gout1′, and Bout1′ while the correction values of the first row of the color degeneration-corrected TBL 2203 are Rout1″, Gout1″, and Bout1″. In this case, the correction values are not the same. Therefore, in this case, the result of the determination processing is NO and the TBL combining processing is not performed. If, for example, the color degeneration-corrected TBLs 2201 and 2203 are set as a combination of TBLs to be combined, the sixth and seventh rows are the determination targets of this processing. In this case, the correction values of the color degeneration-corrected TBLs 2201 and 2203 are Rout6′, Gout6′, and Bout6′ and Rout7′, Gout7′, and Bout7′, and the correction values are the same. Therefore, in this case, the result of the determination processing is YES, and the process advances to step S603.
In step S705, the CPU 102 determines whether the above processing has been performed for all the combinations. At this time, it may be possible to combine the combined TBL with another TBL, and thus the combined TBL is also the target of a combination to undergo the processing.
If, as a result of the determination processing, it is determined that the above processing has been performed for all the combinations, the processing according to the flowchart shown in
A Graphical User Interface (GUI) exemplified in
In “color correction”, radio buttons for making it possible to make a setting for performing driver correction (first row), a setting for performing ICM correction (second row), and a setting for performing no correction (third row) are provided, and a setting corresponding to the radio button instructed in accordance with a user operation is made.
In “adaptive gamut mapping”, radio buttons for making it possible to make a setting for performing gamut mapping (first row) and a setting for performing no gamut mapping (second row) are provided, and a setting corresponding to the radio button instructed in accordance with a user operation is made.
Note that the arrangement of the GUI, the setting contents, the setting method, the operation method of the GUI, the device that displays the GUI, and the like are merely examples, and are not intended to limit the scope of the present invention.
In each of the following embodiments including this embodiment, the difference from the first embodiment will be described and each embodiment is assumed to be the same as the first embodiment, unless it is specifically stated otherwise. In the above-described first embodiment, color degeneration correction is performed for each color. Therefore, depending on a combination of pieces of color information of input image data, the degree of color degeneration is reduced but a tint may change. More specifically, in a case where color degeneration correction is performed for two pieces of color information having different hue angles, if the color information is changed by changing the hue angle, the tint may be different from the tint of the color information in input image data. If, for example, color degeneration correction is performed for blue and purple by changing the hue angle, purple changes to red. If the tint changes, this may cause the user to recall a failure of an apparatus such as an ink discharge failure.
In the above-described first embodiment, color degeneration correction is repeated as many times as the number of combinations of the pieces of unique color information of the input image data. Therefore, it is possible to reliably increase the distance between the pieces of color information. However, in a case where the number of combinations of pieces of unique color information of the input image data increases, as a result of changing the color information to increase the distance between the pieces of color information, the distance between the changed color information and another unique color information may be decreased. To cope with this, the CPU 102 needs to repeatedly perform color degeneration correction in step S205 so as to have expected distances between pieces of color information with respect to all the combinations of the pieces of unique color information of the input image data. Since, however, the amount of processing of increasing the distance between pieces of color information is enormous, the processing time increases. In this embodiment, color degeneration correction is performed in the same correction direction for every predetermined hue angle by setting a plurality of pieces of unique color information as one color information group. To perform correction by setting a plurality of pieces of unique color information as one color information group, unique color information as a reference is selected from the color information group. By limiting the correction direction to the lightness direction, it is possible to suppress a change of a tint. By performing correction by setting the plurality of pieces of unique color information as one color information group, it is unnecessary to perform processing for all the combinations of the pieces of color information of input image data, thereby reducing the processing time.
First, the CPU 102 decides unique color information as the reference of the color degeneration correction processing for each hue range. As an example, the maximum lightness color, the minimum lightness color, and the maximum chroma color are decided as reference colors. In
Next, the CPU 102 calculates, for each hue range, a correction ratio R from the number of combinations of the pieces of unique color information and the number of combinations of the pieces of color information subjected to color degeneration within the target hue range. As an example, a calculation formula is given by:
correction ratio R=number of combinations of pieces of color information subjected to color degeneration/number of combinations of pieces of unique color information
The correction ratio R is lower as the number of combinations of the pieces of color information subjected to color degeneration is smaller, and is higher as the number of combinations of the pieces of color information subjected to color degeneration is larger. As described above, as the number of combinations of the pieces of color information subjected to color degeneration is larger, color degeneration correction can be performed more strongly.
Next, the CPU 102 calculates, for each hue range, a correction amount based on the correction ratio R and pieces of color information of the maximum lightness, the minimum lightness, and the maximum chroma. The CPU 102 calculates, as correction amounts, a correction amount Mh on a side brighter than the maximum chroma color and a correction amount Ml on a side darker than the maximum chroma color.
The color information 601 as the maximum lightness color is represented by L601, a601, and b601. The color information 602 as the minimum lightness color is represented by L602, a602, and b602. The color information 603 as the maximum chroma color is represented by L603, a603, and b603. As an example, the correction amount Mh is a value obtained by multiplying the color difference ΔE between the maximum lightness color and the maximum chroma color by the correction ratio R. As an example, the correction amount Ml is a value obtained by multiplying the color difference ΔE between the maximum chroma color and the minimum lightness color by the correction ratio R. Calculation formulas of the correction amounts Mh and Ml are given by:
As described above, the color difference ΔE to be held after gamut mapping can be calculated. The color difference ΔE to be held after gamut mapping is the color difference ΔE before gamut mapping. In
Next, the CPU 102 generates a color degeneration-corrected table for each hue range. The color degeneration-corrected table is a correction table for expanding lightness in the lightness direction based on the lightness of the maximum chroma color and the correction amounts Mh and Ml. In
The correction table for expanding lightness in the lightness direction is a 1D LUT (one-dimensional lookup table). Lightness before correction is input, and lightness after correction is output. The lightness after correction is decided based on minimum lightness after correction, the lightness of the maximum chroma color after gamut mapping, and maximum lightness after correction. The maximum lightness after correction is lightness obtained by adding the correction amount Mh to the lightness of the maximum chroma color. The minimum lightness after correction is lightness obtained by subtracting the correction amount Ml from the lightness of the maximum chroma color after gamut mapping. The table for expanding lightness in the lightness direction is created by linearly changing the minimum lightness after correction to the lightness of the maximum chroma color after gamut mapping and linearly changing the lightness of the maximum chroma color after gamut mapping to the minimum lightness after correction. In
If the maximum lightness after correction exceeds the maximum lightness of the color gamut after gamut mapping, the CPU 102 performs maximum value clip processing. The maximum value clip processing subtracts the difference between the maximum lightness after correction and the maximum lightness of the color gamut after gamut mapping in the whole correction table. In this case, the lightness of the maximum chroma color after gamut mapping is also changed to the low lightness side. As described above, if the pieces of unique color information of the input image data are localized to the high lightness side, it is possible to improve the color difference ΔE by using the lightness tone on the low lightness side. If the minimum lightness after correction is lower than the minimum lightness of the color gamut after gamut mapping, the CPU 102 performs minimum value clip processing. The minimum value clip processing adds the difference between the minimum lightness after correction and the minimum lightness of the color gamut after gamut mapping in the whole correction table. As described above, if the pieces of color information of the input image data are localized to the low lightness side, it is possible to reduce color degeneration by using the lightness tone on the high lightness side.
Next, the CPU 102 applies, to the gamut mapping table, the color degeneration-corrected table created for each hue range. First, based on color information held by the output color of the gamut mapping, the CPU 102 decides the color degeneration-corrected table of a specific hue angle to be applied. For example, if the hue angle of the output color of the gamut mapping is 25°, the CPU 102 applies the color degeneration-corrected table of the hue range 501 shown in
As described above, the color degeneration-corrected table created based on the reference color is also applied to color information other than the reference color, thereby limiting the correction direction to the lightness direction and thus suppressing a change of a tint. Furthermore, it is unnecessary to perform color degeneration correction processing for all the combinations of pieces of unique color information of the input image data, thereby making it possible to reduce the processing time.
In addition, in accordance with the hue angle of the output color of the gamut mapping, the color degeneration-corrected tables of adjacent hue ranges may be blended. For example, if the hue angle of the output color of the gamut mapping is Hn°, the color degeneration-corrected table of the hue range 501 and that of a hue range 502 are blended. More specifically, the lightness value of the output color after the gamut mapping is corrected by the color correction table of the hue range 501 to obtain a lightness value Lc501. The lightness value of the output color after the gamut mapping is corrected by the color correction table of the hue range 502 to obtain a lightness value Lc502. The intermediate hue angle of the hue range 501 is a hue angle H501, and the intermediate hue angle of the hue range 502 is a hue angle H502. The corrected lightness value Lc501 and the corrected lightness value Lc502 are interpolated by the hue angle of the output value after the gamut mapping. Lc is obtained by:
As described above, by blending the color degeneration-corrected tables to be applied, in accordance with the hue angle, it is possible to suppress a sudden change of correction intensity caused by a change of the hue angle. If the color space of the color information after correction is different from the color space of the output color after gamut mapping, the color space is converted and set as the output color after gamut mapping. For example, if the color space of the color information after correction is the CIE-L*a*b* color space, a search is performed to obtain an output color after gamut mapping.
If the value after correction exceeds the color gamut after gamut mapping, mapping to the color gamut after gamut mapping is performed. As an example, a mapping method is color difference minimum mapping that focuses on lightness and hue. In color difference minimum mapping that focuses on lightness and hue, the color difference ΔE is calculated by equation (10) below. Color information of a color exceeding the color gamut in the CIE-L*a*b* color space is represented by Ls, as, and bs. Color information of a color within the color gamut after gamut mapping is represented by Lt, at, and bt. ΔL represents a lightness difference, ΔC represents a chroma difference, and ΔH represents a hue difference. In addition, WI represents a weight of lightness, Wc represents a weight of chroma, Wh represents a weight of a hue angle, and ΔEw represents a weighted color difference. At this time, the weighted color difference ΔEw is obtained by equations (10) to (14) below.
Since the color difference ΔE is expanded in the lightness direction, it is possible to more correctly perform color degeneration correction by performing mapping by focusing on lightness more than chroma. That is, the weight WI of lightness is larger than the weight Wc of chroma. Furthermore, since hue largely influences a tint, it is possible to minimize a change of the tint before and after correction by performing mapping by focusing on hue more than lightness and chroma. That is, the weight Wh of hue is equal to or larger than the weight WI of lightness, and is larger than the weight Wc of chroma. As described above, it is possible to correct the color difference ΔE while maintaining a tint.
Furthermore, the color space may be converted at the time of performing color difference minimum mapping. It is known that in the CIE-L*a*b* color space, a color change in the chroma direction does not obtain the same hue. Therefore, if a change of the hue angle is suppressed by increasing the weight of hue, mapping to a color of the same hue is not performed. Thus, the color space may be converted into a color space in which the hue angle is bent so that the color change in the chroma direction obtains the same hue. As described above, by performing color difference minimum mapping by weighting, it is possible to suppress a change of a tint. Referring to
In this embodiment, the color degeneration-corrected table is created for each hue range. The color degeneration-corrected table may be created by combining with that of the adjacent hue range. More specifically, within a hue range obtained by combining the hue ranges 501 and 502 in
In this embodiment, the color difference ΔE is corrected in the lightness direction by setting a plurality of pieces of unique color information as one color information group. As the visual characteristic, sensitivity to the lightness difference varies depending on chroma. Sensitivity to the lightness difference of low chroma is higher than sensitivity to the lightness difference of high chroma. Therefore, the correction amount in the lightness direction may be controlled by a chroma value. Correction is performed so that the correction amount is small for low chroma, and is performed by the above-described correction amount for high chroma. More specifically, when applying the color degeneration-corrected table to the gamut mapping table, the lightness value Ln before correction and the lightness value Lc after correction are internally divided by a chroma correction ratio S, as given by equation (16) below. Based on a chroma value Sn of the output color after gamut mapping and a maximum chroma value Sm of the color gamut after gamut mapping at the hue angle of the output color after gamut mapping, the chroma correction ratio S is calculated, as given by equation (15) below.
Furthermore, the correction amount may be set to zero in a low-chroma color gamut. With this arrangement, it is possible to suppress a color change around a gray axis. As described above, since color degeneration correction can be performed in accordance with the visual sensitivity, it is possible to suppress excessive correction.
In the above-described second embodiment, color degeneration correction is performed for each hue range. Therefore, if the pieces of color information of the input image data have different hue angles and the lightness difference after gamut mapping is small, identifiability may decrease. For high chroma and different hue angles, even after gamut mapping, the distance between pieces of color information that is enough to identify the pieces of color information is maintained. However, if the lightness difference is small, it is difficult to identify the pieces of color information. In this embodiment, if a lightness difference after gamut mapping is smaller than a predetermined color difference ΔE, it is possible to suppress a decrease in identifiability by performing correction to increase the lightness difference.
Color degeneration determination processing according to this embodiment will be described. In step S202 according to this embodiment, based on a unique color list generated in step S201, a CPU 102 detects the number of combinations of pieces of color information subjected to color degeneration, among combinations of pieces of unique color information included in image data. The processing of step S202 according to this embodiment will be described with reference to a schematic view shown in
The ordinate in
In a case where the lightness difference ΔL808 is smaller than the lightness difference ΔL807, it is determined that the lightness difference decreases. Furthermore, in a case where the lightness difference ΔL808 does not have such magnitude that a color difference can be identified, it is determined that color degeneration has occurred. This is because if there is such lightness difference between the color information 805 and the color information 806 that the pieces of color information can be identified as different colors based on the human visual characteristic, it can be determined that it is unnecessary to correct the lightness difference. In terms of the visual characteristic, 0.5 may be used as the lightness difference ΔL with which the pieces of color information can be identified as different colors. That is, in a case where the lightness difference ΔL808 is smaller than the lightness difference ΔL807 and is smaller than 0.5, it may be determined that the lightness difference decreases.
Color degeneration correction processing of step S205 according to this embodiment will be described next with reference to
correction ratio T=number of combinations of pieces of color information with decreased lightness difference/number of combinations of pieces of unique color information
The correction ratio Tis lower as the number of combinations of the pieces of color information with the decreased lightness difference is smaller, and is higher as the number of combinations of the pieces of color information with the decreased lightness difference is larger. As described above, as the number of combinations of the pieces of color information with the decreased lightness difference is larger, color degeneration correction can be performed more strongly.
Next, lightness difference correction is performed based on the correction ratio T and lightness before gamut mapping. Lightness Lc after lightness difference correction is obtained by internally dividing lightness Lm before gamut mapping and lightness Ln after gamut mapping by the correction ratio T. A calculation formula is given by:
The above lightness difference correction processing is repeated as many times as the number of pieces of unique color information in the input image data. Referring to
This embodiment may be performed simultaneously with the second embodiment. In this case, the lightness difference correction processing is performed for a reference color of color degeneration correction processing. Along with correction of the lightness difference of the reference color, lightness difference correction of other color information can also be processed. As described above, it is possible to reduce color degeneration and a decrease in the lightness difference caused by gamut mapping, and also to reduce a change of a tint.
In each of the above-described first, second, and third embodiments, processing is performed for the whole input image data. Among pieces of color information included in the input image data, some identical pieces of color information have different meanings. For example, color information used in a graph and color information used as part of gradation have different meanings in identification. For color information used in a graph, it is important to distinguish the color information from other color information in the graph, and it is thus necessary to perform color degeneration correction strongly. However, for color information used as part of gradation, tonality with pieces of color information of surrounding pixels is important, and it is thus necessary to perform color degeneration correction weakly. The two pieces of color information may be identical pieces of color information and undergo correction at the same time. In this case, if color degeneration correction of the color information in the graph is focused on, color degeneration correction is performed strongly, and tonality in gradation degrades. On the other hand, if tonality in gradation is focused on, color degeneration correction is performed weakly, and identifiability of the color information in the graph degrades. In addition, the number of combinations of pieces of unique color information that reduce the degree of color degeneration becomes large, and the reduction effect lowers. This is conspicuous in a case where the input image data includes a plurality of pages and color degeneration correction processing is performed for the plurality of pages. Even if the input image data includes one page, color degeneration correction processing is performed for the entire page, thereby causing the same problem.
In this embodiment, by setting a plurality of areas even for a plurality of pages, it is possible to perform color degeneration correction processing individually for each area. Then, the color degeneration correction processing of target color information can be performed with appropriate correction intensity in accordance with pieces of color information on the periphery. As described above, color information in a graph can be corrected by focusing on identifiability, and color information in gradation can be corrected by focusing on tonality.
In step S303, a CPU 102 sets areas in input image data. Details of step S303 will be described later. In step S304, the CPU 102 selects, as a selected area, an unselected area among the areas set in step S303, and creates the above-described color degeneration-corrected TBL for the selected area. In step S305, the CPU 102 applies, to the selected area, the color degeneration-corrected TBL created for the selected area in step S304, thereby performing correction.
In step S306, the CPU 102 determines whether all the areas set in step S303 have been selected as selected areas. If, as a result of the determination processing, all the areas set in step S303 have been selected as selected areas, the process advances to step S105. On the other hand, if, among the areas set in step S303, there remains an area that has not been selected as a selected area, the process advances to step S304.
The above area setting processing in step S303 will be described in detail.
In some cases, drawing instructions such as a DOT drawing instruction for drawing a dot, a LINE drawing instruction for drawing a line, and a CIRCLE drawing instruction for drawing a circle are used as needed in accordance with the application purpose. For example, general PDL such as Portable Document Format (PDF) proposed by Adobe®, XPS proposed by Microsoft®, or HP-GL/2 proposed by HP® may be used.
The page 1000 in
<PAGE=001> is a tag representing the number of pages in this embodiment. Normally, since the PDL is designed to be able to describe a plurality of pages, a tag representing a page break is described in the PDL. In this example, the section up to </PAGE> represents the first page. In this embodiment, this corresponds to the page 1000 in
The section from <TEXT> of the second row to </TEXT> of the third row is drawing instruction 1, and this corresponds to the first row of an area 1001 in
The section from <TEXT> of the fourth row to </TEXT> of the fifth row is drawing instruction 2, and this corresponds to the second row of the area 1001 in
The section from <TEXT> of the sixth row to </TEXT> of the seventh row is drawing instruction 3, and this corresponds to the third row of the area 1001 in
The section from <BOX> to </BOX> of the eighth row is drawing instruction 4, and this corresponds to an area 1002 in
Next, an IMAGE instruction from <IMAGE> to </IMAGE> of the ninth and 10th rows corresponds to an area 1003 in
There is a case where an actual PDL file integrates “STD” font data and a “PORTRAIT.jpg” image file in addition to the above-described drawing instruction group. This is because if the font data and the image file are separately managed, the character portion and the image portion cannot be formed only by the drawing instructions, and information needed to form the image shown in FIG. 10 is insufficient. In addition, an area 1004 in
In an original page described in PDL, like the page 1000 shown in
In addition, it is found that both the BOX instruction and the IMAGE instruction are apart from the TEXT instructions by 100 pixels in the Y direction. Next, in the BOX instruction and the IMAGE instruction, the start points and the end points of the drawing X-coordinates are as follows, and it is found that these are apart by 50 pixels in the X direction.
Thus, three areas can be set as follows.
Not only the configuration for thus analyzing PDL and performing area setting but also a configuration for performing area setting using a drawing result may be employed. The configuration will be described below.
In step S401, the CPU 102 divides a page into a plurality of unit tiles. This embodiment assumes that the page is divided into “unit tiles each having a size of 30 pixels in each of the vertical and horizontal directions” but the size of the unit tile is not limited to a specific size.
First, the CPU 102 sets an array Area_number[20][27] for holding an area number set for each unit tile. The page includes 600 pixels×800 pixels, as described above. The unit tiles each having a size of 30 pixels in each of the vertical and horizontal directions include 20 unit tiles in the horizontal (X) direction×27 unit tiles in the vertical (Y) direction.
In step S402, the CPU 102 determines, for each unit tile, whether the unit tile is a blank tile. This determination may be done based on the start point and the end point of the X- and Y-coordinates in a drawing instruction, as described above, or may be done by detecting, as a blank tile, a tile in which all pixel values in the actual unit tile are R=G=B=255. Whether to determine based on the drawing instruction or determine based on the pixel values may be decided based on the processing speed and the detection accuracy. In step S403, the CPU 102 sets the initial values of the values as follows.
More specifically, the setting is done in the following way.
area_number[x1][y1]=0 Blank tile (x1, y1):
area_number[x1][y1]=−1 Non-blank tile (x2, y2):
max_area_number=0 Area number maximum value:
That is, at the time of completion of the processing of step S403, each of all the unit tiles is set with an area number of “0” or “−1”. In step S404, the CPU 102 searches for a unit tile whose area number is “−1”. More specifically, by determining whether area_number[x][y]=−1 is satisfied for the ranges of x=0 to 19 and y=0 to 26, the CPU 102 searches for, as a blank tile, a unit tile corresponding to the set of x and y satisfying area_number[x][y]=−1. Upon detecting a unit tile with the area number “−1” for the first time, the process advances to step S405.
In step S405, the CPU 102 determines whether a unit tile set with the area number “−1” exists. If, as a result of the determination processing, a unit tile set with the area number “−1” exists, the process advances to step S406; otherwise, the process advances to step S410.
In step S406, the CPU 102 increments the area number maximum value by 1, and sets the area number of the unit tile determined as a blank tile to the updated area number maximum value. More specifically, if area_number[x3][y3]=−1 is satisfied, the following processing is performed.
max_area_number=max_area_number+1
area_number[x3][y3]=max_area_number
For example, here, since the area is an area detected for the first time after the processing of step S406 is executed for the first time, the area number maximum value is “1”, and the area number of the tile is set to “1”. From then on, every time step S406 is processed, max_area_number increases by one. After this, in steps S407 to S409, processing of expanding continuous non-blank areas as the same area is performed.
In step S407, the CPU 102 searches for a unit tile that is a tile adjacent to the unit tile whose area number is the area number maximum value and has the area number “−1”. More specifically, the following determination is performed for the ranges of x=0 to 19 and y=0 to 26.
if(area_number[x][y]=max_area_number)
if((area_number[x−1][y]=−1) or
(area_number[x+1][y]=−1) or
(area_number[x][y−1]=−1) or
(area_number[x][y+1]=−1))→adjacent tile with area number “−1” is detected else→adjacent tile with area number “−1” is not detected
Upon detecting an adjacent tile with the area number “−1” for the first time in the search in step S407, the process advances to step S408. In step S408, the CPU 102 determines whether an adjacent tile with the area number “−1” is detected.
If, as a result of the determination processing, an adjacent tile with the area number “−1” is detected, the process advances to step S409; otherwise, the process returns to step S404.
In step S409, the CPU 102 sets the area number of the unit tile that is adjacent to the adjacent tile with the area number “−1” to the area number maximum value. More specifically, the following processing is performed by setting the position of the adjacent tile with the area number “−1” (the tile position of interest) to (x4, y4).
if((area_number[x4−1][y4]=−1)area_number[x4−1][y4]=max_area_number
if((area_number[x4+1][y4]=−1)area_number[x4+1][y4]=max_area_number
if((area_number[x4][y4−1]=−1)area_number[x4][y4−1]=max_area_number
if((area_number[x4][y4+1]=−1)area_number[x4][y4+1]=max_area_number
If the area number of the adjacent tile is updated in step S409, the process returns to step S407 to continue the search to check whether another adjacent non-blank tile exists. In a situation in which no adjacent non-blank tile exists, that is, if a tile to which the area number maximum value should be added does not exist, the process returns to step S404.
If the area numbers of all the unit tiles are not “−1”, that is, if all the unit tiles are blank tiles or any area number is set, it is determined that there exists no unit tile with the area number “−1”.
In step S410, the CPU 102 sets the area number maximum value as the number of areas. That is, the area number maximum value set so far is the number of areas existing in the page. The area setting processing in the page is thus ended.
As shown in
A human visual sense has a characteristic that the difference between two colors that are spatially adjacent or exist in very close places can relatively easily be perceived, but the difference between two colors that exist in places spatially far apart can relatively hardly be perceived. That is, the result of “output as different colors” can readily be perceived in a case where the processing is performed for identical colors that are spatially adjacent or exist in very close places, but can hardly be perceived in a case where the processing is performed for identical colors that exist in places spatially far apart.
In this embodiment, areas considered as different areas are separated by a predetermined distance or more on a paper surface. For example, if printing is executed on an A4 paper, a distance is 0.7 mm or more. The distance may be changed in accordance with a printed paper size. Alternatively, the distance may be changed in accordance with an assumed observation distance. Furthermore, even if the areas are not separated by the predetermined distance on the paper surface, different objects may be considered as different areas. For example, even if an image area and a box area are not separated by the predetermined distance, the object types are different, and thus these areas may be set as different areas. In this embodiment, pixel positions considered to be in the same area are separated via a background color by a distance equal to or smaller than a predetermined distance on a paper surface. Examples of the background color are white, black, and gray. The background color may be a background color defined in original data. If printing is executed on an A4 paper, the predetermined distance is, for example, less than 0.7 mm. The distance may be changed in accordance with a printed paper size. Alternatively, the distance may be changed in accordance with an assumed observation distance. Furthermore, even if the areas are separated by the predetermined distance or smaller on the paper surface, the areas may be considered as different areas in the case of different objects. For example, even if an image area and a box area are separated by the predetermined distance or smaller, the object types are different, and thus these areas may be set as different areas.
As described above, in this embodiment, by performing area division as described above, it is possible to limit the number of combinations of pieces of color information to undergo color degeneration correction processing. By limiting the number of combinations of pieces of color information, it is possible to perform the same color degeneration correction even for different areas having the identical color distributions. As a result, the results of correction for graphs that are separated as areas but have identical pieces of color information can be identical.
Furthermore, by limiting the number of combinations of pieces of color information to undergo color degeneration correction processing, it is possible to increase a color gamut for increasing the distance between the pieces of color information, thereby decreasing the degree of color degeneration.
As described above, in this embodiment, even in the same page, portions that are spatially far apart are set as different areas and mapping suitable for each area is set, thereby making it possible to reduce a decrease in chroma and the degree of color degeneration.
In step S303, the CPU 102 may divide the original data into a plurality of “partial pages”. “Partial page” in this embodiment will now be described. As described above, the original data as the print target is document data formed by a plurality of pages. “Partial page” represents how the plurality of pages included in the document data should be put together and subjected to creation of the above-described color degeneration-corrected gamut mapping table. For example, assume that the document data is formed by first to third pages. If each page is a target of creation of a mapping table, each of the first page, the second page, and the third page is a “partial page”. If the first page and the second page, and the third page are targets of creation of a mapping table, the first page and the second page form a “partial page”, and the third page also forms a “partial page”. In addition, the “partial page” is not limited to a unit on a page basis included in the document data. For example, a partial area of the first page may be a “partial page”. In step S303, the original data is divided into a plurality of “partial pages” in accordance with a predetermined unit of “partial pages”. Note that the unit of “partial pages” may be designated by the user.
As described above, in this embodiment, even for a plurality of pages, partial pages are set as different areas, and the color degeneration-corrected gamut mapping table is applied to each area, thereby making it possible to reduce a decrease in chroma and the degree of color degeneration.
In this embodiment, correction processing is performed for each area. In the processing according to the flowchart shown in
This problem can be solved by performing TBL combining processing described in the first embodiment for the areas.
In step S801, the CPU 102 performs analysis processing o the set area. In this analysis processing, the analysis target of page analysis in step S501 is an area, and the CPU 102 determines, for the area, in step S502, whether color degeneration correction is necessary. As a criterion for determining that color degeneration correction is necessary, a case where the area is a graphic area, a case where color degeneration has occurred as a result of performing mapping for an input color of the area, or a case where color degeneration of a predetermined proportion or more occurs for an input color of the area may be used. If, as a result of the determination processing, it is determined that color degeneration correction is necessary, the process advances to step S304; otherwise, the process advances to step S306.
In step S802, the CPU 102 stores a color degeneration-corrected TBL created in step S304 in the RAM 103. In step S306, it is determined whether the analysis processing of step S801 has been performed for all the areas. If, as a result of the determination processing, the analysis processing of step S801 has been performed for all the areas, the process advances to step S506. If there remains an area for which the analysis processing of step S801 has not been performed, the process returns to step S801. In step S506, the CPU 102 performs processing of combining the color degeneration-corrected TBLs stored in the RAM 103 in step S802.
With the above-described processing, the number of color degeneration-corrected TBLs generated for respective pages decreases in a case where input colors are different for each page without reducing the effect of color degeneration correction, thereby reducing the TBL transfer time and thus shortening the total processing time.
In this embodiment, determination processing is performed for the input colors of each area. However, determination processing may be performed for a color degeneration-corrected TBL generated for each area, and combining processing may be performed for the TBLs based on the determination result.
With the above-described processing, the number of color degeneration-corrected TBLs generated for respective pages decreases except for a case where values in identical grids of TBLs are different without reducing the effect of color degeneration correction, thereby reducing the TBL transfer time and thus shortening the total processing time.
If the processing according to the above-described flowchart of
An original page 2400 includes areas 2401, 2402, and 2403. Assume that the first color degeneration-corrected TBL is created for the area 2401, the second color degeneration-corrected TBL is created for the area 2402, and the third color degeneration-corrected TBL is created for the area 2403. If the number of arithmetic circuits is two, the area 2403 and the third color degeneration-corrected TBL exceed by one. The arithmetic circuit performs processing of applying the correction table for each pixel from the upper left pixel of the original page. At this time, assume that the areas to be processed by the arithmetic circuit are area 2401→area 2403→area 2401→area 2402→area 2403→area 2401→area 2403. In this case, the correction table is transferred at the timing of switching the area in processing of area 2401→area 2402 and area 2402→area 2403, and the transfer time is required. As a result, the processing speed decreases. The same applies to a case where the CPU 102 is the main constituent of the processing. This embodiment will describe a processing procedure of making it possible to suppress a decrease in processing speed even if the CPU 102 is the main constituent of the processing but the image processing accelerator 105 may be the main constituent of the following processing. Gamut mapping processing according to this embodiment will be described with reference to a flowchart shown in
In step S901, a CPU 102 stores a flag indicating that color degeneration correction is necessary in a RAM 103 in association with a corresponding area. Then, this processing is performed for all the areas without creating and saving a color degeneration-corrected TBL.
After that, in step S902, the CPU 102 performs area joining processing. Details of the processing of step S902 will be described with reference to a flowchart shown in
In step S1001, the CPU 102 acquires color information of each area stored in the RAM 103 in association with a flag indicating that color degeneration correction is necessary. In step S1002, the CPU 102 sets a combination of areas (joining target areas) for which it is determined whether the areas are to be combined.
In step S1003, the CPU 102 determines whether there exist pieces of color information of the same hue angle. As described in the second embodiment, in a case where correction is performed for the same hue angle, if a joined area includes colors that are not common but have the same hue angle, correction results are different. Therefore, a combination including only colors whose correction results are the same and that do not have the same hue angle is set as a joining target.
If, as a result of the determination processing, there exist pieces of color information of the same hue angle (NO), the process advances to step S1005; otherwise (YES), the process advances to step S1004.
In step S1004, the CPU 102 joins the joining target areas to set one new area including all the joining target areas. The processing of step S1004 will be described by exemplifying
Image data 2700 shown in
The input color 2713 is identical to the input color 2715, and considered as a common color. The remaining input colors 2708, 2709, 2710, 2711, 2712, 2714, 2716, 2717, and 2718 are not common to any colors.
With respect to the image data 2700, if an area where there is no common color is set as a joining target, an area 2707 including the three areas 2702, 2703, and 2706 is newly set in step S1004. Then, area analysis is performed again by including the area newly set by this processing, thereby creating a color degeneration-corrected TBL for each area. In
In step S1005, the CPU 102 determines whether the above processing has been performed for all the combinations of the areas. If, as a result of the determination processing, the above processing has been performed for all the combinations of the areas, the processing according to the flowchart shown in
Since the joined area can be joined with another area in some cases, the joined area is also the target of a combination. In the processing of step S902, the areas 2702, 2703, and 2706 are set as the one area 2707 to undergo processing.
With the above-described processing, while maintaining the effect of color degeneration correction, the number of areas to undergo correction decreases in a case where there are no colors of the same hue angle. For example, in
In this embodiment, determination processing is performed for the input colors of each area. However, determination processing may be performed for a color degeneration-corrected TBL generated for each area, and combining processing may be performed for the areas and the TBLs based on the determination result.
Processes up to step S502 are as described above. With respect to areas for which it is determined that color degeneration correction is necessary, a color degeneration-corrected TBL is created for each area in step S304, and the created color degeneration-corrected TBL is stored in the RAM 103 in step S802. After this processing is performed for all the areas, TBL combining processing is performed in step S506. In the procedure of this processing, the processing of the first embodiment is performed not for each page but for a TBL for each area, as shown in
In step S1101, the CPU 102 joins the areas for which the color degeneration-corrected TBLs have been combined. If the color degeneration-corrected TBLs are combined in step S506, a combined TBL obtained by the combining processing is a color degeneration-corrected TBL for the plurality of areas. That is, even if the areas applied with the combined TBL are processed as the same area, the correction results are the same.
Then, the CPU 102 applies the combined TBL obtained in step S506 to the area joined in this step. It is determined in step S1102 whether this processing has been performed for all the TBLs or all the areas. If the condition that this processing has been performed for all the TBLs or all the areas is satisfied, the process advances to step S105; otherwise, the process returns to step S1101.
With the above-described processing, while maintaining the effect of color degeneration correction, the number of areas to undergo correction decreases except for a case where values in identical grids of TBLs are different. For example, if the hue angles of the input colors are different between the areas 2401 and 2402 in
Alternatively, it is possible to improve the speed of area analysis in step S801 by decreasing the resolution of image data for which a color degeneration-corrected TBL is created by changing the resolutions of the image data input in step S101, that is, the image data for which a color degeneration-corrected TBL is created and the image data to which the color degeneration-corrected TBL is applied in step S1101.
On the other hand, by decreasing the resolution, a result of performing gamut mapping in step S102 is not held. Therefore, for an area for which it is determined that color degeneration correction is unnecessary, it is necessary to perform gamut mapping (applies a lookup table) again in step S1101. As a result, if the number of areas in the image data for which correction is unnecessary exceeds the upper limit of the number of arithmetic circuits, the speed decreases. To cope with this, in the area joining processing of step S902 of
Numerical values, processing timings, processing orders, main constituents of processing, structures/acquisition methods/transmission destinations/transmission sources/storage locations of data (information) used in the above-described embodiments are merely examples for a detailed explanation. The present invention is not intended to limit these to the examples.
Some or all of the above-described embodiments may be used in combinations as needed. Alternatively, some or all of the above-described embodiments may selectively be used.
Embodiment(s) of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment(s) and/or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2023-075816, filed May 1, 2023, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2023-075816 | May 2023 | JP | national |