# US 8,280,160 B2 · Image compressing method, image compressing apparatus and image forming apparatus

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,280,160 B2
- Document ID: US8280160B2
- Status: Granted
- Kind: B2
- Application number: 12/691,271
- Filed: 2010-01-21
- Published: 2010-07-22
- Granted: 2012-10-02
- Earliest claimed: 2009-01-22
- Assignees: Sharp Kabushiki Kaisha
- Inventors: Teruhiko Matsuoka
- Web page: https://patentgrep.com/patent/US8280160B2

## CPC

- H04N 1/56: Processing of colour picture signals (H04N1/52 takes precedence)
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

When N kinds of foreground identifiers for identifying color information of a foreground of a color image is to be reduced to M smaller than N, foreground identifiers corresponding to similar chromatic colors are merged and foreground identifiers corresponding to similar achromatic colors are merged but a foreground identifier corresponding to a chromatic color and a foreground identifier corresponding to an achromatic color are not merged. Thus, image quality degradation derived from color change from an achromatic color to a chromatic color or vice versa may be suppressed. On the basis of a foreground layer including the M kinds of foreground identifiers, M binary images respectively corresponding to the M kinds of foreground identifiers are generated, each of the binary images is subjected to lossless compression and a background layer is subjected to lossy compression.

## Claims

### Claim 1

An image compressing method for generating, from a foreground layer including N (wherein N is a natural number) kinds of foreground identifiers for identifying color information of respective pixels of a foreground corresponding to a text and/or a line art included in a color image consisting of a plurality of pixels, M (wherein M is a natural number satisfying M<N) binary images respectively corresponding to specific foreground identifiers and compressing the M binary images, comprising steps of:
reducing or retaining n1 (wherein n1 is an integer satisfying n1≧0) kinds of foreground identifiers for identifying color information of chromatic colors to m1 (wherein m1 is an integer satisfying 0≦m1≦n1); and
reducing or retaining n2 (wherein n2 is an integer satisfying n2≧0 and N=n1+n2) kinds of foreground identifiers for identifying color information of achromatic colors to m2 (wherein m2 is an integer satisfying 0≦m2≦n2 and m1+m2=M); and
further comprising the steps of:
generating a foreground mask representing the respective pixels of the foreground on the basis of the color image;
generating, on the basis of the generated foreground mask and the color image, a foreground layer in which color information of the respective pixels of the foreground is replaced with the N kinds of foreground identifiers for identifying color information of the foreground and color information of respective pixels of a background is replaced with a background identifier indicating that the pixels correspond to the background;
generating a table in which color information of the foreground, a foreground identifier for identifying the color information and a number of pixels having the foreground identifier out of all pixels included in the foreground layer are correlated and stored;
determining whether or not a number of kinds of foreground identifiers stored in the generated table is to be reduced to be smaller than N;
classifying the color information stored in the table into the color information of the chromatic colors and the color information of the achromatic colors when it is determined that the number of kinds of foreground identifiers is to be reduced;
determining, in order to retain or reduce the number n1 of kinds of foreground identifiers for identifying the color information classified as the chromatic colors and the number n2 of kinds of foreground identifiers for identifying the color information classified as the achromatic colors, the number m1 of kinds of foreground identifiers for identifying the color information of the chromatic colors to be attained and the number m2 of kinds of foreground identifiers for identifying the color information of the achromatic colors to be attained;
reducing a number of kinds of foreground identifiers stored in the table to M by retaining or reducing the numbers n1 and n2 of kinds of foreground identifiers for identifying the color information of the chromatic colors and the achromatic colors stored in the table to the numbers m1 and m2;
correcting the foreground layer to a foreground layer in which the number of kinds of foreground identifiers included therein has been reduced in accordance with a relationship between the foreground identifiers obtained before reducing the number of kinds thereof and the foreground identifiers attained after reducing the number of kinds thereof;
generating, on the basis of the corrected foreground layer, the M binary images each of which is obtained by binarizing a pixel value of one kind of foreground identifier and pixel values of the other kinds of foreground identifiers, correspondingly to the M kinds of foreground identifiers;
performing lossless compression on the generated M binary images;
generating a background layer on the basis of the foreground layer and the color image; and
performing lossy compression on the generated background layer.

