Dot data compression and expansion method and apparatus

Abstract: A predictive function expressed by a dot matrix is applied to binary image data and an object dot is converted into, e.g., white data so as to increase the number of white data. A run length coding is performed on the image data where the number of the white data is increased, thus compression is performed on the image data at high compression rate. When expanded, the compressed image data is expanded by run length decoding. A reverse prediction is performed by using the predictive function, thus, original image data is obtained.

Description: BACKGROUND OF THE INVENTION The present invention relates to a data compression/expansion method and apparatus which compresses or expands binary image data such as font data, and to a printing apparatus. Conventional printing apparatuses and word processors store image data such as font data in an internal ROM. When a character code is inputted and an output of the character to a recording medium or a screen is instructed, font data corresponding to the character code is read out in accordance with the instruction. The font data is developed on a bit map, and an image is formed. In a printer such as an ink-jet recording device or a laser beam printer which can perform recording at high resolution, a large amount of image data is required to print a predetermined area, and higher resolution is also required for the font data. Thus, as the resolution increases, the number of dots forming a single character increases, resulting in the amount increase of the whole font data. Fig. 2 is a diagram showing the font data of an alphabetical character "B" formed on 48 × 48 matrix as an example. In such font data, 288 bytes (2304 bits) is required for a character. In the case of Japanese writing system having approximately 7,000 characters for a single font, approximately 2M bytes is required for a memory capacity to store all the character font. This results in cost increase. To solve the above problem, it is considered to compress the character font. As a method of compressing binary font data, run length method is well-known. The font data can be also compressed by MH coding or MMR coding which is used for a system performing an image transfer such as a facsimile. A font data compression method is described with reference to Fig. 3. In Fig. 3, the font data comprised of 20 × 20 dot matrix is shown. The black portion 301 is the data portion to be printed or displayed. In case of this font data, since 90% of the data is composed of white data, the frequency of continuously appearing white data is rather high. In fact, columns 1-7 and 16-20 are all white data in Fig. 3. When there is black data in a column, a header 302 provided in one bit basis for each column is marked. On the other hand, when there is no black data in a column, the header 302 is not marked. Thus, the font data excluding the white data columns can be stored by providing the header 302 and referring the presence of black data. Alternatively, it is possible to determine the presence of a black dot by the header 302 provided in a word unit or a byte unit. EP-A-44005 discloses an image data compression apparatus comprising a combination of means (11) for performing run length coding of printer data and means (11) for predicting values of printer data. According to EP-A-434005 at first the run lengths a-e of pixels of the same grey level are generated, values predicted from a head most run are associated to the generated run length in a predetermined order whereby in the event of non coincidence with the actual value "0" is output and in the event of coincidence the run length data are output (Fig.4). IBM Technical Disclosure Bulletin Volume 23, No 12, P5468 to 5470 discloses an image compression method comprising a first step of comparing data in adjacent scans, a second step of generating the run length of the comparison data and a step of associated codes to the run length the symbol length being in accordance to the probabilities of the run length. In general, coding by run length is performed in accordance with run length of black and white data. However, it is required to analyze the data to determine what code allocation is appropriate prior to the coding (in fact, the MH coding method is an international standard of the coding to efficiently compress data when a run length coding is allotted to the image data of a standard original). To obtain an average information amount in a group of run length, it is appropriate to obtain the entropy of the image information of the data group. For example, if the probability where a run length is k is P k , the entropy as an information source of a single run length can be expressed as follows: wherein "L" is the number of groups of run length. The equation (1) indicates a theoretical limitation of the average number of bits which is required for a binary expression of a single run length. Since the actual number of bits is an integral number, it would be larger than H run . Fig 4 is a chart showing an example where the frequency of appearance of white run and black run in approximately 8000 character patterns. The chart particularly shows the run lengths of white data and black data of the font data whose maximum run length is 48 × 48 bits (2304 bits), the frequency of appearance of each run length, and an average run length. From the data, the entropy of black data Hblack is 3.18, while that of white data H white is 4.64. For example, when the average length 5.83 of black data is coded by the binary system, 3.18 bits is required from H black . This means that a black dot can be expressed by 3.18/5.83 (bits). However, this is only the case for a black dot. If it is assumed that the entropy in a dot is H pel: Hpel = (black entropy + white entropy) (white average length + black average length) This value is regarded as a theoretical compression rate. In this embodiment, H pel is 0.4238 and the data occupies 42.38% of the information amount of original image data. However, since a code is expressed in an integral number, and an identifier is needed for expressing black/white data, the actual value is larger than 0.4238. Thus, when the run length method is used, the font data can be reduced at the theoretical compression rate 42.38. However, when an error between an address table to refer the font data and the actual value is considered (since a decimal expression is impossible in the number of bits), the actual compression rate becomes approximately 45.0%. For example, when three character fonts (mincho-tai, gothic- tai , and mouhitsu-tai ) of the Japanese writing system are internally stored in a printing system, without compressing it, approximately 8M bytes (48 × 48 bits per character) is required for a memory capacity. On the other hand, if the run length coding is performed on the data, only 8M × 0.45 = 3.60M (bytes) is required. However, there still remains a problem in the cost. In a case where the header indicating a presence of black data is added to the above-described font data shown in Fig. 3, the compression rate is approximately 84.0% when the header is added on column-by-column basis, 81.6% on word-by-word basis, and 76.5% on byte-by-byte basis. This is because, in the actual font data, the font data of white dots is less present, while the character font where black dots are scattered is much present. SUMMARY OF THE INVENTION An embodiment of the present invention seeks to provide a data compression method and apparatus capable of compressing image data by increasing a compression rate by applying a run length method. An embodiment of the present invention seeks to provide a data expansion method and apparatus capable of expanding compressed image data. An embodiment of the present invention seeks to provide a data compression method and apparatus capable of storing a large amount of image data in a small memory capacity. An embodiment of the present invention also seeks to provide a data compression method and apparatus capable of increasing a compression rate of image data by increasing white data or black data portion in an image data, and then performing run length coding. An embodiment of the present invention seeks to provide a printing apparatus capable of reducing the amount of image data stored in a memory by compressing and storing input image data, expanding the compressed image data, and developing the data to a character pattern to print out. An embodiment of the present invention also seeks to provide a printing apparatus capable of storing compressed character font data, and developing it to a character pattern to print out. An embodiment of the present invention also seeks to provide a printing apparatus capable of storing a large amount of font data in a small memory capacity by storing character font data at high compression rate as font data, and expanding the character font to print out. Methods and apparatus according to the invention are defined in claims 1, 4, 7, 8, 9, 12, 13, 16, 18 and 19. Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are incorporated 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. Fig. 1 is a block diagram illustrating the construction of the control circuit of an ink-jet printer as an example of the present invention; Fig. 2 is a diagram illustrating an example of the font data of an alphabetical character "B"; Fig. 3 is a diagram illustrating an example of the font data comprised of 20 × 20 dot matrix; Fig. 4 is a chart of the frequency of appearance of black run and white run in approximately 8000 character patterns in a single font; Fig. 5 is a diagram showing the transition probability from an object dot to a neighboring dot; Fig. 6 is a diagram for describing the method of converting the original font data with reference to the conversion sample in one field Markov; Figs. 7A-7J are diagrams to explain the method of converting an object dot to white data when the probability is over 50% (pattern of high frequency) with considering the combination of an object dot and a left dot, an upper dot, and left upper dot of the object dot; Fig. 8 is a diagram to explain the processing method such that subject image data is applied by a predictive function in each bit; Fig. 9A is a diagram illustrating an example of character pattern data of a character "H" of 36 × 48 dots; Fig. 9B is a diagram illustrating an example where the pattern data of Fig. 9A is processed by using the predictive function; Fig. 10 is a chart showing an example of determining a run length based on Wyle coding and the length of operand and encoded data. Fig. 11 is a block diagram illustrating the compression circuit of the font data in the embodiment; Fig. 12 is a chart showing the result when the theoretical compression rate is obtained with respect to the image data after the predictive function processing; Fig. 13 is a flowchart illustrating the processing that image data is compressed and stored in the ink-jet printer; and Fig. 14 is a flowchart illustrating the printing processing by decoding the compressed image data. DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will now be described in detail in accordance with the accompanying drawings. The present invention can be applied to a system constituted by a plurality of devices, or to an apparatus comprising a single device. Furthermore, the invention is applicable also to a case where the object of the invention is attained by supplying a program to a system or apparatus. The present embodiment is described below. To further decrease the theoretical compression rate H pel in the equation (2), the denominator can be increased. Accordingly, when the frequency of continuous appearance of white dot or black dot is increased, the average length increases and the denominator also increases. In case of font data, since white dot occupies 90% of a character image, the ratio of the white dot can be increased. Since if the average length of the white dot increases, the entropy decreases along with the increase, the denominator of H pel increases, whereas the numerator decreases, thus the compression rate is improved. In this embodiment, a black data portion is reduced with respect to the original image data, and the run length coding is performed on the data in which the number of the black dots is decreased. Accordingly, the data compression rate can be improved. If a type of font data is of interest, when a two-dimensional coding is performed on n dots, combinations can be 2 n+1 . This relationship is referred to as n-ply Markov information source. Since this is not a realistic situation, the neighboring dots with respect to a single dot are also considered. In case of the font data in particular, since a changing point from a black dot to a white dot and verse visa is few, the white dot portion can be increased by expressing the changing point in a black dot. Accordingly, data useful for the run length compression can be formed by increasing the number of white dots. For example, the correlation of neighboring dots with respect to a single dot is considered. Fig. 5 is a conceptual diagram illustrating an example of transition probability from an object dot to a neighboring dot. As shown in Fig. 5, the transition probability from white to white (95%) and the probability from black to black (85%) are extremely high, whereas the transition probability from white to black (3%) and the transition probability from black to white (10%) are low. Accordingly, a value (in a binary system) of the neighboring dot with respect to a single dot can be predicted by the probability. With reference to Fig. 6, the method of converting original font data with reference to the one field Markov is described. As shown in Fig. 6, each dot of the source data (original data) 601 is sequentially scanned from the left to the right. It is assumed that the data outside of the left most data is white data. Accordingly, the transition to the left most dot 620 is white to white. This combination is the same as that indicated by numeral 610. Since the transition probability from white to white is high (95%), the left most dot 620 is converted to white data and the result is indicated by numeral 621. Next, since the adjacent dot is white and the transition probability is high, the adjacent dot is converted to white. When a black dot 622 appears in the source data 601, the transition from white to black occurs. Since the probability of this transition is low (3%), the data is first converted to black data (623). The transition of the source data following the dot 622 is continuously black to black. Since the probability of this transition is high, each dot of the source data is converted to white data. When a white data 624 is detected, the transition from black to white occurs. Since the probability of this transition is low (10%), the dot 624 is converted to a black dot 625. The source data 601 is converted to the conversion data 630 by repeating the above processing. Thus, the black dot portion is reduced. However, if a neighboring dot in the horizontal direction with respect to a signal dot is of interest, the correlation is effective only in the scanning direction, whereas the correlation in the vertical direction is not effective. The method considering the correlation in the vertical direction is shown in Fig. 7A. According to this method, the combinations of an object dot and the left dot, upper dot, and upper left dot are considered respectively, and when the probability where the object dot appears in actual image data is over 50%, the object dot is converted to white data. The combination of four dots is 16 patterns. Each of the probability of the eight patterns shown in Figs. 7C-7J out of the 16 patterns is over 50% (pattern of high frequency) (this combination can be variable in accordance with the kind of an object image data). In a dot matrix expressed by A, B, C and D in Fig. 7B, if the case where the object dot D becomes black (=1) is expressed: Func(A, B, C, D) = (/A&B) or (/A&C) or (B&C) wherein "/A" indicates "not A" and "&" indicates a logical product (Logical AND). The equation (3) is referred to as a "predictive function". As shown in Fig. 8, with this predictive function, the dot matrix 800 is applied to each bit of the image data. It should be noted that a portion indicated by "D" of the dot matrix 800 is an object dot, and the font data is scanned vertically (in the column direction) in this embodiment, however, it can be scanned horizontally (in the row direction). Fig. 9A is a diagram illustrating the case where the font data of a character "H" of 36 × 48 dots is processed by using the predictive function. In Fig. 9A, when the dot matrix 800 is moved to the position indicated by numeral 801, since the patterns of black and white does not coincide with any patterns in Figs. 7C-7J, the object dot 910 becomes black. When the dot matrix 800 is subsequently moved in the column direction, the pattern is coincided with Fig. 7E. Accordingly, each of the following dots becomes white, that is, "0". When the dot matrix 800 is moved to the position indicated by numeral 911 in Fig. 9A, the pattern does not coincide with any patterns in Figs. 7C-7J where only the upper right dot becomes black. Thus, the dot 911 becomes black. Furthermore, when the dot matrix 800 is moved to the position 803 of Fig. 9A, the pattern is not coincided with any of patterns in Figs. 7C-7J where only the lower left dot becomes black. Thus, the dot 912 becomes black. Since the patterns of each object dot are respectively coincided with the pattern of Fig. 7H until the position indicated by numeral 804, the object dots become all white. In the position 804, since only upper right dot becomes black, the object dot 913 becomes black. In this way, the character pattern of Fig. 9A is converted based on the predictive function and the result is shown in Fig. 9B. As apparent from Fig. 9B, in the matrix data 901 where the predictive function is applied, the number of black dots is reduced. In the case where the run length coding is applied after the number of black dots becomes very few, if the run length coding is performed on the black data, the amount of information increases. Therefore, the run length coding is performed on white data by applying the modified Wyle coding. In order to code white data, as shown in Fig. 10, a run length code and the run length of a operand portion and data portion are determined based on the Wyle coding. That is, a code length of the group of data whose frequency of being white data is high is reduced, whereas the frequency is low is made longer, thus increasing the compression efficiency. Furthermore, in the black data coding, the number of black data groups is expressed in a form of operand used in the white data coding. That is, the number of continuation of black data is expressed by the number of "0". Since the black data and white data appear alternatively, a special identifier is not required. However, at the head of a single data group (e.g. a single font), one-bit identifier is provided. Fig. 11 is a block diagram illustrating the construction of the coding circuit which performs coding of the embodiment. This coding circuit can be independently used or it can be mounted in an ink-jet printer of Fig. 1 (to be described later) to code image data and character pattern data transmitted from an external unit (data transmitter 106) and store in RAM 102. In Fig. 11, numeral 120 is a predictive function circuit which forms matrix data, shown in Fig. 9B, where the number of white dots of the character pattern data is increased. Numeral 121 is a run length coding circuit which further encodes the data processed in the predictive function circuit 120. Numeral 122 is a black/white determination unit which determines if dot data is black or white. The black/white determination unit 122 outputs white data to a white data length counter 123, whereas black data to a black data length counter 125. The determination unit 122 further determines where the leading edge of the font data is black or white, and adds an identifier in accordance with the determination. Numeral 124 is a white data coding unit which forms coding data composed of a data portion and an operand portion as shown in Fig. 10 in accordance with the white data length counted by a white data length counter 123. Similarly, numeral 126 is a black data coding unit in which the number of continuation of black data is expressed by the number of series of "0" in accordance with the black data length counted by a black data length counter 125. For example, in the example of Fig. 9B, when the coding is performed in the scanning direction of Fig. 8, since the white data is continued for 243 dots, it is coded as "0010101000000000", and the next black data (dot 910) is coded to as "1". Then, since the white data is continued for 35 dots, it is coded to as "00101000", and the next black data (dot 911) is to as "1". Subsequently, the white data continued for 203 dots is expressed as "100000100000000". Then, the dot 912 is coded to as "1". Similarly, the coding is performed and the pattern of Fig. 9B is subject to the run length coding. In this embodiment, the number of the white data is increased, however, this does not impose a limitation upon the invention, for the number of black data can be increased. In this case, during the run length coding, the black data portion can be coded in the data portion and operand portion in the similar way to white data, and the white data is coded in the similar way to the above-described black data. Fig. 12 is a chart showing the result where a logical compression rate is obtained with respect to the image data after the predictive function processing by using the above approach. It is known that the entropy per dot is decreased from 0.4238 to 0.3064. This means that the logical compression rate is improved from approximately 42.38% to 30.63%. Particularly, the maximum the black data length is "8" and the entropy is extremely decreased. As a result of an actual sample font, the compression rate (including the header portion and the like) becomes approximately 33.0%. Thus, the amount of the font data is reduced from 8M bytes to 2.65M bytes. Accordingly, the problem in the conventional approach is solved by combining the predictive function processing and the run length method, and the objective data compression rate can be attained. Fig. 1 is a block diagram mainly illustrating the construction of an ink-jet printer. As an apparatus accommodating the font data, a communication apparatus such as a display and facsimile apparatus, a work station, and various computers as well as the ink-jet printer of the present embodiment. In Fig. 1, numeral 100 is a CPU which controls the operation of the printer and various processings. Numeral 101 is a ROM which stores the control programs executed by the CPU and various data such as compressed font data. Numeral 102 is a RAM having a work area used for various calculations during execution of the control processing by the CPU 100. Numeral 103 is a head driver and recording head which inputs a control signal supplied from the CPU 100 and performs recording on a recording medium in accordance with the signal. Numeral 104 is a paper-feeding-motor driver for transferring a recording medium and a paper-feeding motor. Numeral 105 is a carriage having a recording head and a carriage motor for scanning-driving the carriage. Numerals 107-115 are data expansion circuits which form original font data by performing a reverse prediction by an inverse algorithm to the data formed by the prediction function after the run length data expansion is performed. The detailed operations of those circuits are described later. The operation of the ink-jet printer of the embodiment is described. As described earlier, after the predictive function processing, the font data is subject to the run length coding and the coded font data is stored in the ROM 101. In general, a printer and word processor store character data font such as kanji in mincho-tai, gothic-tai, and mouhitsu-tai or alphabetical font data. The data amount of the compressed font data is approximately 33% of the original amount 8M bytes, that is, approximately 2.64M bytes. Based on the character code in a form of various command states and data transferred from the data transfer unit 106, the font data stored in the ROM 101 is analyzed by the CPU 100 in accordance with the program similarly stored in the ROM 101. The analyzed font data is transferred to the data expansion circuits 107-115. Thus, the expansion processing in each font is executed. The processing is described below. In the header discriminating unit 107, the above-described identifier discriminates whether the leading data of the font data is black data or white data. Since the black data and white data of the font data appear alternatively, the data is outputted to the black data counter 114 and the next data of the black data is outputted to the white data operand counter 108 and the data portion counter 112. If the leading bit is white data, the control is performed on the white data operand counter 108 and the data portion counter 112. The white data operand counter 108 counts the length of the white data operand portion shown in Fig. 10, and the operand length is determined in accordance with the value in the operand length setting unit 109. By the value of the operand portion, the range of the number of continuation of white data is determined so as to be 1-8 or 9-16 (bits). For example, with reference to Fig. 10, when the operand portion is "1000", the range of the number of continuation of white data is 38-48 (dots). The data portion counter 112 performs the control on the data length setting unit 113 by obtaining a value of the data portion and sets the data length. As shown in Fig. 10, the data portion is set to be 3 to 8 bits. For example, when the value of the operand portion is "1000", the data portion is 4 bits. Since 16 combinations is possible by 4 bits (including "0000"), a value between "33" and "48" can be determined from the 4 bits and the data expression capable range determined by the operand portion. For example, when the operand portion is "1000" and the data portion is "0110", 33 + "0110", that is, 33 + 6 = 39. From this expression, it can be known that the white data is continued for 39 dots. This adding processing is performed in the adder 110. Thus, the number of the white data dots is obtained. This is inputted into the data formation unit 111 and the white data is developed. After the white data is developed, if the data processing for one block (e.g., a single font data) has not ended, it means that the next is black data and the black data is outputted to the black data counter 114. The coding data expresses the continuing white data for the number in which one is subtracted from the number of continuing white data, and the end of the continuing white data is marked by an appearance of black data. For example, when the black dots are continued for 4 dots, since it means that (4-1) black dots are continued after a black dot, it can be expressed by "0001". The above processing is performed on one-block data and if it is judged that the block is the last block, since the font data whose white data is increased, as indicated by numeral 901 in Fig. 9B, is reproduced, the control is performed on the inverse predictive function circuit 115. Here, the data expressed by the run length development, that is, the data which is subject to the predictive function is converted via a reverse processing of the predictive function, that is, the inverse predictive function circuit 115, and original data (e.g., the pattern of Fig. 9A) which is the data before the compression processing can be obtained. By the above processing, the compressed image data (font data) inputted from the data transfer unit 106 can be expanded. Taking an example of the operation of the inverse predictive function circuit 115 of Fig. 9B, when the dot matrix 810 comes to the position indicated by numeral 810, since the dot 910 is black, the object dot becomes black. When the dot matrix is moved for one dot in the scanning direction, the object dot position is "0", the data arrangement is coincided with the pattern of Fig. 7E, and the following dots are converted to black. Similarly, the dot 910 through the dot before the dot 911 are converted to black. When the matrix comes to the position indicated by numeral 811, the object dot 911 is black, the data arrangement does not coincide with the pattern of Fig. 7E, and the object dot 911 is converted to a white dot. In this way, the pattern of Fig. 9B is converted to the pattern of Fig. 9A. In the above embodiment, the image data expansion and compression processings are performed by using the dedicated circuit (e.g., gate alley) other than CPU. However, it can be arranged so that a software which executes data expansion and data coding is programmed and stored in the ROM 101 of Fig. 1, and data compression and data coding are performed by using this program. For example, when the image development command is outputted from the data transfer unit 106, the CPU 101 interprets the program in the ROM 101, and expands and develops object image data to the RAM 102. Accordingly, the cost for constructing the dedicated circuit is cut sharply. Furthermore, in the inverse predictive function processing and the run length expansion processing, in the case of software processing, since it takes more time for the run length expansion processing on the average, only the run length expansion circuit can be provided. Furthermore, it can be arranged that the run length expansion circuit and the inverse predictive function circuit are provided not in the ink-jet printer of the embodiment, but in a form of an external slot or an IC card, in accordance with the purpose of a user. For example, if a user uses font data such as alphabetical characters and numerals which do not require much time for a font expansion processing, the pattern development processing can be performed with the internal software without using the external slot or IC card. Furthermore, either in an electric circuit or a software, an algorithm of a compression or predictive function is internally stored in a recording apparatus, and the image data inputted from outside (e.g., a host computer) is compressed, (expanded if needed,) converted, and printed or displayed on a screen. For example, as a page printer, in a control apparatus which develops image data for one page, the amount of information to be stored can be increased by compressing the input image data, and the merit of the cost down is increased. Fig. 13 is a flowchart illustrating the processing to store the coded image data in the ink-jet printer of the embodiment. The control program which executes this processing is stored in the ROM 101. At step S1, binary data transferred from the data transfer unit 106 is received, and stored in the RAM 102 at step S2. This image data can be character pattern data. At step S3, by using the above-described predictive function, this image data can be converted so that the number of the white data is increased, and the converted data is subject to the run length coding at step S4. The data compressed in this way is stored in the RAM 102. In the case where the image data is a character pattern, the character code inputted from the data transfer unit 106 is subject to the pattern development, the compressed data is referred and the character code is developed to a pattern. Fig. 14 is a flowchart illustrating the processing such that the compressed image data (a character pattern) stored in the RAM 102 is read out, expanded and printed. The control program which executes the processing is stored in the ROM 101. When printing out the image data stored in the RAM 102 is instructed, the process proceeds to step S10 where the compressed image data is read out, and at step S11, the run length decoding is performed. At step S12, the decoded pattern data is reproduced to the original image data by using the inverse predictive function. In this way, the processing in steps S11 and S12 can be executed by the circuit shown in Fig. 1. Subsequently, the process proceeds to step S13 where the reproduced image data is outputted to the head driver/recording head 103 to print it out. Furthermore, when the character patterns are compressed and stored in the RAM 102, the compressed character pattern corresponding to a character code inputted from the data transfer unit 106 at step S10 is read out and decoded. As described above, according to the present embodiment, the amount of font data is reduced and the cost of the apparatus including the font data can be cut sharply. Furthermore, the image data inputted from outside can be compressed by storing the compression algorithm internally, thus more image data can be stored. The invention is particularly advantageous since the compression rate of the image data is increased by applying the run length method. Furthermore, the image data compressed in the above-described way can be expanded.

