SYSTEM AND METHOD FOR COMPRESSION OF IMAGE COLOR MAPS
FIELD OF THE INVENTION
The present invention relates to digital data compression. In particular, the present invention teaches systems and methods for compressing digital images.
BACKGROUND OF THE INVENTION
Existing networking technologies include numerous techniques for securing sensitive content during transmission. For example, e-commerce web sites employ a variety of mechanisms to protect sensitive data during transit, such as user credit card numbers and passwords. Common security protocols include the Secure Socket Layer (SSL) and Transport Layer Security (TLS) protocols, which protect sensitive data during transit between clients and servers, typically web browsers and HTTP servers. Such protocols protect data in transit by encrypting the data by using session-keys, which are known only to the web server and the client computer. Data is decrypted upon arrival at the receiving computer, which subsequently processes the decrypted data (e.g., validates credit card number) and may store the sensitive data in a server database.
Though existing secure transmission protocols such as SSL and TLS protect transitory data in the network, these secure transport mechanisms do not protect data at the web site nor on the associated servers. Indeed, sensitive data is often stored and forwarded in unencrypted form, i.e., "in the clear", due to the high overhead inherent in performing the associated cryptographic functions. For example, a web server forced to encrypt and decrypt sensitive data repeatedly is likely to be computationally overwhelmed by these tasks, and become unresponsive. The generation of such bottlenecks is likely to discourage, and potentially cripple, traffic to such servers
The computational complexity of encryption and decryption pose particular problems for the storage of content which is both sensitive and data-intensive; as a consequence, large files are frequently stored in the clear in associated server databases. Unwieldy files sizes prove particularly problematic in the case of sensitive image data, whose size dwarf other types of sensitive data, such as passwords or credit card numbers image data are typically rendered in files whose magnitudes are on the order of hundreds of kilobytes. As a consequence, organizations are often forced to store such sensitive information in the clear, and thereby compromise integrity.
Accordingly, there is a need for techniques to reduce the footprint of digital images, whether to facilitate encryption or other benefits of compression. Such techniques should protect such images from degradation, to ensure that such
compressed ϊmages are visually Indistinguishable or superior to the original images, when rendered on any standard media. These needs and other inadequacies of the prior art are addressed by the invention described herein.
SUMMARY OF THE INVENTION
The present invention includes systems and methods for compressing color images while preserving high image quality. In embodiments of the invention, tables storing vectors for rendering images are compressed by combining selected vectors, and replacing occurrences of the originally selected vectors with the combined vectors. Such techniques are applicable to standard image formats, such as the various versions of the Graphics Interchange Format (GIF), Joint Photographies Expert Group (JPEG), Moving Pictures Expert Group (MPEG), or other image rendering standards.
In embodiments of the invention, vectors are selected for compression by measuring a minimal distance between vectors in a given table; a pair of vectors may be selected from the table for compression after a determination that the vectors have a minimal difference. In embodiments of the invention, a metric for determining a difference, or distance, between vectors may be Euclidean distance.
Upon identification of a pair of vectors selected for compression, the vectors may be combined according to a prescribed formula. In embodiments of the invention, the vectors may be combined according to a weighted average of the two vectors. In some such embodiments, the weighted average reflects a number of occurrences of the selected vectors in the table. Upon computation of the combined vector, all occurrences of the originally selected vectors are replaced with the combined vector, and bitmaps are updated appropriately to point to the combined vector. In some embodiments, the steps of identifying vectors for replacement, combining vectors, and updating tables and bitmaps, are repeated until a desired compression factor is achieved.
In embodiments of the invention, the vectors comprise color intensity values. In one such embodiment, the vectors may comprise 3-tuples, with intensity values of each of the primary colors, e.g., tuples of the form (Red Intensity, Blue Intensity, Green Intensity). Such embodiments may include the steps of receiving an image including a color map comprising a plurality of colored regions each having a color intensity value indicating a color intensity for one or more selected colors; measuring each of the color intensity values for each region; comparing each of the intensity values of each region in order to determine two colors having a smallest intensity value difference; combining the two colors in order to make a new color; and replacing the color of each region of the color map containing the two colors having the smallest intensity value difference with the new color. These and other embodiments are described in further detail herein.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:
FIG. 1 is a schematic diagram illustrating comparison between entries in an image table and reduction of the original table according to embodiments of the invention.
FIG. 2 illustrates the re-mapping of image regions to updated color image maps according to embodiments of the invention.
FIG. 3 is flow chart diagram illustrating a method for compressing color image maps.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
A. Introduction
The invention teaches systems and methods for the compression of image maps. These systems and methods include algorithms and architectures compatible with existing and commonplace image standards, such as MPEG, JPEG, and GIF. Accordingly, such techniques are particularly well-suited to networking technologies in which these standards are ubiquitous, such as web -based or other Internet traffic. Embodiments of the invention include recursive or iterative techniques to compress such images to a desired memory footprint, without compromising image quality.
The image compression techniques and mechanisms described herein may be employed to encrypt such images for storage and/or network transmission. In non- limiting embodiments, processes resident on proxy servers may perform such compression as and adjunct to, or in conjunction with, the encryption or decryption of images. Such encryption/decryption processes may, in certain embodiments, take place at the proxy server to facilitate transmission of the compressed image to client devices in communication with the proxy server.
In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without these specific details. In other instances, well- known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention. In particular, to illustrate the reduction and combination of vectors in an image table, illustrative examples are used employing particular vectors, e.g., color intensity 3-tuples, that are used by the GIF standard. It will be appreciated by those skilled in the art that these examples are used for illustrative purposes only, and do not limit the scope of the invention. In particular, the embodiments and techniques described herein are equally applicable to any type of table and any size of tuples used to instantiate digital images.
B. Compression of Image Color Maps
As is well-known in the art, standard image formats are typically instantiated as bitmaps and vector tables. As a non-limiting, illustrative example, the GIF standard includes bitmaps and color image tables, with the bitmaps mapping spatial blocks to particular entries in the color image table. In the example of GIF files, the constituent
vectors of the color image maps are 3-tuples indicating color intensities for the primary colors, i.e., red, blue, and green. Such a table is 100 is illustrated in Figure 1.
To elaborate, the first color image table 100 in Figure 1 includes n-many 3- tuples. In embodiments of the invention, an algorithm for image compression reduces the first image table 100 to the second image table 102, after a first iteration-the second color image table 102 is seen to include (n-1 ) vectors. In embodiments of the invention, the reduction of the image tables 100 102 takes place as follows. The first image table 100 is searched to select a pair of vectors 104 106, such that a difference, or distance, between the two vectors is minimal. As a non-limiting example, the distance metric which is minimized is the Euclidean distance between the 3-tuples 104 106. Upon identification, the two selected vectors 104 106 may be combined, and subsequently replaced in the image table with the combined vector 108.
To illustrate the generation and purpose of the combined vector, Figure 2 schematically illustrates the use of color image tables to render digital images. Prior to the compression, a bitmap 200 maps spatial blocks, or regions, to the color intensity tuples in the original color image table 100. As a non-limiting example, certain regions 202 in the bitmap may point to the selected vectors 104 106. Upon combination of the selected vectors into a combined vector, these regions 204 are updated in the bitmap 206 to point to the combined vector 108.
In embodiments of the invention, the combined vector 108 may be generated as a weighted average of the selected vectors 104 106. As one, non-limiting embodiment, the weighted average may be based on the number of occurrences of the selected vectors 104 106 in the bitmap 202. Other suitable techniques for combining vectors shall be apparent to those skilled in the art.
C. Implementations of Image Compression Algorithms
FIG. 3 depicts a flow chart diagram 300 illustrating a method for compressing color image maps in accordance with embodiments of the present invention. Upon receipt of a digital image 302, distances may be measured between pairs of entries in the image color table 304. In accordance with one embodiment, each measurement will consist of a color intensity value for each of the colors red, green and blue. In accordance with one embodiment, any desired measure of relative color intensity may be used. In non-limiting embodiments of the invention, each color intensity value is compared to each other intensity value by relative separation by Euclidean distance. The Euclidean distance between any two colors, first color (1 ) and second color (2), is computed by summing the squares of the differences between each of the three color
intensity values, red lntensity (r), green intensity (g) and blue intensity (b), i.e. Euclidean distance between colors 1 and 2 = ( r1 - r2 ) * ( r1 - r2) + ( g1 - g2 ) * ( g1 - g2 ) + ( b1 - b2 ) * ( b1 - b2 ). Alternative distance metrics shall be apparent to those skilled in the art.
Upon the completion of such measurements, the two colors separated by the smallest Euclidean difference in color intensity are selected 306. The selected colors are then combined 308 as a new color on the color map using a weighted average of their color intensities. For example, if a color (r1 , g1 , b1) occurs n1 times in the image and a color (r2, g2, b2) occurs n2 times in the image, the combined vector may have the form
V combinedJ 9 combined' '■'combined/
where
"•combined = (r1 * n1 + r2 * n2 ) / ( n1 + n2 ) gcombine = ( g1 * n1 + g2 * n2 ) / ( n1 + n2 ) bcombined = ( b1 * n1 + b2 * n2 ) / ( n1 + n2 )
Other alternative averaging techniques shall be apparent to those skilled in the art.
If the resulting new color map has the desired number of remaining colors 310, the pixels of the original image are mapped to the new color map 312. Otherwise, if the color map still has too many colors, the process returns for an additional cycle of color compression. The end result is a color map with the desired number of colors to which the pixels of the original image can be mapped using standard techniques.
In accordance with one embodiment, with color map compression enabled, the compression software will scale down color images according to a user specified quality factor. Users may choose a desired level of color compression based on their specific needs and preferences. By selecting maximum compression, the volume of data encoded through various steps of transmission can be greatly reduced without reducing the amount of substantive information received. For example, a user who is only concerned about the transmission of textual portion of image data can greatly increase encoding and decoding speed, as well as any necessary encryption and decryption efficiencies, by selecting a maximum level of color compression. Alternatively, users interested in viewing or providing content for aesthetic purposes may choose to use little or no color compression
D. Content Caching and Proxy Servers
By allowing compression of data-intensive image files, the invention facilitates the encryption and decryption of such files by computer systems that provide content and support services via highly trafficed packet-switched networks, such as the World Wide Web. Accordingly, in embodiments of the invention, the image compression techniques described herein may be deployed by cache servers. To elaborate, a common delivery approach employed to pre-empt traffic bottlenecks involves the use of cache, or "proxy" servers at major Internet access points. Typically, when a web user requests content from a web site, the request is redirected to the cache server that is closest to the user rather than being directed to the originating server from which the content originates. The cache server may compress images which transit through the server per the algorithms described herein. Such compression may be undertaken by the proxy server as a precursor to encryption/decryption of the images, storage of the images, or transmission of the images. In some such embodiments, the device undertaking the compression may be a Storage Area Network device or a Network Attached Storage device. Other network and computer architectures supporting and utilizing the compression techniques described herein shall be apparent to those skilled in the art.
E. Conclusion
In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention.
The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. Many modifications, equivalents, and variations shall be apparent to those skilled in the art.