### Claim 2

An image compressing apparatus for compressing a color image consisting of a plurality of pixels, comprising:
a foreground mask generating unit that generates, on the basis of the color image, a foreground mask representing respective pixels of a foreground corresponding to a text and/or a line art included in the color image;
a foreground layer generating unit that generates, on the basis of the foreground mask generated by the foreground mask generating unit and the color image, a foreground layer in which color information of the respective pixels of the foreground is replaced with N (wherein N is a natural number) kinds of foreground identifiers for identifying the color information of the foreground and color information of respective pixels of a background is replaced with a background identifier indicating that the pixels correspond to the background;
a table generating unit that generates a table in which color information of the foreground, a foreground identifier for identifying the color information and a number of pixels having the foreground identifier out of all the pixels included in the foreground layer generated by the foreground layer generating unit are correlated and stored;
a reduction determining unit that determines whether or not a number of kinds of foreground identifiers stored in the table generated by the table generating unit is to be reduced to be smaller than N;
a chromatic/achromatic color classifying unit that classifies the color information stored in the table into color information of chromatic colors and color information of achromatic colors when the reduction determining unit determines that the number of kinds of foreground identifiers is to be reduced;
a number determining unit that determines, in order to retain or reduce a number n1 of kinds of foreground identifiers for identifying the color information classified as the chromatic colors by the chromatic/achromatic color classifying unit and a number n2 of kinds of foreground identifiers for identifying the color information classified as the achromatic colors by the chromatic/achromatic color classifying unit (wherein n1 and n2 are integers satisfying n1≧0, n2≧0 and N=n1+n2), a number m1 of kinds of foreground identifiers for identifying the color information of the chromatic colors to be attained and a number m2 of kinds of foreground identifiers for identifying the color information of the achromatic colors to be attained (wherein m1 and m2 are integers satisfying 0≦m1≦n1, 0≦m2≦n2 and 0<m1+m2<N);
a number reducing unit that reduces the number of kinds of foreground identifiers stored in the table to M (wherein M is a natural number satisfying M=m1+m2) by retaining or reducing the numbers n1 and n2 of kinds of foreground identifiers for identifying the color information of the chromatic colors and the achromatic colors stored in the table to the numbers m1 and m2 determined by the number determining unit;
a foreground layer correcting unit that corrects the foreground layer generated by the foreground layer generating unit to a foreground layer including foreground identifiers having been reduced in number by the number reducing unit;
a binary image generating unit that generates, on the basis of the foreground layer corrected by the foreground layer correcting unit, M binary images each of which is obtained by binarizing a pixel value of one kind of foreground identifier and pixel values of the other kinds of foreground identifiers, correspondingly to the M kinds of foreground identifiers;
a binary image compressing unit that performs lossless compression on the M binary images generated by the binary image generating unit;
a background generating unit that generates a background layer on the basis of the foreground layer corrected by the foreground layer correcting unit or the foreground mask generated by the foreground mask generating unit and the color image; and
a background image compressing unit that performs lossy compression on the background layer generated by the background generating unit.

### Claim 3 (depends on 2)

