Method and apparatus for encoding/decoding image in bitmap format using reduced number of bitmap indices

An apparatus and a method of encoding/decoding an image are provided. The method includes generating a bitmap table by mapping a quantized image, that is quantized according to a predetermined bit-depth, to a map table, and setting a bitmap index corresponding to each pixel location of the quantized image with reference to the bitmap table; setting a fixed filter index corresponding to an image of each pixel of the image by analyzing local characteristics of the image; generating bitmap data by adding the filter index to the bitmap index; extracting a bitmap index, a bitmap table, and a filter index from the bitmap data; extracting an encoded image mapped to the bitmap index from the bitmap table; and filtering the extracted encoded image based on a filter corresponding to the filter index.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application claims priority from Korean Patent Application No. 10-2008-0138724, filed on Dec. 31, 2008, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference in its entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Apparatuses and methods consistent with the present invention relate to improving image quality, and more particularly, to encoding/decoding a graphic image in a bitmap format in order to improve image quality.

2. Description of the Related Art

A bitmap is a bit-type standard graphic file format in Windows and is generally used to represent graphic images in mobile devices or personal computers (PCs).

Bitmap processing apparatuses use many bitmap indices to represent gradient levels for naturally displaying boundaries of a graphic image such as a font or an icon.

Thus, the bitmap processing apparatuses require a solution for reducing the number of bitmap indices used.

SUMMARY OF THE INVENTION

The present invention provides a method and apparatus for encoding/decoding an image in a bitmap format in order to improve image quality.

According to an aspect of the present invention, there is provided a method of encoding an image, the method including: quantizing the image according to a predetermined bit-depth; creating a bitmap table by mapping the quantized image to a map table, and setting a bitmap index corresponding to each pixel location of the image with reference to the bitmap table; setting a fixed filter index regarding an image of each pixel or block by analyzing local characteristics of the image; and creating bitmap data by adding the filter index to the bitmap index.

According to another aspect of the present invention, there is provided a method of decoding an image, the method including extracting a bitmap index, a bitmap table, and a filter index from bitmap data; extracting the image mapped to the bitmap index from the bitmap table; and filtering the extracted image using a filter corresponding to the filter index.

According to another aspect of the present invention, there is provided an apparatus for encoding an image, the apparatus including a bitmap data creator for creating a bitmap table by using an image quantized to a predetermined bit-depth, and setting a bitmap index corresponding to each pixel location of the bitmap table; a filter index creator for setting a fixed filter index regarding an image of each pixel or block by analyzing local image characteristics of the image; and a merging unit for merging the bitmap index created by the bitmap data creator and the filter index created by the filter index creator.

According to another aspect of the present invention, there is provided an apparatus for decoding an image, the apparatus including a bitmap data restorer for extracting a pixel value mapped to a bitmap table according to a bitmap index; and an adaptive filtering unit for filtering a current pixel and neighboring pixels, which are extracted by the bitmap data restorer, according to a filter corresponding to a filter index provided to the bitmap index.

DETAILED DESCRIPTION OF THE INVENTION

Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to accompanying drawings, wherein like numerals refer to like elements and repetitive descriptions will be avoided as necessary.

FIG. 1is a block diagram of an apparatus for encoding an image in a bitmap format, according to an exemplary embodiment of the present invention.

Referring toFIG. 1, the apparatus according to the current embodiment includes a bitmap data creator110and a filter index creator120.

The bitmap data creator110quantizes a graphic image such as icons or fonts to a fixed bit-depth, creates a bitmap table by mapping the quantized image to a lookup table, and creates a bitmap index corresponding to each pixel location of the quantized image with reference to the bitmap table.

The filter index creator120creates a pre-defined filter index regarding each pixel (or block) of the image by using local characteristics between a current pixel (or a current block) and neighboring pixels (or neighboring blocks). In this case, an encoder and a decoder pre-define a filter corresponding to a filter index.

A merging unit130merges the bitmap table/bitmap index created by the bitmap data creator110and the filter index created by the filter index creator120, pixel-by-pixel or block-by-block.

Ultimately, the apparatus according to the current exemplary embodiment creates bitmap data in which the filter index is added to the bitmap index.

