Bit map modification

Abstract: A method of modifying a digital representation of an image in which digital data defines the content of pixels of the image. The method comprises a) determining whether a predetermined degree of compression can be achieved if data defining a block (8-10) of pixels is compressed by applying a predetermined compression algorithm; and, if not, b) discarding a portion of the data in the block, (8-10) and repeating steps a and b on the most recently modified block until the predetermined degree of compression is achieved, and generating a compressed version of the image.

Description: Bit Map Modification The invention relates to methods and apparatus for modifying a digital representation of an image in which the digital data defines the content of pixels of the image. In conventional typesetting applications, an output device such as a laser printer is controlled from an output store in which the image to be printed is defined by a bit map containing binary data for each pixel on a one to one ratio with the output pixels. Conventionally, the output store is formed by a magnetic disc. The high resolutions which are now being used to define an image leads to two problems. The volume of data requires large storage while the requirement to image a page quickly, due to the fast output rates of modern output devices, means that high access rates to the data are required. Conventional discs are unable to permit data to be read sufficiently fast for the output device continuously to operate. An example of the volume of data which is typically processed can be seen by considering a broad-sheet page of 18″ (45.7cm) by 24″ (61cm), or 432 square inches (2787 cm²). A resolution of 2540 dots per linear inch gives a data requirement of 6,451,600 pixels per square inch. Thus a broad-sheet page at this resolution occupies 2,787,091,200 pixels. This is equivalent to about 332 megabytes. Typically, typesetters are aiming at setting a page in a minute thus requiring a data rate of 5.5 megabytes per second. For most types of image on a page, such as text, an improvement has been achieved by compressing the data using a conventional compression technique such as run length encoding so that the amount of data that has to be stored in the output store is much less than the original raw data. Typically, in the case of text or open line drawings, there is redundancy in the raw bit map data of up to 90%. Even in the case of a screened image, the redundancy may be 50%. In a conventional data compression technique, as described in Xerox Disclosure Journal, vol. 8, No. 3, May/June 1983, lines 275-277, a data block is compressed, and if data compression is insufficient, part of the compressed data block is discarded, the remaining data is compressed one more time, and then output. However, a typesetting system must be able to cope with types of image which cannot be significantly compressed. These images would normally have been produced synthetically and include pseudo-random arrangements of data. At present, there is no image modification system which can cope efficiently with such incompressible images. In accordance with one aspect of the present invention, a machine implemented method of modifying a digital representation of an image in which digital data defines the content of pixels of the image comprises: a) determining whether a predetermined degree of compression can be achieved if data defining a block of pixels is compressed by applying a predetermined compresssion algorithm; and, if not, b) discarding a portion of the data in the block, the portion of data on a first iteration of step b being such that the resultant data in the block requires further compression to achieve the predetermined degree of compression, and always repeating step a) on the most recently modified block and repeating step b) if necessary until step a) is satisfied and generating a compressed version of the image. In accordance with a second aspect of the present invention, apparatus for modifying a digital representation of an image in which digital data defines the content of pixels of the image comprises processing means for carrying out the steps of: a) determining whether a predetermined degree of compression can be achieved if data defining a blockof pixels is compressed by applying a predetermined compression algorithm; and, if not, b) discarding a portion of the data in the block, the portion of data on a first iteration of step b being such that the resultant data in the block requires further compression to achieve the predetermined degree of compression and always repeating step a) on the most recently modified block and repeating step b) if necessary, until step a) is satisfied and generating a compressed version of the image. We have recognised that in the small proportion of cases where significant compression cannot be achieved and particularly at the high resolutions at which the volume of data causes problems, there is no significant loss in detail by discarding a portion of the data completely. This can lead to a significant increase in compression ratio being achieved. When the compressed version of the image is subsequently used to control an output device, the output device can reconstitute the discarded data in a number of ways. For example, immediately adjacent data can simply be repeated or additional data can be interpolated from the adjacent data. In either event, this reconstitution can be achieved without limiting the speed of the output device. In the preferred arrangement, each block of pixels comprises an integral number of lines of pixels defining the output image. This is particularly advantageous since in most cases the output image will have a raster form and each block can comprise a number of lines of the raster. However, in certain applications it will be possible for a block to comprise an array of pixels which does not have a dimension corresponding to an outer dimension of the output image. Step (a) can be performed by applying the predetermined algorithm to the digital data (and it will be assumed that this is the case in the remainder of this specification). However, other methods which do not involve compressing the data could be used to determine the compressibility. There are various ways in which the invention can be implemented. For example, step a can comprise compressing data defining pairs of lines of pixels and comparing the resulting compressed data with the data needed to define a single line, step b being carried out if the compressed data has a greater volume than that needed to define a single line and in which step b comprises discarding one of the lines of data. In a modification of this method, groups of more than two lines could be considered with the intention that each block should be compressed to define data no greater than that required to define a single line. In an alternative application, step a comprises compressing all the data in a block; and comparing the volume of the compressed data with that which it is required should be finally generated, step b comprising discarding a portion of the block of data if the volume of the compressed data is greater than that which is required. This alternative method differs from the first method described since the location of the data to be discarded can be from anywhere within the block. Normally, where each block comprises a number of lines of data, the data which is discarded will constitute one or more complete lines chosen from within the block. In a third alternative, step a may comprise determining whether a memory into which the compressed data is to be stored has been filled before all the original digital data corresponding to the block has been compressed. In this third alternative, the compressed data will be written directly into an output memory, such as a RAM, which can be rewritten as required. In the other methods, an intermediate memory, such as a RAM, is required to allow the data to be processed, the finally generated, compressed data then being written to a further memory, such as a disc store. The compression techniques applied in step a may comprise any conventional technique such as one dimensional run length encoding, which is particularly suitable where lines of pixels are involved, or a two dimensional technique. Typically, header information will be generated for each compressed block defining the form of the data in the compressed block (compressed or raw) and defining those parts of the uncompressed data which need to be reconstituted. The processing means may comprise a suitably programmed microcomputer; a hardware arrangement; or a combination of the two. Some examples of methods and apparatus in accordance with the present invention will now be described with reference to the accompanying drawings, in which:- Figure 1 is a block diagram of the apparatus; and, Figure 2 is a flow diagram illustrating operation of the microprocessor. The apparatus shown in Figure 1 comprises a data bus 1 to which is connected a microprocessor 2 controlled by a program stored in a ROM 3. Raw data in binary form defining an image to be output is stored in a memory 4. Typically, the data in the memory 4 will not be stored in the form of a composite page but as individual subsidiary images which the operator wishes to combine in some particular manner. The finished form of the image which is to be output is stored in an output store 5, in binary form and compressed in the manner to be described below. A random access memory (RAM) 6 is provided for use during the compression process. In operation, the user defines the location and orientation of images such as text which he wishes to include in a final output page in a conventional manner. The microprocessor 2 has been programmed to extract the relevant subsidiary images and to create in the output store 5 a representation of the output page. In an example of the method (Figure 2), the RAM 6 is able to store more than two lines of data, for example, ten lines of data. A required compression ratio is set by the microprocessor 2 (for example 2:1), the microprocessor 2 accesses (step 24) a certain number of lines of data from the memory 4 (for example 10 lines) constituting a block and performs (step 25) a compression on those lines in an attempt to reduce them to the required number of lines. To achieve this, the data is read out from the memory 4, compressed and then stored (step 26) in the RAM 6 in sequence. The microprocessor 2 checks (step 27) regularly whether the maximum desired number of lines in the RAM 6 have been filled and, if not, determines whether there is further data to compress (step 28). If the RAM 6 is full and not all data has been compressed (step 29) the microprocessor 2 repeats the process after having discarded (step 30) one or more of the lines of raw data from the block. These lines can be chosen from anywhere within the block of data. The finally compressed version of the data in the RAM 6 is then loaded (step 31) into the output store 5. The output store 5 is then connected with an output device, such as a laser printer, which outputs the image onto paper or the like and can operate at its normal, high speed since a relatively low number of disc accesses is required. It will be appreciated that a decompression circuit (not shown) is provided between the output store 5 and the printer to enable the data to be decompressed. In order that the decompression circuit can determine how to respond to the data in the output store, each line of data in the store 5 is preceeded by a header. This header includes a start of header marker followed by control bits which indicate the form of the data i.e. compressed or raw, and whether or not that data is to be repeated for the next line. In a further alternative (not shown), the intermediate store formed by the RAM 6 can be omitted. In this case, data is compressed and stored directly in the output store 5 which typically will not be in the form of a disc store but in the form of a relatively large RAM. In this case, the raw data from the memory 4 is accessed in blocks by the microprocessor 2 and compressed, the compressed data being stored in the store 5. The compression technique adopted can be any of the methods described above. For example, the data resulting from the application of the compression algorithm can be stored initially in the store 5 and if it is found that the compressed data corresponding to a block of raw data will exceed the allotted space within the memory 5, then the microprocessor will reaccess the original raw data defining the block, discard one or more lines of that data and then recompress it until it does fit within the allotted space.