Claims: A data compression method for compressing binary image data comprising: a first step of sequentially processing the image data comprising dots of two levels by applying to each object dot a predictive function expressed by a dot matrix (801-804) formed of the object dot (910-913) and neighbouring dots, and converting the object dot into a dot of a predetermined one of the levels in a case where the two level image data coincide with the predictive function; and a second step of performing run length coding on the two-level image data converted by said first step. The data compression method according to claim 1, said dot matrix is a 2 x 2 dot matrix including an object dot, and said predictive function is a function to predict the state of the object dot in accordance with a state of the other three dots. The data compression method according to claim 1, said predictive function is formulated based on the patterns of high frequency. An image data compression apparatus comprising a combination of means for performing run length coding of printer data and means for predicting values of printer data the data compression apparatus characterised by means for sequentially processing the image data comprising dots of two levels by applying to each object dot a predictive function expressed by a dot matrix (801-804) formed of the object dot (910-913) and neighbouring dots, and converting the object dot into a dot of a predetermined one of the levels in a case where the two level image data coincide with the predictive function; and means for performing run length coding on the two-level image data converted by said dot conversion means. The data compression apparatus according to claim 4, said dot matrix is a 2 x 2 dot matrix including an object dot, and said predictive function is a function to predict the state of the object dot in accordance with a state of the other three dots. The data compression apparatus according to claim 4, said predictive function is formulated based on the patterns of high frequency. A data expansion method comprising: an expansion step of expanding image data compressed by the method defined in claim 1 based on the run length coding; and a reproduction step of reproducing image data expanded by said expansion step to form original image data by an inverse predictive function. A data expansion apparatus comprising: storage means for storing image data compressed by the method defined in claim 1; expansion means for expanding the compressed image data stored in said storage means in accordance with the run length coding; and reproduction means for reproducing image data expanded by said expansion means by an inverse predictive function. A printing device comprising an image data compression apparatus according to claim 4, claim 5 or claim 6. A printing device according to claim 9, and further comprising storage means for storing compressed character font data; pattern developing means for reading and expanding the character font data stored in said storage means and developing the character font data to be character pattern data; and printing means for printing based on the character pattern developed by said pattern developing means. The printing device according to claim 10, wherein said pattern developing means includes: decoding means for decoding a run length code; and inverse predictive function means for reproducing the pattern data decoded by said decoding means to be an original character pattern by using said predictive function. A printing device comprising: first storage means for inputting character pattern data from an external unit and storing the character pattern data in memory; image data compression apparatus according to claim 4, 5 or 6 for compressing the character pattern data; second storage means for storing the character font data compressed by said image data compression apparatus; pattern developing means for reading and expanding the character font data stored in second storage means, and developing the character font data to be character pattern data; and printing means for performing printing based on the character pattern developed by said pattern developing means. A data encoding method, characterised by comprising the steps of: determining whether or not a pattern data matches a predetermined predicted data, wherein said pattern data is a binary font data, composed of black and white pixels, for use in a printer; and converting a series of pattern data into a series of converted pattern data based upon a determination result in said determining step to increase a number of white pixels of the binary font data; wherein the pattern data is converted to a first value in a case where the pattern data matches the predetermined predicted data, and the pattern data is converted to a second value being different from the first value in a case where the pattern data does not match the predetermined predicted data. A method according to claim 13 in which the series of converted first and second values are compressed using run length coding. A method according to claim 13 or claim 14 further comprising the step of storing the compressed converted values. Data encoding apparatus, characterised by comprising: determination means for determining whether or not a pattern data matches a predetermined predicted data, said pattern data is a binary font data used in a printer; and conversion means for converting a series of pattern data into a series of converted pattern data to increase a number of white pixels of the binary font data, based upon a determination result by said determination result, wherein the converting means is adapted to convert the pattern data to a first value in a case where the pattern data matches the predetermined predicted data and to convert the pattern data to a second value being different from the first value in a case where the pattern data does not match the predetermined predicted data. Apparatus according to claim 16 including means to compress the series of first and second converted values using run length coding. A data decoding method, characterised by comprising the steps of: determining whether a pattern data has a first value or a second value, said pattern data having been encoded by a data encoding method according to claim 13; and converting a series of pattern data into a series of converted pattern data based upon a determination result in said determining step, wherein the pattern data is converted to a predetermined predicted data in a case where the pattern data matches the first value and the pattern data is converted to a value other than the predetermined predicted data in a case where the pattern data does not match the second value. A data decoding apparatus, characterised by comprising: determination means for determining whether a pattern data has a first value or a second value said pattern data having been encoded by a data encoding apparatus according to claim 16; and conversion means for converting a series of pattern data into a series of converted pattern data based upon a determination result by said determination means, wherein the conversion means is adapted to convert the pattern data to a predetermined predicted data in a case where the pattern data matches the first value, and to convert the pattern data to data other than the predetermined predicted data in a case where the pattern data does not match the second value. A method according to any one claims 13 to 15 and 18, in which the data is font data for a printer. Apparatus according to any one of claims 16, 17 or 19 in which the data is font data for a printer. A carrier medium carrying processor-implementable instructions for controlling a processor to carry out the method according to any one of claims 1 to 3, 7, 13 to 15, 18 or 20.

Inventors: AICHI TAKAO, AICHI, TAKAO, AICHI, TAKAO, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1993
Main classification: G06K15
IPC codes: H03M7, G06T9, H04N1, G06K15