The image compressing apparatus according to claim 2,
wherein when n1≧3 and n1>m1≧2, the number reducing unit includes:
a color difference calculating unit that calculates, on the basis of the color information correlated to the foreground identifiers corresponding to the chromatic colors stored in the table generated by the table generating unit, a color difference between colors expressed by every combination of color information;
a chromatic color combining unit that calculates a combination of foreground identifiers having a smallest color difference obtained by the color difference calculating unit; and
a chromatic color merging unit that compares numbers of pixels having the combination of foreground identifiers obtained by the chromatic color combining unit by referring to the table, and that merges one of the foreground identifiers into the other foreground identifier when the numbers of pixels are the same and merges one of the foreground identifiers corresponding to a smaller number of pixels into the other foreground identifier corresponding to a larger number of pixels when the numbers of pixels are different,
calculation by the chromatic color combining unit and mergence by the chromatic color merging unit are repeatedly executed with a foreground identifier invalidated through the mergence removed until a number of kinds of foreground identifiers corresponding to the chromatic colors becomes equal to the number m1 as a result of the mergence by the chromatic color merging unit, and
the foreground layer correcting unit replaces the foreground identifiers obtained before the mergence and included in the foreground layer generated by the foreground layer generating unit with foreground identifiers attained through the mergence in accordance with a relationship between the n1 kinds of foreground identifiers obtained before reducing the number by the number reducing unit and the m1 kinds of foreground identifiers attained after reducing the number by the number reducing unit.

### Claim 4 (depends on 3)

The image compressing apparatus according to claim 3,
wherein the number reducing unit further includes a chromatic color coefficient calculating unit that obtains a coefficient in accordance with luminosity of a color expressed by color information correlated to each of the foreground identifiers corresponding to the chromatic colors, and
the color difference calculating unit calculates a color difference by multiplying an actual color difference between the colors by the coefficient obtained by the chromatic color coefficient calculating unit.

### Claim 5 (depends on 2)

The image compressing apparatus according to claim 2,
wherein when n2≧3 and n2>m2≧2, the number reducing unit includes:
a luminance difference calculating unit that calculates, on the basis of the color information correlated to the foreground identifiers corresponding to the achromatic colors stored in the table generated by the table generating unit, a luminance difference between colors expressed by every combination of color information;
an achromatic color combining unit that calculates a combination of foreground identifiers having a smallest luminance difference obtained by the luminance difference calculating unit; and
an achromatic color merging unit that compares numbers of pixels having the combination of foreground identifiers obtained by the achromatic color combining unit by referring to the table, and that merges one of the foreground identifiers into the other foreground identifier when the numbers of pixels are the same and merges one of the foreground identifiers corresponding to a smaller number of pixels into the other foreground identifier corresponding to a larger number of pixels when the numbers of pixels are different,
calculation by the achromatic color combining unit and mergence by the achromatic color merging unit are repeatedly executed with a foreground identifier invalidated through the mergence removed until a number of kinds of foreground identifiers corresponding to the achromatic colors becomes equal to the number m2 as a result of the mergence by the achromatic color merging unit, and
the foreground layer correcting unit replaces the foreground identifiers obtained before the mergence and included in the foreground layer generated by the foreground layer generating unit with foreground identifiers attained through the mergence in accordance with a relationship between the n2 kinds of foreground identifiers obtained before reducing the number by the number reducing unit and the m2 kinds of foreground identifiers attained after reducing the number by the number reducing unit.

### Claim 6 (depends on 5)

The image compressing apparatus according to claim 5,
wherein the number reducing unit further includes an achromatic color coefficient calculating unit that obtains a coefficient in accordance with luminosity of a color expressed by color information correlated to each of the foreground identifiers corresponding to the achromatic colors, and
the luminance difference calculating unit calculates a luminance difference by multiplying an actual luminance difference between the colors by the coefficient obtained by the achromatic color coefficient calculating unit.

### Claim 7 (depends on 2)

The image compressing apparatus according to claim 2,
wherein the reduction determining unit determines to reduce the number of kinds of foreground identifiers to be smaller than N when N is larger than a predetermined number P (wherein P is a natural number).

### Claim 8 (depends on 7)

The image compressing apparatus according to claim 7,
wherein P=M, and
the number determining unit determines the numbers m1 and m2 in such a manner that a ratio of the number n1 to N and a ratio of the number m1 to M substantially accord with each other and that a ratio of the number n2 to N and a ratio of the number m2 to M substantially accord with each other.

### Claim 9 (depends on 8)