Claims: A machine implemented method of modifying a digital representation of an image in which digital data defines the content of pixels of the image, the method comprising a) determining whether a predetermined degree of compression can be achieved if data defining a block (8-10) of pixels is compressed by applying a predetermined compressed algorithm; and, if not, b) discarding a portion of the data in the block, (8-10) the portion of data on a first iteration of step b being such that the resultant data in the block requires further compression to achieve the predetermined degree of compression and always repeating step a) on the most recently modified block and repeating step b), if necessary, until step a) is satisfied and generating a compressed version of the image. A method according to claim 1, wherein each block (8-10) of pixels comprises an integral number of lines (8A, 8B; 9A, 9B; 10A, 10B ...) of pixels defining the output image. A method according to claim 1 or claim 2, wherein step a) is performed by applying the predetermined algorithm to the digital data. A method according to any of the preceding claims, wherein step a) comprises compressing data defining pairs of lines of pixels and comparing the resulting compressed data with the data needed to define a single line, step b) being carried out if the compressed data has a greater volume than that needed to define a single line and in which step b) comprises discarding one of the lines of data. A method according to any of claims 1 to 3, wherein step a comprises compressing all the data in a block; and comparing the volume of the compressed data with that which it is required should be finally generated, step b) comprising discarding a portion of the block of data if the volume of the compressed data is greater than that which is required. A method according to any of claims 1 to 3, wherein step a) comprises determining whether a memory (6) into which the compressed data is to be stored has been filled before all the original digital data corresponding to the block has been compressed. A method according to any of the preceding claims, wherein header information is generated for each compressed block defining the form of the data in the compressed block and defining those parts of the uncompressed data which need to be reconstituted. A method according to any of the preceding claims, wherein the compression algorithm applied in step a) is one dimensional runlength encoding. Apparatus for modifying a digital representation of an image in which digital data defines the content of pixels of the image, the apparatus comprising processing means (2) for carrying out the steps of a) determining whether a predetermined degree of compression can be achieved if data defining a block (8-10) of pixels is compressed by applying a predetermined compression algorithm; and, if not, b) discarding a portion of the data in the block, (8-10) the portion of data on a first iteration of step b being such that the resultant data in the block requires further compression to achieve the predetermined degree of compression and always repeating step a) on the most recently modified block and repeating step b), if necessary, until step a) is satisfied and generating a compressed version of the image. Apparatus according to claim 9, further comprising a RAM (6) into which compressed data is loaded by the processing means (2). Apparatus according to claim 10, wherein the RAM (6) is capable of storing only two lines of compressed data. Apparatus according to any of claims 9 to 11, wherein the processing means (2) comprises a suitably programmed microcomputer.

Inventors: DAVY REX WILLIAM, HARRIS DAVID JAMES, DAVY, REX WILLIAM, HARRIS, DAVID JAMES
Applicants: CROSFIELD ELECTRONICS LTD, CROSFIELD ELECTRONICS LIMITED
Application year: 1990
Main classification: H04N1
IPC codes: G06T9, G06F3, B41J5, H04N1, G06F5