Image processing device, image processing method, and program
The image processing device addresses the issue of reduced distinctiveness in color-to-gray value conversion by grouping similar gray values and outputting achromatic image data, ensuring effective differentiation between colors even with many colors in the image.
Patent Information
- Application Number
- JP2021111662
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-07-05
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-07-05
AI Technical Summary
Existing methods for converting color values to gray values often result in reduced distinctiveness, especially when many colors are present in an image, as they fail to effectively differentiate between colors with different RGB values.
An image processing device that generates achromatic image data by converting color values into gray values, using a process that involves generating a list of color values, converting them to gray values, grouping similar gray values, and outputting the image data in achromatic colors.
This approach allows for gray conversion without reducing distinctiveness, even when many colors are present in the image data, by effectively differentiating between colors through the gradation of gray values.
Smart Images

Figure 0007689455000001 
Figure 0007689455000002 
Figure 0007689455000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing device, an image processing method, and a program. [Background technology]
[0002] In recent years, documents and presentations in general offices are often created in full color. However, when printing such documents, they are often printed in monochrome (black only). When printing color documents in monochrome, a process is required to convert the color (color value) into grayscale data (gray value). For example, when the color data of an original is expressed in RGB, there is a gray conversion method in which the RGB value is weighted, for example, by 0.299R+0.587G+0.114B, and the resulting value is used as the gray value corresponding to the RGB value of the color. However, this method has the problem that multiple colors with completely different RGB values become the same or similar gray values after gray conversion, reducing the discrimination ability.
[0003] In addition to the weighting method described above, there are various other methods for converting color values to gray values that change the weighting, such as converting RGB values to gray values with equal weighting. However, all of these methods have the same problem of reducing discrimination.
[0004] Therefore, when the number of colors used in a color image is equal to or less than a certain number, a table for converting color values to gray values is used so that the gray values after converting the color values are assigned to values distant from each other. Patent Document 1 describes a method for improving the distinctiveness by converting color values to gray values using this table, assuming 8-bit image data, for example. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2017-38242 A Summary of the Invention [Problem to be solved by the invention]
[0006] According to the above-mentioned conventional technology, based on the color values of each object before raster development, it is determined whether different colors will become the same or similar gray values when converted to gray values, resulting in a decrease in distinctiveness, and then shading is applied. As a result, when different colors are converted to gray values by NTSC conversion or the like, the problem of the same or similar gray values resulting in a decrease in distinctiveness is eliminated.
[0007] However, when there are many colors on one page, the only way to differentiate them is through the gradation of the gray value. Specifically, if the RGB values are each 8 bits, the gradation is 256x256x256, and even if there are many colors on one page, they can be differentiated. However, if the gray value is 8 bits, there are only 256 gradations, and the discrimination cannot be improved.
[0008] An object of the present invention is to solve at least one of the problems of the above-mentioned conventional techniques.
[0009] An object of the present invention is to provide a technique capable of performing gray conversion without reducing the distinctiveness even when many colors are present in color image data. [Means for solving the problem]
[0010] In order to achieve the above object, an image processing device according to one aspect of the present invention has the following configuration. An image processing device that generates and outputs image data expressed in achromatic colors from input color image data, a generating means for generating a list of color values included in the color image data; a conversion means for converting the color values generated by the generation means into gray values; a grouping means for extracting gray values included in a predetermined range of gray values from the list of gray values converted by the conversion means, and grouping the extracted gray values into one gray value; and an output means for generating and outputting image data expressed in the achromatic color based on the gray values converted by the conversion means and the gray values grouped by the grouping means. Effect of the Invention
[0011] According to the present invention, even when many colors exist in color image data, gray conversion can be performed without reducing the distinctiveness.
[0012] Other features and advantages of the present invention will become apparent from the following description taken in conjunction with the accompanying drawings, in which the same reference numerals are used to designate the same or similar components throughout the drawings. [Brief description of the drawings]
[0013] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. [Figure 1] FIG. 1 is a block diagram illustrating the configuration of an image processing system according to a first embodiment of the present invention. [Diagram 2] FIG. 2 is a functional block diagram showing an example of the functional configuration of the host PC and the image forming apparatus according to the first embodiment. [Diagram 3] 6 is a flowchart for explaining a process for improving distinctiveness executed by the image forming apparatus according to the first embodiment. [Figure 4] 5A to 5C are views for explaining an example in which a command analysis unit and a command execution unit according to the first embodiment analyze commands included in print data, perform rendering, and perform RIP to generate raster image data. [Diagram 5] FIG. 5 is a diagram showing an example of a color value list based on the object of FIG. 4. [Figure 6]5A to 5C are views for explaining an example of adding an index to a color value list and generating a gray value list according to the first embodiment. [Figure 7] 5A to 5C are views showing examples of a gray value list and a color value list generated in the first embodiment. [Figure 8] 4 is a flowchart for explaining the color reduction process in S302 of FIG. 3. [Figure 9] 4 is a flowchart for explaining the color reduction processing in S302 of FIG. 3 according to the first embodiment. [Figure 10] 13A to 13C are views for explaining an example of adding an index to a color value list and generating a gray value list according to the second embodiment. [Figure 11] 11 is a flowchart for explaining color reduction processing according to the third embodiment. [Figure 12] 11 is a flowchart illustrating a distinctiveness improvement process according to the third embodiment. [Figure 13] 10 is a flowchart for explaining color reduction processing according to the fourth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Hereinafter, the embodiments of the present invention will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a plurality of features, not all of these features are essential to the invention, and the plurality of features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated explanations are omitted.
[0015] [Embodiment 1] 1 is a block diagram illustrating the configuration of an image processing system 117 according to the first embodiment of the present invention. The image processing system 117 includes an image forming apparatus 101 and a host PC 119.
[0016] The image forming apparatus 101 is an example of an image processing apparatus according to the present invention, and is, for example, a multi-function peripheral (MFP) in which multiple functions such as a scanning function and a printer function are integrated. A control unit 110 controls the image forming apparatus 101 in an integrated manner, and includes a CPU 105, a ROM 106, a RAM 107, a HDD (hard disk drive) 111, an operation unit I / F (interface) 112, a printer I / F 113, a scanner I / F 114, and a network I / F 115. Meanwhile, a host PC 119 also includes a CPU 120, a ROM 121, a RAM 122, and a HDD 123. The host PC 109 has the same hardware configuration as, for example, a general-purpose PC (personal computer).
[0017] CPU 105 loads a program stored in ROM 106 or HDD 111 into RAM 107 and executes the loaded program to control the operation of image forming apparatus 101. RAM 107 is a temporary storage memory that temporarily stores image data, programs, etc. ROM 106 stores parameters for controlling image forming apparatus 101, applications, programs, and an OS for implementing control related to the embodiment. HDD 111 stores programs, scanned image data, etc. in a non-volatile manner.
[0018] The CPU 105 also controls the operation unit 118 via an operation unit I / F 112, and also controls the image output unit (printer engine) 109 via a printer I / F 113. Furthermore, it controls the image reading unit (scanner) 108 via a scanner I / F 114. The CPU 105 also receives image data and the like from the host PC 119 and transmits image data and the like to the host PC 119 via a network I / F 115 and a LAN 116. The image reading unit 108 includes, for example, a scanner, and the image output unit 109 includes, for example, a printer engine. The CPU 105 executes the program expanded in the above-mentioned RAM 107, thereby realizing a scan function for acquiring image data of a document read by the image reading unit 108, and an output function for printing an image on a recording medium via the image output unit 109 or displaying it on a monitor or the like.
[0019] An operation unit 118 includes a touch panel, hard keys, etc., and receives instructions and various setting operations from a user, and displays device information of the image forming apparatus 101, job progress information, and various user interface screens. The setting information and the like received by the operation unit 118 are stored in the RAM 107.
[0020] Fig. 2 is a functional block diagram showing an example of the functional configuration of the host PC 119 and the image forming apparatus 101 according to the first embodiment. The functional modules of the image forming apparatus 101 shown in Fig. 2 are achieved by the CPU 105 executing a program loaded in the RAM.
[0021] The image forming apparatus 101 includes a command processing unit 211 and an image processing unit 212. The command processing unit 211 determines, analyzes, and executes print data from a printer driver 202 of a host PC 119 (described later), creates raster image data and attribute information, and stores the data in the RAM 107. Each processing unit in the command processing unit 211 will be described later. The image processing unit 212 reads out the raster image data and attribute information stored in the RAM 107, and executes image processing for optimizing the raster image data in accordance with parameters. Each processing unit in the image processing unit 212 will be described later. The image processing unit 212 also executes image processing based on setting information notified from the operation unit 118. The image processing unit 212 also performs processing to convert color raster image data into gray raster image data.
[0022] Hereinafter, the flow of print processing in the image processing system 117 according to the first embodiment will be described with reference to FIG.
[0023] An application 201 and a printer driver 202 are installed in a ROM 121 or HDD 123 of the host PC 119, and the operation of the host PC 119 is controlled by the CPU 120 loading the programs into a RAM 122 and executing them.
[0024] In the host PC 119, electronic data such as a document or a presentation document is created using an application 201. A printer driver 202 is a driver for outputting and printing print data (color image data) to the image forming apparatus 101. The print data created by the printer driver 202 in this manner is sent to the image forming apparatus 101. This print data is then processed by a command processing unit 211 of the image forming apparatus 101. Then, depending on the processing result, image processing is performed by an image processing unit 212, and the image is printed by the image output unit 109.
[0025] Next, the command processing unit 211 will be described.
[0026] When the CPU 105 of the image forming apparatus 101 receives this print data, it functions as a command discrimination unit 203 of a command processing unit 211 to discriminate the type of PDL. This PDL type includes PostScript (PS) and Printer Command Language (PCL). Next, the CPU 105 functions as a command analysis unit 204 to extract and analyze commands of the PDL type identified by the command discrimination unit 203. Furthermore, the CPU 105 functions as a command execution unit 205 to function as a RIP (raster image processor) that performs drawing according to the analysis result of the command analysis unit 204, thereby generating attribute information that describes raster image data and attribute information.
[0027] Finally, the processing of the image processing unit 212 will be described.
[0028] The CPU 105 functions as a color conversion processing unit 206, and performs color conversion processing from the RGB color space to the CMYK color space using the raster image data and attribute information generated by the command execution unit 205. Next, the CPU 105 functions as a filter processing unit 207, and performs edge enhancement such as sharpness processing on the CMYK image data. Note that edge enhancement may be performed on the RGB image data, and in that case, it is necessary to subsequently perform processing by the color conversion processing unit 206 and convert the RGB image data into CMYK image data.
[0029] Then, the CPU 105 functions as a gamma processing unit 208, and performs gamma processing using a one-dimensional LUT (lookup table) in accordance with the characteristics of the image output unit 109. Then, the CPU 105 functions as a dither processing unit 209, and performs dither processing on the gamma-processed image data.
[0030] In this embodiment, the functions of the command discrimination unit 203, command analysis unit 204, command execution unit 205, and image processing unit 212 of the command processing unit 211 are realized by the CPU 105 executing the above-mentioned programs. This concludes the explanation of the command processing 103 and image processing unit 212.
[0031] 4 is a diagram for explaining an example in which the command analysis unit 204 and the command execution unit 205 according to the first embodiment analyze a command included in print data, render the command, and perform RIP to generate raster image data. Below, an example will be given to explain how the command analysis unit 204 analyzes a command, and the command execution unit 205 renders the command in accordance with the analysis result of the command analysis unit 204, and generates raster image data via RIP.
[0032] The commands contained in the print data include drawing commands and control commands. FIG. 4A shows an example of a drawing command.
[0033] The drawing commands include a color mode setting command that sets the color mode of the job, and a color setting command that sets the color. In addition, there are object drawing commands that draw objects, character size setting commands that set the character size, font setting commands that set the character font, and character drawing commands that draw characters. The configuration of this series of commands is the same for other objects and character strings. In addition, commands to set coordinates and line thickness, commands to draw images, etc. are also included.
[0034] Next, the contents of the drawing command 400 in Fig. 4(A) will be briefly explained. Note that the drawing command 400 and color value data below are based on the premise of an 8-bit image. Fig. 4(B) shows an example of an image including an object drawn by this drawing command 400.
[0035] In command 401 of drawing command 400, the color setting command "Set Color(255,128,128)" indicates that the color is to be set to red with RGB values of R=255, G=128, and B=128. And the object drawing command "Draw Box(coordinates (X1,Y1), coordinates (X2,Y2) fill)" indicates that a rectangular object is to be drawn from coordinates (X1,Y1) to coordinates (X2,Y2) and that the rectangle is to be filled with red. The object drawn in this way corresponds to object 411 in FIG. 4(B).
[0036] Similarly, in command 402, the color setting command "Set Color (255, 130, 128)" indicates that a red color slightly different from that of object 411 is to be set. Also, the object drawing command "Draw Box (coordinates (X2, Y1), coordinates (X3, Y2) fill)" indicates that a rectangular object is to be drawn adjacent to object 411 and that the rectangle is to be filled with a slightly different color of red. The object drawn in this way corresponds to object 412 in FIG. 4(B).
[0037] Furthermore, a blue object 413 is drawn next to the object 412 by the command 403, which is a color setting command "Set Color (153, 153, 255)" and an object drawing command "Draw Box (fill with coordinates (X3, Y1), coordinates (X4, Y2))".
[0038] The image objects described above are generated by the command execution unit 205 through drawing and RIP in response to the analysis of the drawing command 400 by the command analysis unit 204 .
[0039] This concludes the explanation of the command analysis unit 204 and the command execution unit 205.
[0040] The command analysis unit 204 and the command execution unit 205 are generally described assuming that color is set by the user. However, in the process for improving distinctiveness according to the embodiment, even if monochrome is specified, the same process as for color is performed, and then gray conversion is performed after the command execution unit 205 and the output is in monochrome.
[0041] Next, the process of improving the distinctiveness by the command analysis unit 204 and the command execution unit 205 will be described with reference to the flowchart of FIG.
[0042] 3 is a flowchart for explaining a process for improving distinctiveness executed by the image forming apparatus 101 according to the embodiment 1. Note that the process shown in this flowchart is achieved by the CPU 105 executing a program loaded in the RAM 107 described above.
[0043] First, in S301, CPU 105 functions as command analyzer 204 and extracts color values specified in a color setting command for each object included in the print data. The extracted color values are then added to color value list 501 shown in Fig. 5A. Here, color value list 501 holds the RGB values extracted from each object. Then, when color value list 501 for all objects in the print data is complete, CPU 105 saves color value list 501 in RAM 107 and proceeds to S302.
[0044] FIG. 5 is a diagram showing an example of a color value list created based on the object in FIG. 4 in the first embodiment.
[0045] Fig. 5(A) shows the color value list created in S301 of Fig. 3. Here, the color value list corresponding to the objects 411-413 drawn in Fig. 4 is shown. Fig. 5(B) shows the state in which the gray values of each object are obtained by a conversion process from color values to gray values, which will be described later, and the gray values are added to the color value list. Fig. 5(C) shows the state in which the objects are rearranged in ascending order of gray value, starting from the smallest. The process related to this will be described later.
[0046] In S302, CPU 105 generates image data expressed in achromatic colors from the input color print data. First, for color value list 501 created in S301, a process is performed to group colors with similar color values together so as to improve discrimination when converted to gray values. In this way, gray value list 601 shown in Fig. 6 is generated. Details of this process will be described later.
[0047] FIG. 6 is a diagram for explaining an example of adding an index to a color value list and generating a gray value list according to the first embodiment.
[0048] Next, the process proceeds to S303, and the CPU 105 corrects the gray values in the gray value list 601 generated in S302 to gray values that are discriminable. For example, as shown in the gray value list 601 in Fig. 6A, the gray value of object 411 is "166". On the other hand, the gray value of object 413 is "165". For this reason, it is determined that the difference in gray values is small and therefore the gray-converted objects 411 and 413 are not discriminable.
[0049] FIG. 7A is a diagram showing an example of a gray value list generated according to the first embodiment, and FIG. 7B is a diagram showing an example of a color value list generated according to the first embodiment.
[0050] In this case, in order to improve the distinctiveness, for example, as shown in the gray value list 701 in FIG. 7A, the gray value of the object 413 is corrected to 120 and the gray value of the object 411 is corrected to 190. In terms of the relationship between the difference in gray values and distinctiveness, the greater the difference in gray values, the higher the distinctiveness. On the other hand, as the minimum necessary difference in gray values, although it depends on the performance of the image forming apparatus 101, it is considered that a difference of 15 to 20 in gray values is sufficient for distinction. After that, according to the index of the color value list 702 in FIG. 7B (to be described later), the gray values in the gray value list 601 shown in FIG. 6 are rewritten to gray values as shown in the color value list 702 in FIG. 7B. This is the distinctiveness improvement process.
[0051] Then, the process proceeds to S304, where the CPU 105 functions as the command execution unit 205 and converts the PDL language into raster image data. At this time, the RGB values are converted into gray values with reference to the color value list 702 in FIG.
[0052] As described above, before the print data is rasterized, a color value list for converting RGB values to gray values is created. If it is determined that the distinctiveness of the gray values will decrease, the color value list for converting RGB values to gray values is modified so that the distinctiveness is improved. Then, during rasterization, the color value list is referenced while converting to gray values, thereby improving the distinctiveness of the gray image.
[0053] Next, the color reduction process (processing for converting color values to gray values) in S302 in FIG. 3 will be described with reference to the flowchart in FIG.
[0054] FIG. 8 is a flowchart illustrating the color reduction process in S302 of FIG.
[0055] First, in S801, the CPU 105 performs a conversion process to convert each RGB value listed in the color value list 501 in Fig. 5 into a gray value. Here, the gray value is obtained by performing a weighting operation on the RGB values, for example, 0.299R+0.587G+0.114B. The gray value thus obtained is stored in the gray value item of the color value list 501.
[0056] For example, when the color value list 501 shown in Fig. 5(A) is input, the gray values corresponding to each object are written into the color value list 501 as shown in Fig. 5(B). As a result, R=255, G=128, and B=128 for the object 411 are input, and the corresponding gray value is calculated as "166" by the weighting calculation described above. Note that the above method of converting to gray values is merely an example, and the present invention is not limited to this. For example, the weighting ratio may be changed, or conversion may be performed using a lookup table that stores gray values corresponding to RGB values.
[0057] Next, the process proceeds to S802, where the CPU 105 sorts in ascending order the gray values in the color value list 501. Fig. 5(C) shows the result of sorting the gray values in the color value list 501 shown in Fig. 5(B) in ascending order. This shows that the RGB value and gray value of the object 413 with the smallest gray value have moved to the top. Note that sorting is not limited to ascending order, and may be, for example, descending order.
[0058] Next, the process proceeds to S803, and the CPU 105 adds the RGB values and gray values at the top of the color value list 501 sorted in S802 to the gray value list 601 shown in FIG. 6A. Then, in order to store where in the gray value list 601 the values of the color value list 501 have been written, a color value list 611 is generated to which an index 610 has been added. Now, when the color value list 501 of FIG. 5C is input, the RGB values and gray values of the object 413 are at the top of the color value list 501, so the RGB values and gray values of the object 413 are added to the gray value list 601 shown in FIG. 6A. Also, the index number at which the RGB values and gray values of the object 413 were written to the gray value list 601 is written to the index 610 of the color value list 611. Here, the index number of the gray value list 601 starts from 0, and "0" indicating the top of the gray value list 601 is written to the index 610.
[0059] Next, the process proceeds to S804, where the CPU 105 determines the next object to be compared in the color value list 501 sorted in S802, here the object 411. Then, the difference between the gray value of the color of the object 411 (hereinafter, the comparison color) and the gray value of the object in the gray value list 601 is calculated. At first, only the gray value of the object 413 is registered in the gray value list 601, so the difference between the gray value of the object 411 and the gray value of the object 413 is calculated. After that, the differences between the comparison object and the multiple objects in the gray value list 601 are calculated. Then, it is determined whether there is any object whose difference is less than a first threshold value. Here, the first threshold value is a value that is read out from the HDD 111 in advance. Then, if there is any object whose gray value difference is less than the first threshold value, the process proceeds to S805, and if not, the process proceeds to S806, where the comparison color is added to the gray value list 601, and the process proceeds to S808.
[0060] In S805, the CPU 105 calculates the difference in RGB values for the combination in which the difference between the comparison color and the gray value in the gray value list 601 is determined to be less than the first threshold in S804, and determines whether the difference in RGB values is less than a second threshold. Here, the second threshold is a value that is read out from the HDD 111 in advance. Then, if there is any comparison color whose difference between the RGB value and the RGB value of an object in the gray value list 601 is less than the second threshold, the process proceeds to S807, and if not, the process proceeds to S806, where the comparison color is added to the gray value list 601, and the process proceeds to S808.
[0061] In S806, the CPU 105 determines that the comparison color is not a target for color reduction, and adds the RGB values and gray values of the comparison color to the gray value list 601. Also, the CPU 105 writes the index number at which the object in the color value list 611 was written into the gray value list 601 to the index 610. In FIG. 6B, when the comparison color is the object 411, it is determined that the comparison color is not a target for color reduction, and the RGB values and gray values of the object 411 are added to the gray value list 601, and the index number at which the object 411 was written into the gray value list 601 is added to the index 610.
[0062] On the other hand, if the difference in gray values is less than the first threshold and the difference in RGB values is less than the second threshold, the process proceeds to S807, where CPU 105 determines that the combination in S805 in which the difference in RGB values is less than the second threshold is to be subjected to color reduction. Then, CPU 105 writes the index number determined to be the target of color reduction in the index number corresponding to the comparison color determined to be the target of color reduction, and proceeds to S808. In S808, CPU 105 determines whether the colors of all objects in color value list 611 have been acquired and processed as comparison colors. If all colors have not been processed as comparison colors, the process returns to S804, where the color of the next object in color value list 611 is extracted and the above-mentioned process is executed. When the colors of all objects have been processed as comparison colors in S808 in this way, this process ends.
[0063] A specific example of the process shown in the above flowchart will be described starting from the state shown in FIG. 6(A) where the first threshold value is "10" and the second threshold value is "5".
[0064] First, when the gray value of object 411 becomes the comparison color, in S804 CPU 105 obtains the difference between the gray value of object 411 (=166) and the gray value of object 413 (=165) included in gray value list 601. At this time, the difference in gray values is "1", so it is determined in S804 that it is less than the first threshold. Therefore, the process proceeds to S805, where CPU 105 determines whether the difference between the RGB values of object 411 and object 413 is less than the second threshold. Here, assuming that the RGB values of object 411 are R1, G1, B1, the RGB values of object 413 are R2, G2, B2, and the difference between the RGB values is ΔRGB, it can be expressed by the following formula (1).
[0065] ΔRGB=√{(R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2} …Equation (1) From this formula (1), the difference ΔRGB in RGB values between R=255, G=128, B=128 of object 411 and R=153, G=153, B=255 of object 413 is "254", which is determined to be not less than the second threshold. Therefore, the process proceeds to S806, where the RGB values and gray value of object 411 are added to gray value list 601, and "1" is written to index 610 in color value list 611 corresponding to object 411, as shown in FIG. 6B.
[0066] Similarly, a case where object 412 becomes the comparison color from the state of Fig. 6(B) will be described. First, in S804, the CPU determines whether the difference in gray value between object 412 and objects 413 and 411 in gray value list 601 is less than a first threshold. First, the difference between the gray value of object 412 (=167) and the gray value of object 413 (=165) is "2", and the difference between the gray value of object 412 (=167) and the gray value of object 411 (=166) is "1". Therefore, in S804, the CPU 105 determines that the difference in gray value between object 413 and object 411 is less than the first threshold, and the process proceeds to S805.
[0067] In S805, the CPU 105 judges whether the difference between the RGB values of the object 402 and the RGB values of the objects 413 and 411 included in the gray value list 601, that is, the difference between the color values, is less than the second threshold value. Here, from the formula (1), the difference between the RGB values of R=255, G=130, B=128 of the object 412 and R=255, G=128, B=128 of the object 411 is "2". Therefore, it is judged to be less than the second threshold value, and the process proceeds to S807, where the object 412 is regarded as having the same color as the object 411, and a color reduction process is performed to convert them to a common gray value. At this time, as shown in FIG. 6C, the index number "1" of the object 411 is written to the index 610 of the color value list 611. As a result, the number of entries in the gray value list 601 becomes smaller than that of the color value list 611, and the number of gray values registered in the gray value list 601 can be reduced, and the distinctiveness improvement process becomes effective.
[0068] In the first embodiment, the determination as to whether or not to perform color reduction is performed based on the difference between RGB values, but this is merely an example and the present invention is not limited to this. For example, the conversion may be performed to another color space such as the Lab color space. The Lab color space refers to a three-dimensional visually uniform color space defined by the CIE (International Commission on Illumination) that is independent of the image output unit 109 and takes into account the visual characteristics of humans.
[0069] As described above, according to the first embodiment, when the color values of color image data are converted to gray values, gray values within a range in which the difference between the gray values is smaller than a predetermined value (is indistinguishable) are grouped and represented by a single gray value, thereby making it possible to reduce the number of gray values registered in the gray value list.
[0070] [Embodiment 2] In the above-mentioned first embodiment, in the color reduction process, the color value list is grayed and sorted based on the gray value, and only those with similar differences in gray value are subject to the color reduction process. However, since the decision on whether to combine colors is based on the gray conversion method and the first threshold value, it may not be suitable for combining more similar colors. Therefore, in the second embodiment, a process in which only the differences in RGB values are compared and more colors are combined will be described. Note that the hardware configurations of the image processing system and image forming apparatus according to the second embodiment are the same as those of the above-mentioned first embodiment, and therefore their description will be omitted.
[0071] The color reduction process in S302 according to the second embodiment will be described with reference to the flowchart in Fig. 9 and Fig. 10. Fig. 10 is a diagram for explaining an example of adding an index to a color value list and generating a gray value list according to the second embodiment.
[0072] Fig. 9 is a flowchart for explaining the color reduction process of S302 in Fig. 3 according to the first embodiment. Here, differences from the first embodiment will be explained. Note that S902 to S905 in Fig. 9 are similar to S805 to S808 in Fig. 8, respectively, and therefore explanations thereof will be omitted.
[0073] First, in S901, the CPU 105 adds the top of the color value list 1000 in Fig. 10(A) to the gray value list 1020. In S803 in the above-described first embodiment, the RGB values and gray values were stored in the gray value list, but in the second embodiment, as shown in Fig. 10(A), only the RGB values are added to the gray value list 1020. As a result, the RGB values of the object 411 are added to the gray value list 1020, as shown in Fig. 10(A).
[0074] Next, the process proceeds to S902, where the CPU 105 determines whether the difference between the RGB values of the next object 412, which is the comparison color, and the RGB values of the object 411 in the gray value list 1020 is less than a second threshold value. Note that the second threshold value is read out from a value previously stored in the HDD 111. If there is no object in the gray value list 1020 whose RGB value difference from the comparison color is less than the second threshold value, the process proceeds to S903, where only the RGB value is added to the gray value list 1020, an index number is added to the color value list 1000, and the process proceeds to S905. On the other hand, if the difference between the RGB values of the comparison color and the RGB value of the object in the gray value list 1020 is less than the second threshold value, the process proceeds to S904, where the index number of the object of the comparison color is set to the same number.
[0075] 10B, since the difference between the RGB values of the next object 412, which is the comparison color, and the RGB values of the object 411 in the gray value list 1020 is less than the second threshold, the RGB values of the object 412 are not added to the gray value list 1020. Furthermore, the index number corresponding to the object 412 in the color value list 1000 is set to "0".
[0076] 10C, the difference is calculated between the RGB values of the next object 413, which is the comparison color, and the RGB values of objects 411 and 412 in the gray value list 1020. At this time, since the difference between the RGB values of object 412 and object 413 is equal to or greater than the second threshold, the RGB values of object 413 are added to the gray value list 1020, and the index number corresponding to object 413 in the color value list 1000 is set to "1".
[0077] Finally, in S906, the CPU 105 performs a conversion process to convert the RGB values to gray values for each object in the gray value list 1020. Finally, as shown in Fig. 10C, the RGB values of each object in the gray value list 1020 are converted to gray values and written.
[0078] As described above, according to the second embodiment, by comparing only the differences in RGB values and expressing gray values in a range in which the difference between RGB values is smaller than a predetermined value (is indistinguishable) as a single gray value, it is possible to group together gray values with close RGB values regardless of the gray conversion method or the first threshold value, and it is possible to reduce the number of gray values registered in the gray value list.
[0079] [Embodiment 3] In the above-mentioned embodiment 1, the color reduction process is performed on all color value lists. However, there are cases where it is better to switch to an appropriate process depending on the number of colors. For example, when the number of colors in the color value list is small, the gray value difference can be sufficiently secured from the beginning, so there is no need to perform the above-mentioned color reduction process by grouping. On the other hand, when the number of colors in the gray value list is large after the color reduction process, the gray value difference cannot be sufficiently secured, so the distinctiveness improvement process does not work effectively. Therefore, it is possible to choose not to perform distinctiveness processing. Therefore, in embodiment 3, a process of switching to an appropriate flow depending on the number of colors in the color value list and the number of colors in the gray value list after processing will be described. Note that the hardware configuration of the image processing system and image forming apparatus according to embodiment 3 is the same as that of embodiment 1 described above, so the description thereof will be omitted.
[0080] FIG. 11 is a flowchart illustrating the color reduction processing according to the third embodiment.
[0081] Fig. 12 is a flowchart for explaining the distinctiveness improvement process according to the third embodiment. Differences from the first embodiment will be described below. Note that steps S1102 to S1109 in Fig. 11 are similar to steps S801 to S808 in Fig. 8. In Fig. 12, steps common to Fig. 3 described above are denoted by the same reference numerals. Therefore, a description of the similar parts will be omitted.
[0082] First, in S1101, CPU 105 determines whether the number of objects in color value list 501 in Fig. 5 is less than a third threshold (less than a predetermined value). Here, the third threshold is desirably a value that allows the difference in gray values to be, for example, about 20 when discriminating between gray values. Here, if the number of objects in the color value list is less than the third threshold, it is determined that color reduction processing is not necessary, and the color reduction processing is terminated. It is assumed that the third threshold is stored in HDD 111 in advance.
[0083] If the number of objects in the color value list 501 in FIG. 5 is equal to or greater than the third threshold, the process proceeds to S1102, where index numbers are assigned to the gray value list and the color value list as described above with reference to FIG. 8. When the process for all objects in the color value list 501 is thus completed, the process proceeds to S1110. In S1110, the CPU 105 determines whether the number of colors in the gray value list 501 is equal to or greater than the fourth threshold (a predetermined value or greater). If it is determined that the number of colors is equal to or greater than the fourth threshold, the process proceeds to S1111, but if the number of colors is less than the fourth threshold, the process skips S1111 and ends this process. It is assumed that this fourth threshold is stored in the HDD 111 in advance. In S1111, the CPU 105 turns on a process skip flag to determine that the distinctiveness improvement process is not to be performed. This process flag is written to the RAM 107.
[0084] 12, the CPU 105 determines whether the processing skip flag written in the RAM 107 is on. If it is on, the processing proceeds to S304 by skipping the processing in S303 as not performing the distinctiveness improvement processing. In this case, the RIP processing is performed by referring to the color value list 501.
[0085] As described above, according to the third embodiment, it is possible to switch to an appropriate flow depending on the number of colors in the color value list.
[0086] [Embodiment 4] In the above-mentioned first embodiment, the color reduction process is performed with the same threshold value. However, when the number of colors is large, it may be better to group as many colors as possible to increase the difference in gray values and perform a process to improve the distinctiveness. In the fourth embodiment, a process in which the first and second threshold values used in the color reduction process are made variable depending on the number of colors will be described. Note that the hardware configurations of the image processing system and image forming apparatus according to the fourth embodiment are the same as those of the first embodiment, and therefore the description thereof will be omitted.
[0087] Fig. 13 is a flowchart for explaining the color reduction processing according to the fourth embodiment. Here, the differences from the first embodiment will be mainly described. Note that S1303 to S1310 in Fig. 13 are similar to S801 to S808 in Fig. 8, respectively, and therefore the explanation will be omitted.
[0088] First, in S1301, CPU 105 determines whether the number of objects in color value list 501 is less than a fifth threshold. If it is determined that the number of objects in color value list 501 is equal to or greater than the fifth threshold, the process proceeds to S1302, and if it is determined that the number is less than the fifth threshold, the process proceeds to S1303. In S1302, CPU 105 changes the first threshold and the second threshold to the sixth threshold and the seventh threshold stored in advance in HDD 111. Here, it is desirable that the sixth and seventh thresholds are set to values larger than the first and second thresholds stored in advance in HDD 111 in the first embodiment in order to group together more colors. However, the sixth and seventh thresholds may be set to values smaller than the first and second thresholds set in advance in the first embodiment.
[0089] As described above, according to the fourth embodiment, when the number of colors in the color value list is large, it is possible to perform processing to improve distinctiveness by grouping as many colors as possible together to increase the difference in gray values.
[0090] (Other embodiments) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
[0091] The present invention is not limited to the above-described embodiments, and various modifications and variations can be made without departing from the spirit and scope of the present invention. Therefore, the following claims are appended to apprise the public of the scope of the present invention. [Explanation of symbols]
[0092] 101... image forming apparatus, 105... CPU, 106... ROM, 107... RAM, 109... image reading section, 109... image output section, 111... HDD, 118... operation section, 119... host PC, 211... command processing section, 212... image processing section
Claims
1. An image processing device that generates and outputs image data expressed in achromatic colors from input color image data, a generating means for generating a list of color values included in the color image data; a conversion means for converting the color values generated by the generation means into gray values; a grouping means for extracting gray values included in a predetermined range of gray values from the list of gray values converted by the conversion means, and grouping the extracted gray values into one gray value; an output means for generating and outputting image data expressed in the achromatic color based on the gray values converted by the conversion means and the gray values grouped by the grouping means; 13. An image processing device comprising:
2. 2. The image processing device according to claim 1, wherein the gray values included in the specified range of gray values are gray values in which a difference between the gray values included in the list of gray values is less than a first threshold value, and a difference between the color values before the gray values are converted by the conversion means is less than a second threshold value.
3. 2. The image processing device according to claim 1, wherein the gray values included in the predetermined range of gray values are gray values in which the difference between the color values before the gray values are converted by the conversion means is less than a second threshold value.
4. 4. The image processing device according to claim 1, wherein the grouping means sorts the gray values included in the list of gray values converted by the conversion means in ascending or descending order and extracts gray values included in the predetermined range of gray values.
5. 5. The image processing device according to claim 1, further comprising a distinctiveness improvement processing means for rewriting the list of gray values grouped by the grouping means into a list of gray values having enhanced distinctiveness by further increasing the difference between the gray values.
6. a determining means for determining whether a number of color values included in the list of color values is less than a predetermined value; 6. An image processing device according to claim 1, wherein when the determination means determines that the number of color values included in the list of color values is less than a predetermined value, grouping is not performed by the grouping means, and the output means generates and outputs image data expressed in achromatic colors based on the gray values converted by the conversion means.
7. a determining unit for determining whether or not the number of gray values included in the list of gray values changed by the grouping by the grouping unit is equal to or greater than a predetermined value; 6. The image processing apparatus according to claim 5, wherein when the determining means determines that the number of gray values included in the list of changed gray values is equal to or greater than a predetermined value, the distinctiveness improving processing means does not execute processing.
8. a determining means for determining whether a number of color values included in the list of color values is less than a predetermined value; 3. The image processing device according to claim 2, further comprising a change means for changing the first threshold value and the second threshold value when the determination means determines that the number of color values included in the list of color values is equal to or greater than a predetermined value.
9. 9. The image processing apparatus according to claim 8, wherein the change means changes the first threshold value and the second threshold value to larger values.
10. 10. The image processing apparatus according to claim 1, wherein the grouping means assigns a common index to the gray values grouped together into one gray value.
11. When the color values are expressed as RGB values, the difference between the color values is ΔRGB=√{(R1-R2) 2 + (G1-G2) 2 + (B1-B2) 2 4. The image processing apparatus according to claim 2, wherein the image is obtained by the formula:
12. 6. The image processing apparatus according to claim 5, wherein said distinctiveness improving processing means makes said difference in gray value at least 15-20.
13. 1. An image processing method for generating and outputting image data expressed in achromatic colors from input color image data, comprising: generating a list of color values contained in the color image data; a conversion step of converting the color values generated by the generation step into gray values; a grouping step of extracting gray values included in a predetermined range of gray values from the list of gray values converted by the converting step, and grouping the extracted gray values into one gray value; an output step of generating and outputting image data expressed in the achromatic color based on the gray values converted in the conversion step and the gray values grouped in the grouping step; 13. An image processing method comprising:
14. The image processing method according to claim 13, characterized in that the gray values included in the specified range of gray values are gray values in which a difference between the gray values included in the list of gray values is less than a first threshold value, and a difference between the color values before the gray values are converted by the conversion step is less than a second threshold value.
15. The image processing method according to claim 13, characterized in that the gray values included in the specified range of gray values are gray values in which the difference between the color values before the gray values are converted by the conversion step is less than a second threshold value.
16. 16. The image processing method according to claim 13, further comprising a distinctiveness improvement processing step of rewriting the list of gray values grouped by the grouping step into a list of gray values having enhanced distinctiveness by further increasing the differences between the gray values.
17. A program for causing a computer to function as all of the respective means of the image processing apparatus according to any one of claims 1 to 12.
Citation Information
Patent Citations
Color image data conversion method
JP1996018802A
Conversion of color image to gray value image
JP2003179762A
Printer
JP2017038242A
Image processing apparatus, image processing method, and program
JP2020174226A