FIG. 2Ais a block diagram of the bitmap data creator110illustrated inFIG. 1, according to an exemplary embodiment of the present invention.

Referring toFIG. 2A, the bitmap data creator110includes an image data storage210, a quantizer220, a bitmap index creator230, and a bitmap table creator240.

The image data storage210stores graphic image data such as icons or fonts in frames or fields. In this case, the graphic image data may be 2Nbits.

The quantizer220converts N-bit image data stored in the image data storage210into M-bit image data that is smaller than the N-bit image data, by using a quantization algorithm. For example, the quantizer220quantizes 224-bit true color data into 256 or 128 R, G, and B combinations. Here, the 256 or 128 R, G, and B combinations are applied to a color table.

The bitmap table creator240maps R, G, and B or Y, Cb, and Cr combinations quantized by the quantizer220to a map table, and creates a bitmap table.

The bitmap index creator230converts the R, G, and B combinations quantized by the quantizer220into an index located in the bitmap table.

The current exemplary embodiment is applicable to gray scale data as well as color data.

FIG. 2Bis a block diagram of the filter index creator120illustrated inFIG. 1, according to an exemplary embodiment of the present invention.

Referring toFIG. 2B, the filter index creator120includes an image data storage250, an arithmetic calculator260, and a filter selector270.

The image data storage250stores graphic image data such as icons or fonts in frames or fields.

The arithmetic calculator260analyzes local characteristics between a current pixel and neighboring pixels, which are stored in the image data storage250. For example, as illustrated inFIG. 2C, the arithmetic calculator260extracts a brightness difference, an average value, a variance value, a minimum/maximum value, etc., between a current pixel I and M×N neighboring pixels U, B, L, R, UL, UR, BL, and BR.

The filter selector270selects a pre-defined filter for each pixel or each block and indexes the selected filter, based on local characteristic parameters analyzed by the arithmetic calculator260. For example, the filter selector270selects a high-frequency pass filter if a difference between a current pixel value and neighboring pixel values is equal to or greater than a threshold value, and selects a low-frequency pass filter if the difference is lower than the threshold value. Also, a filter size and a filter coefficient are calculated based on the local characteristic parameters.

The pre-defined filter may include a low-pass filter, a high-pass filter, an average filter, a Gaussian filter, and a Laplacian filter.

FIG. 3is a block diagram of an apparatus for decoding an image in a bitmap format, according to an exemplary embodiment of the present invention.

Referring toFIG. 3, the apparatus according to the current embodiment includes a bitmap data restorer310, an image storage320, and an adaptive filtering unit330.

The bitmap data restorer310receives a bitmap table, sets bitmap table values in advance, and extracts local pixel values mapped to bitmap indices from the bitmap table.

The image storage320stores the local pixel values extracted by the bitmap data restorer310.

The adaptive filtering unit330selects a pre-defined filter based on a filter index regarding each pixel or each block and received from an encoding apparatus, and filters a current pixel and neighboring pixels, which are stored in the image storage320, by using the extracted filter.

For example, 5×5 pixels with reference to the current pixel are filtered from among pixels stored in the image storage320. If a region around the current pixel corresponds to a flat region, a low-pass filter is selected, according to a corresponding filter index. Then, the flat region is filtered to a medium gradation by low-pass filtering the current pixel and the neighboring pixels. Meanwhile, if the region around the current pixel corresponds to a boundary region, a high-pass filter is selected, according to a corresponding filter index. Then, the boundary region is filtered sharply by high-pass filtering the current pixel and the neighboring pixels.

Thus, the adaptive filtering unit330may display boundaries of a graphic image such as a font or an icon naturally on a screen by adaptively filtering image data bitmapped by the bitmap data restorer310.

The image data filtered by the adaptive filtering unit330is output to a display device such as a liquid crystal display (LCD) device.

FIG. 4is a block diagram of the bitmap data restorer310illustrated inFIG. 3, according to an exemplary embodiment of the present invention.

A bitmap table unit420stores images of R, G, and B or Y, Cb, and Cr channels, which are mapped to the addresses of the address decoder410, at 2Nlevels.