The image compressing apparatus according to claim 8,
wherein the number determining unit performs a calculation of m1=M×n1/N for determining the number m1 with rounding up to the nearest whole number or performs a calculation of m2=M×n2/N for determining the number m2 with rounding up to the nearest whole number, for merging achromatic colors with priority to chromatic colors.

### Claim 10 (depends on 2)

The image compressing apparatus according to claim 2,
wherein the number determining unit includes:
a first comparing unit that compares the number n1 with a predetermined number Q1(wherein Q1 is a natural number satisfying 2≦Q1<M); and
a second comparing unit that compares the number n2 with a predetermined number Q2(wherein Q2 is a natural number satisfying 2≦Q2<M and Q1+Q2≦M), and
the numbers m1 and m2 are determined in such a manner as to attain m1≧Q1 when the first comparing unit obtains a comparison result of n1>Q1 and attain m1=n1 when the comparison result is n1≦Q1, and to attain m2≧Q2 when the second comparing unit obtains a comparison result of n2>Q2 and attain m2=n2 when the comparison result is n2≦Q2.

### Claim 11 (depends on 2)

An image forming apparatus, comprising:
the image compressing apparatus of claim 2; and
an image forming unit that forms an image on a recording sheet.

### Claim 12

A non-transitory recording medium in which a computer program for compressing a color image consisting of a plurality of pixels is recorded, the computer program comprising steps of:
causing a computer to generate, on the basis of the color image, a foreground mask representing respective pixels of a foreground corresponding to a text and/or a line art included in the color image;
causing the computer to generate, on the basis of the generated foreground mask and the color image, a foreground layer in which color information of the respective pixels of the foreground is replaced with N (wherein N is a natural number) kinds of foreground identifiers for identifying the color information of the foreground and color information of respective pixels of a background is replaced with a background identifier indicating that the pixels correspond to the background;
causing the computer to generate a table in which color information of the foreground, a foreground identifier for identifying the color information and a number of pixels having the foreground identifier out of all the pixels included in the generated foreground layer are correlated and stored;
causing the computer to determine whether or not a number of kinds of foreground identifiers stored in the generated table is to be reduced to be smaller than N;
causing the computer to classify the color information stored in the table into color information of chromatic colors and color information of achromatic colors when it is determined that the number of kinds of foreground identifiers is to be reduced;
causing the computer to determine, in order to retain or reduce a number n1 of kinds of foreground identifiers for identifying the color information classified as the chromatic colors and a number n2 of kinds of foreground identifiers for identifying the color information classified as the achromatic colors (wherein n1 and n2 are integers satisfying n1≧0, n2≧0 and N=n1+n2), a number m1 of kinds of foreground identifiers for identifying the color information of the chromatic colors to be attained and a number m2 of kinds of foreground identifiers for identifying the color information of the achromatic colors to be attained (wherein m1 and m2 are integers satisfying 0≧m1≦n1, 0≦m2≦n2 and 0<m1+m2<N);
causing the computer to reduce the number of kinds of foreground identifiers stored in the table to M (wherein M is a natural number satisfying M=m1+m2) by retaining or reducing the numbers n1 and n2 of kinds of foreground identifiers for identifying the color information of the chromatic colors and the achromatic colors stored in the table to the numbers m1 and m2 determined in the step of causing the computer to determine the numbers;
causing the computer to correct the generated foreground layer to a foreground layer including foreground identifiers having been reduced in number in accordance with a relationship between the foreground identifiers obtained before reducing the number thereof and foreground identifiers attained after reducing the number thereof;
causing the computer to generate, on the basis of the corrected foreground layer, M binary images each of which is obtained by binarizing a pixel value of one kind of foreground identifier and pixel values of the other kinds of foreground identifiers, correspondingly to the M kinds of foreground identifiers;
causing the computer to perform lossless compression on the generated M binary images;
causing the computer to generate a background layer on the basis of the corrected foreground layer and the color image; and
causing the computer to perform lossy compression on the generated background layer.
