1. Field of the Invention
The present invention relates to an image processing device and an image processing program that causes a computer to execute image processing, and, more particularly, to an image processing device and an image processing program capable of increasing the compression ratio by raising the repetition of pixel image data by means of resolution conversion.
2. Description of the Related Art
A printer that prints images created by a host computer is confronted by a variety of strict demands such as low costs, high-speed printing, and high quality printing. More particularly, host-based printers, for which the majority of image processing for printing is performed by the printer driver of the host computer, have been proposed due to cost-reduction demands.
In these host-based printers, image data, which is expanded into RGB values or CMYK values corresponding with the printer toner for each pixel, is generated by a printer driver from a rendering record generated by an application on the host computer, whereupon the generated image data is compressed and transferred to the printer. The printer extends the received image data, performs binarization such as screen processing, and then produces an image on the print medium by means of a printer engine. Because the majority of the image processing is executed by an image processing program on the host computer in line with the increase in host computer performance, the image processing device in the printer controller can be greatly reduced, which can be associated with printer cost reductions.
The above described host-based printer is disclosed in Japanese Patents No. 3284464, No. 3367555, and No. 3367556.
In comparison with a conventional printer, which receives print data in page description language before performing image processing and printing, in the case of the host-based printer, image data expanded into pixels on the host computer side must be compressed before being transferred to the printer. When the volume of this image data increases, the time taken for the image data to be transferred from the host computer to the printer becomes longer, and there are therefore problems such as a drop in the printing throughput. More particularly, according to a compression algorithm that takes into consideration repetition of previous raster image data and previous pixel image data, a compression ratio of parts of the image becomes poorer in the case of page resources including image, there being a tendency for the size of the transferred image data to increase.
Therefore, an object of the present invention is to provide an image processing device and an image processing program capable of improving the compression ratio of image data expanded into pixels.
In order to resolve the above object, one aspect of the present invention is an image processing program that causes a computer to execute an image processing procedure to generate image data for each pixel based on a rendering command, wherein the image processing procedure comprises: a procedure that expands image data for each pixel of a predetermined color space, based on the rendering command; and a compression procedure that compresses the image data for each pixel by considering repetition of the image data, and wherein the expansion procedure includes a resolution conversion procedure that replaces, with respect to an adjacent pixel group having of a plurality of adjacent pixels, the image data for each pixel in the adjacent pixel group with the image data of any pixel in the adjacent pixel group, in cases where a differential of luminance-related values of the image data between the plurality of adjacent pixels is equal to or less than a predetermined threshold value.
According to the above aspect of the invention, resolution conversion can be performed by replacing adjacent pixels having close luminance-related values that are inconspicuous to the human eye with common image data, whereby the compression ratio of the compression procedure can be improved. Accordingly, the time taken to transfer image data from the host computer to the printer can be reduced and the printing throughput can be raised.
Furthermore, in order to achieve the above object, another aspect of the present invention is an image processing program that cause a computer to execute an image processing procedure to generate image data for each pixel based on a rendering command and transfer the image data to, a printing device, wherein the image processing procedure comprises: a procedure that expands image data for each pixel of a predetermined color space, based on the rendering command; a color conversion procedure that converts the image data of the predetermined color space for each pixel generated by the expansion procedure into image data for the color space of color material of the printing device; and a compression procedure that compresses the color converted image data for each pixel by considering repetition of the image data, the expansion procedure includes a resolution conversion procedure, which, with respect to an adjacent pixel group having a plurality of adjacent pixels, replaces the image data for each pixel in the adjacent pixel group with common image data in cases where a differential of luminance-related values of the image data between the plurality of adjacent pixels is equal to or less than a predetermined threshold value; and in the color conversion procedure, after a predetermined pixel image data is color-converted, pixel that has the same image data as the predetermined pixel image data is provided with the color-converted image data.
According to the above other aspect, because, in the color conversion procedure, color conversion procedure is not repeated for the same image data, the processing time of the color conversion process can be reduced and the printing throughput can be improved.
Embodiments of the present invention will be described below with reference to the drawings. However, the scope of protection of the present invention is not limited to the following embodiments, but rather extends to the inventions that appear in the claims as well as to any equivalents thereof.
The printer 20 receives compressed CMYK data 18 from the interface I/F of the host computer 10 via a predetermined communication medium. The communication medium may be a wired communication medium such as a USB cable or a wireless communication medium such as an IEEE802.11 wireless LAN or other wireless LAN. Upon receipt of the compressed CMYK image data 18, the controller 22 of the printer 20 expands the compressed data by means of an expansion circuit 24, performs binarization for each CMYK color plane of each pixel by means of a screen processing unit 26, pulse-width modulates the binary data by means of a pulse width modulation circuit 28, and then supplies a drive pulse signal to a print engine 30. For example, the print engine 30 forms a latent image on a photosensitive drum by means of laser beam driven by a drive pulse signal, develops the image by means of CMYK developing toner, and then transfers the developed image to the print medium. In cases where the print engine 30 prints the image on a print medium by means of ink jets, an error diffusion processing unit and an inkjet-nozzle drive signal generation section are provided in place of the screen processing unit 26 and PWM 28, and so forth.
The printer driver 14 installed in the host computer 10 generates compressed CMYK data 18 corresponding with the color material of the printer by image-processing the rendering record generated by the application program 12. Further, in order to raise the compression ratio of the compressed CMYK data, processing to increase the repetition of the image data for each pixel is performed by carrying out resolution conversion in accordance with luminance-related values such as luminance values, brightness, and so forth, as will be described subsequently.
Here,
Returning now to
The intermediate code in
The intermediate code includes function code (or a rendering command) for expansion that is uniquely assigned to the printer driver 14 corresponding with the printer 20, and, even when the rendering code of an application is different, the rendering code is converted into the common intermediate code so that the common expansion procedure of the printer driver 14 can expand the intermediate code into image data for each pixel.
Next, the printer driver 14 performs expansion from the intermediate code into image data RGBX for each pixel in each band (S14). The image data RGBX consists of pixel color data R(red), G(green), and B(blue), and attribute data X indicating the image type, each of these image data RGBX being constituted by 8-bit data. The image types are, for example, graphics such as circles and graphs, characters, and images such as photographs and natural images, these image types being classified by attribute data X, and are utilized in the allocation of the optimal process in the screen processing of the printer controller and so forth.
Expansion Processing
By expanding the above-mentioned intermediate code, the expanded image data RGBX for each pixel is stored in the band memory region in the RAM in the host computer 10. In an initialization state, white data with RGB=(255, 255, 255) is written to the band memory as color data RGB, for example, and graphics data is written as the image-type data for the attribute data X. Further, in band 1, pixel image data for the area in the circle 321 is generated by means of the intermediate code that expands circle 321, and written to the band memory. In band 2, pixel image data in the upper part of the image 322 is written to the band memory. In addition, in band 3, pixel image data for the remaining lower portion of image 322 is written to the band memory and pixel image data for the upper part of the character 323 is written to the band memory. Further, in band 4, pixel image data for the remaining lower part of character 323 is written to the band memory.
Resolution Conversion Processing
Next, the printer driver 14 finds the luminance values from the RGB data for each pixel of the image data, and then performs resolution conversion processing (S16). More specifically, the printer driver 14 finds the luminance values of each pixel from RGB data for adjacent pixel groups of a plurality of adjacent pixels and it is then judges whether the differential of the luminance values between adjacent pixels is equal to or less than a threshold value. If this differential is equal to or less than the threshold value, image data RGB of a plurality of pixels of the adjacent pixel groups are replaced by the image data of any pixel. Accordingly, image data in adjacent pixel groups comprising pixels whose luminance values are close then become common image data whose resolution is zero, whereby the resolution is lowered by the conversion.
Next, the resolution conversion processing S16 calculates the luminance value Y of each pixel from the image data RGB0, RGB1, RGB4, and RGB5 of each pixel in the adjacent pixel group 42 (S34). The arithmetic equation for finding the luminance value Y is as follows:
Y=aR+bG+cB=0.2990*R+0.5870*G+0.1140*B
The arithmetic equation is a floating-point operation and, hence, in order to increase the computation speed, the following arithmetic equation, which is the result of changing coefficients rendered by multiplying each of the coefficients a, b, and c by 65536, is preferable. All of the luminance values Y are integer values in this arithmetic equation, where by the computation speed can be raised.
Y=19595*R+38470*G+7471*B
A judgment of whether the luminance differential between adjacent pixels is equal to or less than a predetermined threshold value Vth is made with respect to the luminance value 42Y of four pixels in the adjacent pixel group 42 (S36). That is, it is checked whether the luminance-value differences of these pixels are equal to or less than the threshold value Vth for a combination of six types of adjacent pixels. The threshold value Vth is set at about 64 (25%) or 128 (50%) grayscales in the case of at most 256 grayscales. The threshold value Vth can be suitably selected by considering the drop in image quality. In addition, the combination of adjacent pixels is not necessarily limited to six types. There may also be only four types that are left, right, top, and bottom.
Further, when the six types of differential of the luminance value Y are all equal to or less than the threshold value Vth, the pixel image data of the adjacent pixel groups 42 is replaced by the image data of any pixel in the adjacent pixel groups (S38). In the example in
The resolution conversion processing with respect to the adjacent pixel groups 42 is then repeated for all the pixels in the selected image area (S40). That is, adjacent pixel groups 42 consisting of 2×2 pixels in the image area are sequentially readout, resolution conversion processing is performed on these groups 42, and, when the luminance values are close, image data are replaced by representative pixel image data. In addition, processing is repeated for all the image areas in the same band (S42).
The grounds for performing resolution conversion are that, because the human eye is highly sensitive to variations in image brightness, when the variation in the luminance values of adjacent pixels is small, even though the image data of these adjacent pixels are changed into the same, the image quality is not dropped excessively. Therefore, the repetition of the image data can be improved by replacing image data with representative pixel-image data in such image groups, whereby the efficiency of subsequent color conversion processing is improved and the compression ratio can be raised.
In cases where the resolution of the print engine 30 of the printer is a relatively low resolution such as 300 dpi, the resolution can be lowered to 150 dpi at most by performing a single resolution conversion process on a 2×2 pixel adjacent pixel group. However, when the resolution of the print engine 30 is a relatively high resolution such as 600 dpi, the resolution conversion processing is performed on adjacent pixel groups of 2×2 pixels, and, in cases where the resolution conversion is performed on all the 2×2 pixel adjacent pixel groups in a 4×4 pixel adjacent pixel group, the same resolution conversion processing is preferably performed to the four adjacent pixel groups which are viewed as new adjacent pixel groups. By performing resolution conversion processing twice, a 600-dpi resolution is reduced to 150 dpi at most.
In cases where resolution conversion is performed in all 4 adjacent pixel groups among the 16 pixels (YES in S54), second-stage resolution conversion is also performed to the four adjacent pixel groups which are viewed as four adjacent pixels 42-1 (S56) . As shown in
As described above, the resolution conversion of this embodiment does not change or reduce the number of pixels, and but increases repetition in the image data by replacing adjacent pixel image data with the same image data.
Returning now to
Color Conversion Processing
Returning now to
In this embodiment, the resolution conversion processing is performed so that the same image data is given to areas in which the variation in luminance values is small. Therefore, already converted image data CMYK is given to pixels with the same image data as the color converted pixel in the same raster direction, and color conversion computation is not repeated for these pixels. Accordingly, the time required for color conversion processing can be markedly reduced.
As shown in
Compression Processing
Returning now to
The expansion into in-band pixel image data and resolution conversion processing S18, color conversion processing S20, and compression processing S22 are performed for each band. When the processing for all the bands is complete (YES in S24), one page's worth of compressed CMYKX data 18 (see
Luminance-related Values
In the above embodiment, the luminance values Y are determined from the RGB image data expanded into pixels and the resolution conversion is carried out based on whether a luminance-value differential between adjacent pixels is equal to or less than the threshold value. This is because image areas with small variations in luminance have slight color variations and, therefore, even when color conversion in these image areas is thinned somewhat, the human eye is unable to distinguish such variations sensitively. Therefore, a judgment of whether to perform resolution conversion may be made by using indicators that are inconspicuous to the human eye.
Therefore, only G (green) color data that has the largest effect on the luminance values Y among the RGB color data may be the subject of a comparison rather the luminance values Y. In this case, although there is the advantage that the calculation of luminance value Y can be omitted, there is the disadvantage that the measure for the resolution conversion is somewhat inferior. In addition, the brightness V of the HSV (Hue, Saturation, Value) color space is determined from the RGB color space, and then resolution conversion is performed depending on whether the brightness differential of adjacent pixels is equal to or less than the threshold value. The brightness V is the largest grayscale value (V=MAX (R, G, B)) among the RGB grayscale values, and, therefore, the computation processing to determine the brightness V can be simplified even in cases where the brightness V is taken as the reference. Further, when the image data expanded into pixels are HSV color spaces, the value of the brightness V thereof can be taken as the reference for the resolution conversion. Further, when the color spaces are grey spaces (luminance spaces), the pixel grayscale values themselves are luminance values.
Further Embodiment
The present invention is applicable to a case where the resolution conversion processing, color conversion processing, and compression processing of the above embodiment are performed only on a rendering-record image, and a page-description language, which contains the compressed image data and rendering commands for characters, graphics, and so forth, is transferred from the host computer to the printer. In this case, because the volume of image data contained in the page-description language is reduced, the time for the transfer from the host computer to the printer can be shortened and the overall printing throughput can be improved.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2003-200378 | Jul 2003 | JP | national |