An output buffer430outputs pixel values stored in the bitmap table unit420according to the 2Naddresses. For example, an 8-bit image signal is output with respect to each of the R, G, and B or Y, Cb, and Cr channels.

FIG. 5is a diagram showing an exemplary merging operation which is performed by the merging unit130to merge bitmap index data and filter index data according to an exemplary embodiment of the present invention.

Referring toFIG. 5, newly defined 2-bit filter index data is added to original 6-bit bitmap index data. The bitmap index data and the filter index data are created pixel-by-pixel or block-by-block.

FIGS. 6A through 6Care graphs for describing a method of encoding/decoding an image in a bitmap format, according to an exemplary embodiment of the present invention.

FIG. 6Aillustrates original image data digitized on an image line of the x-axis.

Referring toFIG. 6A, the original image data is divided into a background region of a low-frequency and a font/icon region of a high-frequency.

FIG. 6Billustrates image data encoded into representative level values in a bitmap format.

In this case, the bitmap indices “1 1 1 2 2 2 3 3 3” correspond to the image data of the background region and the bitmap indices “2 5 5 2 5 2 5 3” correspond to the image data of the font/icon region.

FIG. 6Cillustrates image data adaptively filtered by adaptive filtering unit330according to filter indices.

Referring toFIG. 6C, the pixels of the background region are low-pass filtered by using a low-pass filter corresponding to the filter index values “0 0 0 0 0 0 0 0 0” and the pixels of the font/icon region are high-pass filtered by using a high-pass filter corresponding to the filter index values “1 1 1 1 1 1 1 1 1”.

Accordingly, the image data of the background region is filtered to a medium gradation and the image data of the font/icon region is filtered sharply. However, a related art image decoding apparatus merely restores image data based on the image data illustrated inFIG. 6B, and thus, the restored image data differs from original image data.

Ultimately, the adaptively filtered image data, as shown inFIG. 6C, is restored according to an exemplary embodiment of the present invention to be similar to the original image data illustrated inFIG. 6A.

FIG. 7is a flowchart of a method of encoding an image in a bitmap format, according to an exemplary embodiment of the present invention.

Referring toFIG. 7, initially, a graphic image such as a font or an icon is input through a graphic user interface (GUI).

Then, it is checked whether bitmap processing using a quantization algorithm is performed on the input image to a fixed bit-depth (operation710).

In this case, if the bitmap processing has not been performed on the input image, bitmap processing is performed in operations720,730and740. First, the input image is quantized to the fixed bit-depth (operation720).

Then, pixel types (e.g., R, G, and B or Y, Cb, and Cr) according to quantization are analyzed and a bitmap table is created by mapping the quantized image to a map table (operation730).

Then, a bitmap index corresponding to each pixel location in the bitmap table is created with reference to the bitmap table (operation740).

If it has been determined in operation710that the bitmap processing has been performed on the input image, the bitmap index and the bitmap table are already created.

Thus, after the bitmap processing is performed on the input image, local image characteristics between a current pixel and neighboring pixels are analyzed (operation750).

Then, a filter index regarding each pixel or block is determined according to the local image characteristics (operation760).

Lastly, pixel or block-based bitmap data in which the filter index is added to the bitmap index is created (operation770).

FIG. 8is a flowchart of a method of decoding an image in a bitmap format, according to an exemplary embodiment of the present invention.

Referring toFIG. 8, initially, bitmap data is received from an image encoding apparatus and a bitmap table, 2Nbitmap indices, and 2Nfilter indices are extracted (operation810).

Then, bitmap table values are set and pixel values mapped to the bitmap indices are extracted from the bitmap table (operation820).

Then, a current pixel and neighboring pixels are filtered by using a filter corresponding to a filter index regarding each pixel or each block (operation830).

The present invention can also be embodied as computer readable code on a computer readable recording medium. The computer readable recording medium is any data storage device that can store data which can be thereafter read by a computer system. Examples of the computer readable recording medium include read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tapes, floppy discs, and optical data storage devices. In another exemplary embodiment, the computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.

According to the present invention, bitmap indices used to represent boundaries of a font or an icon may be reduced and an image close to true colors may be represented by allocating surplus bitmap indices to colors and gradations even when almost the same bandwidth as a related art method is used.