The disclosed embodiments generally relate to the field of image processing.
Error diffusion methods, such as the method described in R. W. Floyd & L. Steinberg, “An Adaptive Algorithm for Spatial Grayscale,” in the Proceedings of the Society for Information Display, vol. 17, pp 75-77 (1976) (the “Floyd-Steinberg method”), are often used to convert grayscale images to binary images on a binary output device. Such error diffusion methods typically examine a pixel in an input image, determine whether the intensity for the pixel in the input image exceeds a threshold, and assign either a light or dark binary value to the pixel in an output image based on whether it exceeds the threshold. The difference between the input image pixel intensity and the corresponding pixel intensity in the output image is the error for the pixel. Error diffusion methods assign at least a portion of the error to each of one or more neighboring pixels that have not been previously assigned a pixel intensity for the output image. In this manner, the total pixel intensity is substantially maintained throughout the output image without a substantial loss of resolution. However, individual pixels might be lighter or darker in the resulting image than in the input image.
For example,
For the second pixel, the error value E1 is subtracted from the original value for the pixel. Since the resulting value is less than the threshold, the second pixel is assigned a value of “0” (e.g., “dark”). The error value, E2, is computed for the second pixel. The process iterates over each subsequent pixel until all pixels are computed. Alternate error diffusion methods might diffuse the calculated error among a plurality of unconverted pixels. For example, a first portion of the error value E1 for the first pixel could be subtracted from the second pixel and a second portion could be subtracted from the third pixel.
Exemplary methods of using error diffusion to generate an output image include the methods described in U.S. Pat. Nos. 5,226,094 and 5,374,997 to Eschbach, the disclosures of each of which are incorporated by reference in their entirety.
Within the last decade, error diffusion rendering techniques have enjoyed a wide range of image-quality enhancements. Recent advancements have extended the application of error diffusion algorithms into the color domain, offering excellent print quality across a number of reprographic engines and inkjet marking products in both hardware and software.
One problem inherent in the Floyd-Steinberg method, its progeny and other current error diffusion methods is that error determinations for pixels require a significant amount of computation when implemented in hardware. Propagation of the error due to pixel binarization requires fast and efficient use of hardware to provide the necessary high-speed throughput data rates needed to distribute the error to the destination pixels. The throughput or clock speed at which the error diffusion algorithm can be performed limits the number of pages which can be produced in a particular time frame.
As throughput requirements increase, the required error diffusion rates can become difficult or expensive to achieve with current implementations. This is particularly so when information is transferred in an environment in which trace lengths affect the maximum clock rate. Alternatively, processors that perform the computations at the required rates might not be cost effective for particular applications.
Alternate error diffusion methods, such as the one described in U.S. Pat. No. 5,353,127 to Shiau et al., the disclosure of which is incorporated herein by reference in its entirety, and for which methods are shown herein in
Although the anti-worm coefficients permit efficiency and speed, the error caused by truncation due to bit-shifting may be significant at extreme light and dark intensities. In any error diffusion technique, all error must be maintained and propagated to the downstream pixels regardless of the source. If this “truncated” error is not fully accounted for, the true (desired) intensity levels are not precisely rendered.
What is needed is a multi-pixel error diffusion method that enables high-speed error diffusion for computing error diffusion and intensity information.
A need exists for reducing the cost of performing error diffusion for an image.
A need exists for an error diffusion method and system that compensate for truncation in error compensation.
A further need exists for an error diffusion system that is programmable based on the error diffusion method being performed and the resulting image quality.
The present disclosure is directed to solving one or more of the above-listed problems.
Before the present methods, systems and materials are described, it is to be understood that this disclosure is not limited to the particular methodologies, systems and materials described, as these may vary. It is also to be understood that the terminology used in the description is for the purpose of describing the particular versions or embodiments only, and is not intended to limit the scope.
It must also be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural references unless the context clearly dictates otherwise. Thus, for example, reference to a “pixel” is a reference to one or more pixels and equivalents thereof known to those skilled in the art, and so forth. Unless defined otherwise, all technical and scientific terms used herein have the same meanings as commonly understood by one of ordinary skill in the art. Although any methods, materials, and devices similar or equivalent to those described herein can be used in the practice or testing of embodiments, the preferred methods, materials, and devices are now described. All publications mentioned herein are incorporated by reference. Nothing herein is to be construed as an admission that the embodiments described herein are not entitled to antedate such disclosure by virtue of prior invention.
In an embodiment, a method for performing error diffusion may include receiving an error value for a pixel, determining one or more error diffusion values based on the error value, compensating for a difference between the error value and a sum of the error diffusion values by summing each error diffusion value with a corresponding error compensation value to yield one or more compensated error diffusion values, and diffusing a compensated error diffusion value to a destination pixel.
In an embodiment, a system for performing error diffusion may include a processor, and a processor-readable storage medium in communication with the processor. The processor-readable storage medium may contain one or more programming instructions for performing a method for performing error diffusion including receiving an error value for a pixel from a memory location in the processor-readable storage medium pertaining to the pixel, determining, via the processor, one or more error diffusion values based on the error value, compensating, via the processor, for a difference between the error value and a sum of the error diffusion values by summing each error diffusion value with a corresponding error compensation value to yield one or more compensated error diffusion values, and diffusing a compensated error diffusion value to a memory location in the processor-readable storage medium pertaining to a destination pixel.
In an embodiment, a method for producing an output image by performing error diffusion in a xerographic apparatus may include receiving an input image including a plurality of pixels; determining a pixel intensity value for each pixel; for each pixel, receiving an initial error value, computing a pixel value for the pixel and an updated error value each computed based on the pixel intensity value for the pixel and the initial error value, determining one or more error diffusion values based on the updated error value, compensating for a difference between the updated error value and a sum of the error diffusion values by summing each error diffusion value with a corresponding error compensation value to yield a compensated error diffusion value, and diffusing a compensated error diffusion value to an initial error value for a destination pixel; and generating an output image based on the pixel values.
Aspects, features, benefits and advantages of the embodiments described herein will be apparent with regard to the following description, appended claims and accompanying drawings where:
In selected embodiments, a programmable device may retain a bit-shifted error component and properly distribute the error in a deterministic manner. As such, the gray levels may be recaptured, and an accurate rendered binary output may be generated. In an embodiment, a programmable look-up table (LUT), a register array, and/or the like may be used to detect and efficiently distribute the error component to the destination pixels.
Referring to
In
The “actual” distributed fast-scan error 415 may include the error diffusion value diffused to destination pixel A in the Shiau-Fan error diffusion method. Since the error diffused to destination pixel A 415 in the Shiau-Fan method is one-half of the error, each entry in the table may be equal to one-half of the total desired distributed error 405 (rounded). This value may be computed by bit shifting the four least significant error bits 412 by one and maintaining the sign 411. The fast-scan error 415 may be required to be computed in one cycle since destination pixel A may be the next pixel for which error is determined.
The “actual” distributed slow-scan error 420 may include the error diffusion values diffused to destination pixels B-F in the Shiau-Fan error diffusion method. According to the Shiau-Fan error diffusion method, the error diffusion values for destination pixel B 421, destination pixel C 422, destination pixel D 423, destination pixel E 424 and destination pixel F 425 may equal 0, one-quarter of the total desired distributed error 405, one-eighth of the total desired distributed error, one-sixteenth of the total desired distributed error, and one-sixteenth of the total desired distributed error (rounded), respectively. Each of the error diffusion values for destination pixels C-F may be computed by bit-shifting the four least significant error bits 412 by an appropriate amount and maintaining the sign 411. Additional or fewer destination pixels and/or different pixel weights may be utilized within the scope of this disclosure.
The entries in the total truncated error component column 430 may equal the total desired distribution error 405 minus the sum of the actual distributed fast-scan error 415 and the actual distributed slow-scan error 420. The total truncated error component 430 may represent the amount of error that is not properly diffused by bit shifting the error value.
The 15-bit output may be partitioned into, for example, five sections 510a-e. For example, one 3-bit section may be input to each adder 515b-f in the slow-scan error distribution circuit. In this way, the truncated error may not only be adjusted to re-capture the lost gray level(s) via bit-shifting, but may also be distributed to result in the best image quality (i.e., fewer worming artifacts, etc.). In addition, since the architecture includes a programmable LUT 505, the error may be uniquely adjusted to take into account the “round-up” effect of bit-shifting binary numbers. As a result, the LUT 505 may produce symmetrical and nearly identical bit-patterns at both the extreme highlight (i.e., 254, 253, 252, etc.) and shadow (i.e., 1, 2, 3, etc.) regions.
The flip flops 520a-d may be used to transmit error truncation information from all pixels for which the particular pixel is a destination. For example, as pixelN is examined, destination pixel B receives the sum of the error truncation compensation information 510a (i.e., an error compensation value) from the LUT 505 and the previous slow-scan error which may be stored in an on-chip line-buffer memory. This value (i.e., a compensated error diffusion value) may be stored in flip flop 520a. When pixelN+1 is examined, destination pixel C may be the same pixel as destination pixel B for pixelN. Accordingly, the error value for the pixel may include the sum of the error from pixelN+1>>2, flip flop 520a, and the error compensation information 510b (i.e., a second error compensation value) from the LUT 505. This value (i.e., a second compensated error diffusion value) may be stored in flip flop 520b. This process may be repeated until the output of adder 515f is stored in the line-buffer memory for the pixel. This error may later be retrieved when the pixel occupies the destination pixel A and pixelN locations.
In an embodiment, the LUT 505 may be extended with an additional 3-bit partition that supplies additional error truncation information caused by the bit-shifted truncation to the adder for destination pixel A 515a in order to enhance an output image quality. However, any error transmitted to the adder for destination pixel A 515a must be transmitted in one clock cycle if processing one pixel per cycle is required. In an alternate embodiment, all truncated error may be captured and diffused to the slow-scan destination pixels. As a result, the original gray-level information may be maintained.
In an embodiment using the error compensation values shown in
In the case of a color imaging system, a plurality of implementations of the described method and system or a similar error diffusion method and system may be used. For example, a first implementation may determine whether a pixel includes the color cyan or the color white; a second implementation may determine whether a pixel includes the color magenta or the color white; a third implementation may determine whether a pixel includes the color yellow or the color white; and a fourth implementation may determine whether a pixel includes the color black or the color white. Error values for each of the cyan, magenta, yellow and black implementations may be diffused to subsequent pixels. Additional or alternate implementations, such as red, green, blue and black, may also be used within the scope of this disclosure.
In an embodiment, a xerographic apparatus, such as a digital scanner, facsimile device, copying device, a multifunctional device, and the like may include the methods and systems described above. Other non-xerographic apparatuses performing similar functions may also include methods and systems within the scope of the present disclosure.
A disk controller 904 interfaces with one or more optional disk drives to the system bus 928. These disk drives may be external or internal floppy disk drives such as 910, CD ROM drives 906, or external or internal hard drives 908. As indicated previously, these various disk drives and disk controllers are optional devices.
Program instructions may be stored in the ROM 918 and/or the RAM 920. Optionally, program instructions may be stored on a computer readable medium such as a floppy disk or a digital disk or other recording medium, a communications signal or a carrier wave.
An optional display interface 922 may permit information from the bus 928 to be displayed on the display 924 in audio, graphic or alphanumeric format. Communication with external devices may optionally occur using various communication ports 926. An exemplary communication port 926 may be attached to a communications network, such as the Internet or an intranet.
In addition to computer-type components and their equivalents, the hardware may also include an interface 912 which allows for receipt of data from input devices such as a keyboard 914 or other input device 916 such as a remote control, pointer and/or joystick.
A multiprocessor system may optionally be used to perform one, some or all of the operations described herein. Likewise, an embedded system, such as a sub-system within a xerographic apparatus, may optionally be used to perform one, some or all of the operations described herein.
For example, a xerographic apparatus may scan an image into, download an image in or otherwise receive an image in, for example, a digital format. The digital format may include one or more pixel values for each pixel in the image. The pixel values may be stored in a memory prior to processing or may be utilized for processing as the image is being scanned. The xerographic apparatus may use a method described above or an equivalent method to determine binary pixel values, error diffusion values and error compensation values as each pixel is processed. Error information may be forwarded to the destination pixels. Upon completion of or during pixel processing, the resulting binary image may be transferred to, for example, a printing module of the xerographic apparatus, a printer, or any other device for generating a human-readable representation of the image.
It will be appreciated that various of the above-disclosed and other features and functions, or alternatives thereof, may be desirably combined into many other different systems or applications. Also that various presently unforeseen or unanticipated alternatives, modifications, variations or improvements therein may be subsequently made by those skilled in the art which are also intended to be encompassed by the following claims.