Patent ID: 8023756

Claim:
An image encoding apparatus for encoding image data, comprising: an input unit for inputting image data; an extraction unit for extracting color of a pixel, which constitutes a high-frequency component, from the input image data as an extracted color; a generating unit for generating identification information for identifying whether each pixel of the image data is a pixel of the extracted color or a pixel of a non-extracted color; a first encoding unit for lossless encoding of the identification information generated by said generating unit; a replacing unit for calculating an average value of pixels of the non-extracted colors in the image data and replacing the value of the pixel of the extracted color with this calculated average value; a reducing unit for performing scanning in the image data, in which the replacement has been made by said replacing unit, using a window of interest having a size of p×q (where p, q are positive integers and at least one is equal to or greater than 2) pixels as a unit, and deriving one pixel value from the window of interest, thereby generating reduced-image data; a second encoding unit for performing lossy encoding of the reduced-image data generated by said reducing unit; and an output unit for concatenating the extracted color obtained by said extraction unit, the encoded data obtained by said first encoding unit and the encoded data obtained by said second encoding unit, and outputting the result as encoded data of the image data; wherein said reducing unit includes: a counting unit for counting number of pixels that have been determined to be of the non-extracted colors within the window based upon the identification information; and a selecting unit which, in a case where the value counted by said counting unit is zero, selects a replacement color, with which said replacing unit has replaced the pixel value within the window, as the value of one pixel after reduction, and in a case where the value counted by said counting unit is one or greater, selects an average value of pixels, which have been determined to be of the non-extracted colors within the window, as the value of one pixel after reduction.