This invention relates to an image processing device such as a printer or photocopier, and to a program which performs image processing. More specifically, this invention relates to an image processing device and program for image processing which perform simple expansion into band memory.
When causing a printer to print an image created by a host computer, conventionally the host computer internally comprises a printer driver to control the printer, converting the image data into print data which can be processed within the printer and outputting this print data to the printer. That is, within the printer driver, print data comprising RGB (red, green, blue) grayscale data generated by application software is first converted into an internal code and expanded into band memory, and thereafter color conversion of the RGB grayscale data into CMYK (cyan, magenta, yellow, black) grayscale data is performed, and the result output to the printer.
On the other hand, when performing color conversion within the driver, by referencing different correction tables for color conversion according to the type of drawing (character, graphics, image) in the image to be printed, color vividness may be emphasized, or colors close to natural hues may be emphasized, so as to maintain high quality of the printed image. Consequently when the driver expands the RGB grayscale data into band memory, for example attribute information comprising information on the type of drawing is generated for each pixel and is expanded into band memory together with the RGB grayscale data, and based on this attribute information the table to be referenced for color conversion is selected (see for example Japanese Patent Publication No. 3225506 and Japanese Patent Laid-open No. 2000-165690).
However, upon expansion into band memory, when the RGB grayscale data is checked and judged to comprise a color image within the image of one page, one page's worth of RGB data is all expanded into band memory, and moreover color conversion processing must be performed, and the entirety of the processing cannot be speeded. For example, when the image of one page comprises a plurality of print objects, even when there exist objects comprising black graphics, the value representing black (“00000000”) must be expanded into the R, G and B band memories for each pixel, and color conversion processing must be performed for this value.
The present invention has as an object the provision of an image processing device and program which maintain high quality of the printed image, while speeding the entirety of the processing when the image to be printed comprises a color image.
In order to attain the above object, this invention concerns an image processing device which performs image processing of image data comprising color data, characterized in having expansion means which expands each of the RGB (red, green, blue) data items constituting image data into band memory as single-color image data in white or black, when the type of the image of image data is other than a bitmap image and the image color is white or black, and color conversion means which reads image data expanded as a single color from band memory, computes interpolated values for the image data, and performs conversion into CMYK (cyan, magenta, yellow, black) of the image data. By this means, an image processing device can be provided in which, for example, image data is not expanded into band memory in each of the three RGB colors, but is expanded as single-color image data, and color conversion into CMYK image data entails only computation of interpolated values, so that faster processing is possible. Further, when the image type is a bitmap, and when the color of a non-bitmap image is other than white or black, color conversion of image data in each of the three RGB colors into CMYK is performed, so that an image processing device which forms high-quality images can be provided.
Also, in order to attain the above object, this invention concerns an image processing device which performs image processing of image data comprising color data, characterized in having intermediate code generation means which generates an intermediate code for expansion of image data into band memory having a prescribed width; expansion means, which judges the type of an image of image data from the intermediate code generated by the intermediate code generation means, and when the type of an image is other than a bitmap, the image comprises a single color or two colors, and the image color is white or black, expands the image data into band memory as single-color white or black image data; and, color conversion means which reads the image data expanded by the expansion means from band memory and performs color conversion. By this means, single-color image data is simply expanded into band memory, so that an image processing device capable of faster processing can be provided. Further, when an image type is a bitmap, or if not a bitmap is other than a solid or binary pattern, or even if a bitmap and a solid or binary pattern does not comprise white or black, color conversion is performed for the three-color image data, so that an image processing device can be provided which forms high-quality images.
Also, in order to attain the above object, this invention concerns a program to perform image processing of image data comprising color data, characterized in causing a computer to execute expansion processing to expand into band memory each of the RGB (red, green, blue) data items constituting image data when the type of the image of image data is other than a bitmap image and the image color is white or black, and color conversion processing to read from band memory the image data expanded as a single color, compute interpolated values for the image data, and perform conversion into CMYK (cyan, magenta, yellow, black) of the image data. By this means, an image processing program can be provided in which, for example, image data is not expanded into band memory in each of the three RGB colors, but is expanded as single-color image data, and color conversion into CMYK image data entails only computation of interpolated values, so that faster processing is possible. Further, when the image type is a bitmap, and when the color of a non-bitmap image is other than white or black, color conversion of image data in each of the three RGB colors into CMYK is performed, so that an image processing program which forms high-quality images can be provided.
Also, in order to attain the above object, this invention concerns a program to perform image processing of image data comprising color data, characterized in causing a computer to execute intermediate code expansion processing to generate an intermediate code for expansion of image data into band memory having a prescribed width; expansion processing to judge the type of an image of image data from the intermediate code generated by the intermediate code generation means, and when the type of an image is other than a bitmap, the image comprises a single color or two colors, and the image color is white or black, to expand the image data into band memory as single-color white or black image data; and, color conversion processing to read the image data expanded by the expansion processing from band memory and perform color conversion. By this means, single-color image data is simply expanded into band memory, so that an image processing program capable of faster processing can be provided. Further, when an image type is a bitmap, or if not a bitmap is other than a solid or binary pattern, or even if a bitmap and a solid or binary pattern does not comprise white or black, color conversion is performed for the three-color image data, so that an image processing program can be provided which forms high-quality images.
Below, the best modes for carrying out the invention are explained, referring to the drawings.
The host computer comprises a CPU 10, display portion 11, HDD (Hard Disk Drive) 12, ROM 13, RAM 14, and interface (I/F) 15, interconnected by a bus. The CPU 10 executes image processing and various other processing within the computer; details are explained below. The display portion 11 displays images for printing and other information, under control of the CPU 10. The HDD 12 stores images for printing and other information; images for printing are stored and read as appropriate under control of the CPU 10. The ROM 13 stores a program to which this invention is applied and programs to perform various processing; programs are read from and executed by the CPU 10 as appropriate. The RAM 14 plays the role of working memory for the CPU 10, and stores execution results of the CPU 10 and similar as appropriate. The I/F 15 converts images for printing into a prescribed transmission format and outputs data to an external device under control of the CPU 10.
In a host computer 1 configured in this way, an image stored on the HDD 12 is caused to be displayed on the display portion 11 under control of the CPU 10, and through operation of the host computer 1 by a user, the CPU 10 reads a program for image processing from the ROM 13. The processing of the program is executed by the CPU 10, and data resulting from image processing is stored in the RAM 14 as appropriate, after which the image for printing is output from the I/F 15.
Next, the printing device 2 is explained. The printing device 2 comprises a CPU 20, interface (I/F) 21, ROM 22, RAM 23, print engine 24, and control panel 25, all interconnected by a bus. The CPU 20 reads a program stored in ROM 22 and executes various processing; details are described below. The I/F 21 receives input of image data for printing which has been output from the host computer 1 in a prescribed transmission format, and converts this data into data which can be processed within the printing device 2. The ROM 22 stores a program for execution by the CPU 20. The RAM plays the role of working memory for the CPU 20, and stores execution results of the CPU 20 and similar as appropriate. The print engine 24 comprises a laser diode and photosensitive drum or similar, and performs actual printing of the image onto print media. The control panel 25 enables specification of the type of print media, number of pages and similar. The control panel 25 may for example comprise a liquid crystal display panel.
In a printing device 2 configured in this way, image data is input from the host computer 1 into the I/F 21 and stored temporarily in RAM 23. The CPU 20 reads a program for printing from ROM 22 as appropriate and executes processing, generating driving data for printing. The driving data is output to the print engine 24 under control of the CPU 20, and the image generated by the host computer 1 is actually printed.
The application portion 101 generates character data, drawing data, bitmap data, and other data for printing. The CPU 10 reads and executes a word processor, drawing tool, or other application program stored in ROM 13 to generate character, graphics, drawing, and other printing data. This printing data is represented in a prescribed description language. For example, printing data is represented in PDL (Page Description Language), or in a command format using GDI (Graphic Device Interface); details are explained below. The printing data represented by such a language is output to the driver 110 under control of the CPU 10.
As shown in
The intermediate code generation portion 103 generates intermediate code and outputs the code to the image expansion portion 104, based on information output from the command analysis portion 102. This intermediate code is mainly information indicating the type of image stored in band memory 105, described below. The image expansion portion 104 takes as input the intermediate code from the intermediate code generation portion 103, and based on this code stores and expands in the band memory 105 the actual RGB grayscale data. The image expansion portion 104 generates attribute information X from the intermediate code, comprising information indicating the type of image, for use in selecting a color correction table and halftone table appropriate to the type of image in the subsequent color conversion processing and halftone processing. The type of image may be character, graphics, or bitmap. This attribute information X is also expanded in the band memory 105. Generation of attribute information X is described in detail below.
In the image expansion portion 104, a decision is made as to whether to perform expansion in band memory from intermediate code (and from RGB grayscale data constituting intermediate code) as RGBX data, or as gray data. RGBX data is RGB grayscale data with attribute information X appended; gray data is white-color data (in the RGB color space, each of the RGB colors is represented by “11111111” (binary)) or black-color data (similarly, each of the RGB colors is represented by “00000000” (binary)), represented by one byte. That is, conventionally the white and black RGB grayscale values are expressed by three bytes, in which each of the RGB colors is represented by the eight bits “11111111” or “00000000”; but gray data is expressed by a single byte, which is “11111111” or “00000000” for white and for black respectively, rather than by three bytes for the RGB colors. Hence when data is expanded in band memory 105 as RGBX data, each color is represented by one byte to total three bytes, plus one byte for attribute information X, resulting in a size of four bytes; but in the case of gray data, the size is one byte (attribute information X is not appended), so that the processing time for expansion into band memory can be shortened to the extent that the amount of data to be stored is reduced. Further, attribute information X is not appended upon expansion as gray data because there is no need to reference a correction table when performing color conversion from gray data into CMYK, and in subsequent halftone processing also, the output values for gray data do not change regardless of whether a resolution-priority or grayscale-priority halftone table is used.
In the image expansion portion 104, a type key is generated indicating whether to use a color correction table to perform color conversion processing, depending on whether RGB grayscale data has been expanded as RGBX data or as gray data. That is, in the color processing portion 106 described below, this type key is used to decide whether to use a color correction table to perform color conversion, or to perform color conversion without using the table. The generated type key is stored in RAM 14 under control of the CPU 10.
The band memory 105 RGBX data or gray data is input from the image expansion portion 104, and is stored under the control of the CPU 10.
Each of the values of the RGBX data is represented by eight bits, as described above (having values from 0 to 255 for each RGB color), and these values for each color are stored for each pixel. In the case of gray data, as shown in
Returning to
The color conversion portion 121 comprises a black-and-white conversion portion 1211 and color conversion portion 1212, second switching portion 1213, and three color correction tables 1214A, 1214B, 1214C. The black-and-white conversion portion 1211 converts gray data, input from the first switching portion 120, into CMYK color space data. That is, the complement of white-color data with the value “ff” (hexadecimal) in the RGB color space is taken to convert to the value “00” (hexadecimal) in CMYK color space, and the complement of data for black with the value “00” (hexadecimal) in RGB color space is taken to convert to the value “ff” (hexadecimal) in CMYK color space. CMYK data converted in this way is output to the compression portion 107.
On the other hand, RGB data output from the first switching portion 120 is input to the color conversion processing portion 1212, the second switching portion 1213 selects one among the three color correction tables 1214A, 1214B, 1214C according to the attribute information X, and color conversion into CMYK data is performed based on the selected table. Because the attribute information X comprises information relating to the type of image of the object (character, graphics, bitmap), the color correction table is selected by the second switching portion 1213 based on this information.
In this embodiment, color conversion processing is performed by conversion processing using tetrahedral interpolation. That is, the CMYK grayscale data items corresponding to each of the RGB grayscale data items input to the color conversion processing portion 1212 are determined from the selected color correction table 1214A through 1214C. However, a table which provides each of the CMYK grayscale values corresponding to all RGB grayscale values would contain a huge amount of data. For example, when each of the RGB grayscale values has 256 values ranging from “0” (decimal) to “255” (decimal), the CMYK grayscale values corresponding to all these combinations will be a number of data items equal to 256 raised to the third power. Hence tables 1214A through 1214C are prepared with each of the RGB grayscale values sampled at prescribed intervals to provide each of the CMYK grayscale values at lattice points. By this means, the amount of memory required to store the tables 1214A through 1214C can be reduced.
In this embodiment, there are in total three types of error correction tables, 1214A through 1214C. Error correction table 1214A has numerous matched colors, and is a table suitable for expression of natural colors, selected when the image type as determined from the attribute information X is bitmap. The color correction table 1214C has few matched colors, is suitable for representation of vivid colors, and is selected when the attribute information X indicates that the image type is character. The table 1214B has a number of matched colors intermediate between those of tables 1214A and 1214C, and is a table capable of expressing values between the two tables 1214A and 1214C; it is selected when the image type in the attribute information X is graphics.
After color conversion, the CMYK grayscale data is output to the addition portion 122. The addition portion 122 adds the attribute information X and the CMYK grayscale data. This is because in halftone processing, the attribute information is necessary when selecting the optimum halftone table according to the image type. The CMYK grayscale data added by the addition portion 122 is output to the compression portion 107.
Returning to
The functional block configuration of the printing device 2 appears in
The compressed CMYK grayscale data output from the host computer 1 is input to the decompression portion 201, which performs expansion (decompression) processing. After decompression, the CMYK data (also including the attribute information X when the data was expanded into band memory 105 as RGBX data) is output to the halftone processing portion 202. The halftone processing portion 202 selects the optimum table from a plurality of halftone tables, according to the type of image in the attribute information X, and generates reproduced image data expressing the halftones of a variable-density image. Table may be, for example, of two types, one a table with fine dots and numerous screen lines, and the other with coarse dots and fewer screen lines. When there is a large number of screen lines, the image can be reproduced faithfully without omitting any fine lines, so that resolution is high; such a table is useful when printing characters and graphics. When there are few screen lines, a greater number of grayscale changes can be reproduced, which is advantageous when printing bitmaps. Hence when the information indicating the image type in the attribute information X is graphics or characters, a table with a large number of screen lines is selected, and when the image type is bitmap, a table with a small number of screen lines is selected. The halftone processing portion 202 computes output values corresponding to CMYK grayscale data in the table (a so-called γ table), and outputs the output values as reproduced image data.
The pulse-width modulation portion 203 takes as input the reproduced image data from the halftone processing portion 202, and generates driving data having or not having laser driving pulses for each dot to be formed on the print media. The generated driving data is output to the print engine 24.
The print engine 24 comprises a laser diode (LD) 241 and photosensitive drum 242. The laser diode 241 takes as input the driving data from the pulse-width modulation portion 212, and irradiates the photosensitive drum 242 with laser light corresponding to the driving data. By this means, a latent image is formed on the drum 242. Development is performed by causing toner in each of the CMYK colors to adhere to the drum 242, and after being conveyed by a transfer belt, not shown, the image is actually printed onto printing paper or other recording media.
The details of operation of a system to which this invention is applied, configured as described above, is explained.
Next, the CPU 10 generates an image or similar for printing, and generates a GDI drawing record representing the image. This GDI drawing record is generated in order to generate the image in the application portion 101, as described above. For example, the case in which the printing image shown in
Of these, the drawing command for image 1 is, as shown in
The graphic 1 is represented by a plurality of lines, with the coordinates of the starting position at “X4, Y4” and the coordinates of the ending position at “X5, Y5”. The graphic 2 has starting position at coordinates “X7, Y7”, and is of width “W7” and height “H7”. Graphic 2 is a rectangular shape, comprising a plurality of black dots on a white background. This graphic image is called a binary pattern. Hence in order to represent the graphic using two-color RGB crystal values, the drawing record for graphic 2 becomes “R0, G0, B0, R1, G1, B1”.
The character 1 is represented by the command “Char” indicating a character; the arguments are “X3, Y3” indicating the starting position, the width “W3”, height “H3”, and the RGB grayscale values “R, G, B” indicating the color of the character. Likewise, character 2 is represented by the command “Char” with as arguments the starting position “X6, Y6”, width “W6”, height “H6”, and RGB grayscale values “R, G, B”. Here, character 1 is monochrome data (with RGB values either “00000000” (binary) or “11111111” (binary)), and character 2 is color data (data other than monochrome data). A drawing command generated in this way is stored temporarily in for example RAM 14, under the control of the CPU 10.
Returning to
Then, the CPU 10 generates intermediate code from the analyzed drawing record (step S13). This processing is performed by the intermediate code generation portion 103 in
In band 2, the image 2 and character 1 in ”, (R, G, B)”. “CH” indicates that the image type is character; “(X′3, Y′3)? is the coordinate position of the starting point of character 1; “W3” is the width and “H3” the height of character 1; and “(R, G, B)” indicates the color of character 1. In this case, each of the RGB values is either “00000000” (binary) or “11111111” (binary). The coordinate position of the starting point is again the position relative to the origin (0,0), which is the upper-leftmost position in band 2.
identifies the character of character 1.
The graphic 1 and character 2 shown in
The graphic 2 shown in
Returning to
Details of processing for expansion into band memory appear in
In step S142, the CPU 10 judges whether the pattern is solid or is a binary pattern. “Solid” refers to a single color; a binary pattern, as explained above, has two colors. The CPU 10 performs a judgment by reading the RGB grayscale values in the intermediate code. That is, if there is only one RGB grayscale value, the pattern is judged to be solid, and if there are two values, the pattern is judged to be a binary pattern. For example, graphic 1 comprises a single color, and the intermediate code has only one RGB grayscale value “(R, G, B)”, and so graphic 1 has a solid pattern. And, graphic 2 has two RGB grayscale values “(R0, G0, B0, R1, G1, B1)”, and so can be judged to be a binary pattern. If the pattern is a solid or binary pattern, “YES” is selected in this step, and processing proceeds to step S143. If an image is a graphic or character and has other than a solid or binary pattern, such as for example if a repeating pattern is formed in the graphic, it is necessary to perform color correction and other processing, so that “NO” is selected in this step, and processing proceeds to step S146.
In step S143, the CPU 10 judges whether R=G=B=“00000000” (binary) or “11111111” (binary) (in hexadecimal, “00” or “ff”). This is to judge whether the color is white or black. This is because even if the image type is graphic or character, and comprises a solid or binary pattern, if the actual color is other than white or black, a color correction table should be used to perform color conversion. In this step also, the CPU 10 can perform judgment by reading each of the RGB grayscale values in the intermediate code and judging according to whether the values are “00000000” (binary) or “11111111” (binary). If the color is white or black, “YES” is selected in this step, and processing proceeds to step S144. If other than white or black, “NO” is selected in this step, and processing proceeds to step S146.
In step S144, the CPU 10 generates a type key. As explained above, the type key indicates whether or not a color correction table is used to perform color conversion. In this step S144, the type key is generated indicating that color conversion is not performed. As explained above, the generated type key is stored in RAM 14 under the control of the CPU 10.
Next, the CPU 10 expands the RGB grayscale data, as gray data, in the band memory 105. That is, rather than expanding into band memory 105 each of the RGB grayscale values, “00000000” (binary) or “11111111” (binary), instead the 8 bit values “00000000” or “11111111” are themselves expanded. If processing for expansion into band memory 105 ends, processing proceeds to step S15.
On the other hand, if “YES” is selected in step S141 and “NO” is selected in steps S142 and S143, in step S146 the CPU 10 generates a type key. As opposed to the type key of step S144, however, a type key is generated indicating that a color conversion table is to be used to perform color conversion. The generated type key is similarly stored in RAM 14. Processing then proceeds to step S147, and the CPU 10 expands the RGB grayscale values and attribute information X into band memory 105. If expansion processing ends, processing proceeds to step S16.
Through expansion into band memory 105, the manner of printing onto the print media is determined, and thereafter the CPU 10 performs color conversion into CMYK data of the gray data or the RGB grayscale data.
Returning to
In step S17, the CPU 10 performs compression processing. As explained above, data compression is performed by encoding the CMYK grayscale data using a Huffman code or similar. The compressed CMYK grayscale data is then output to the printing device 2 (step S18). If one page's worth of CMYK grayscale data is generated (“YES” in step S19), this processing ends (step S20), and if data remains, processing returns to step S11 and the above-described processing is repeated.
Through the above processing, compressed CMYK grayscale data (if expanded in band memory as RGBX data, also including attribute information X) is output to the printing device 2 from the host computer 1. In the printing device 2, decompression is performed by the decompression portion 201, and reproduced image data forming a variable-density image is generated by the halftone processing portion 202. If expanded as RGBX data, the CMYK grayscale data is selecting either a resolution-priority halftone table or a grayscale-priority halftone table, according to the attribute information X. If expanded as gray data, the CMYK grayscale data (in this case, “11111111” or “00000000”) can be processed using either table. This is because in halftone processing using a γ table, because of the γ characteristic representing the relation between input values and output values (a characteristic such that, if input values are near “0” (decimal) the output values rise rapidly, and as input values approach “255” (decimal) the output values change so as to gradually approach “255”) the input values “0” (in binary representation, “00000000”) and “255” (in binary representation, “11111111”) are unaffected by the characteristic, and whichever table is selected, the output values do not change.
The generated reproduced image data is then used by the pulse-width modulation portion 203 to generate driving data to generate dots, and the print engine 24 is used to perform printing on print media.
As explained above, by means of this invention, if the type of an image for printing is a graphic or character, and moreover comprises a solid or binary pattern, and moreover RGB grayscale values are “0” (decimal) or “255” (decimal), one byte of grayscale values can be expanded rather than expanding all the RGB values into band memory 105, so that image processing can be made faster and the speed of printing operations can be increased, and moreover high-quality images can be printed.
In the above-described example, expansion into band memory 105 and color processing are performed by a host computer 1; however, the above-described advantageous results can be obtained even when for example the expansion and processing are performed for example by the printing device 2. Further, as the host computer 1, a personal computer, a portable telephone, PDA (Personal Digital Assistant), or other portable information terminal may be used.
The example of a laser printer as a printing device 2 was explained, but the advantageous results of this invention can be obtained when the printing device is an inkjet printer, BubbleJet (a registered trademark) printer, fax machine, photocopier, or multifunctional device comprising a plurality of functions.
Moreover, an example was explained in which processing using a γ table was employed as an example of halftone processing; but in addition, dithering methods, in which the grayscale values of each pixel are compared with threshold values in a threshold matrix to generate reproduced image data indicating the presence or absence of dots, error diffusion methods, in which by similarly comparing threshold values reproduced image data is generated, and in addition differences are diffused among unprocessed pixels in the vicinity and values including the differences compared with threshold values, and other methods of halftone processing may be used.
Number | Date | Country | Kind |
---|---|---|---|
2003-384462 | Nov 2003 | JP | national |