USRE37476E1 - Alpha blending palettized image data - Google Patents
Alpha blending palettized image data Download PDFInfo
- Publication number
- USRE37476E1 USRE37476E1 US09/538,666 US53866600A USRE37476E US RE37476 E1 USRE37476 E1 US RE37476E1 US 53866600 A US53866600 A US 53866600A US RE37476 E USRE37476 E US RE37476E
- Authority
- US
- United States
- Prior art keywords
- index
- pixel
- blended
- clut
- indices
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G5/00—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
- G09G5/02—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed
- G09G5/06—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed using colour palettes, e.g. look-up tables
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2340/00—Aspects of display data processing
- G09G2340/10—Mixing of images, i.e. displayed pixel being the result of an operation, e.g. adding, on the corresponding input pixels
Definitions
- the present invention relates to digital image processing, and, in particular, to alpha blending.
- Alpha blending is a standard technique of combining two or more input images together to generate a resulting blended image, where each pixel of the blended image is the result of taking the weighted average of the corresponding pixels of the input images.
- the weighted average is dictated by alpha-channel values, which may vary from pixel to pixel within an image, and from frame to frame, in the case of alpha blending of two or more video streams.
- Alpha blending is typically applied to image data in a three-component color format, such as RGB24where each of the red (R), green (G), and blue (B) components is represented by an 8-bit value.
- the alpha channel may also be represented by 8-bit values.
- each pixel of the blended image may be represented by three blended components (R b ,G b ,B b ) generated based on straightforward weighted averaging according to the following Equations (1)-(3):
- R b R 1 * ⁇ + R 2 * ( 256 - ⁇ ) 256 ( 1 )
- G b G 1 * ⁇ + G 2 * ( 256 - ⁇ ) 256 ( 2 )
- B b B 1 * ⁇ + B 2 * ( 256 - ⁇ ) 256 ( 3 )
- ⁇ is the alpha-channel value for the blended pixel
- (R 1 ,G 1 ,B 1 ) and (R 2 ,G 2 ,B 2 ) are corresponding pixels of the two input images.
- the resulting blended image presents a visual effect based on contributions from both input images.
- Alpha blending is used, for example, to simulate fades between images or scenes, or certain transparency effects (e.g., a window where the viewer sees both the view through the window as well as a partial reflection off the surface of the window).
- CLUT color lookup table
- each pixel is represented by a single (e.g., 8-bit) value that is used as an index to a color lookup table which maps the index to a specific three-component (e.g., RGB24) color.
- RGB24 three-component
- An 8-bit CLUT supports up to 256 different CLUT8 indices that can map to up to 256 different RGB24 colors.
- each CLUT8 index can map to any of the possible RGB24 colors, with little or no correlation to other CLUT8 indices and other possible RGB24 colors.
- the CLUT8 index 7 can map to any RGB24 color, for example, a shade of green.
- alpha blending that mixes together two shades of pink to generate a shade of green will not be useful in conventional applications of alpha blending.
- the present invention is directed to an efficient and accurate method of alpha blending two or more palettized images represented in a CLUT color format.
- the present invention is directed to alpha-blending palettized image data.
- a first set of palettized image data and a second set of palettized image data are provided, wherein each pixel of the palettized image data is represented by an index of a color lookup table (CLUT), and each pixel of the first set corresponds to a pixel of the second set.
- a set of alpha-channel values is provided, wherein each alpha-channel value corresponds to a pixel of the first set.
- Each pixel of the first and second sets of palettized image data is mapped to an index space.
- a set of blended pixels is generated, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value.
- the blended pixels are mapped back to CLUT indices to generate palettized blended image data.
- FIGS. 1a-i show an 8-bit color lookup table, according to a preferred embodiment of the present invention
- FIG. 2 is a graphical representation of the 18 different UV indices for the color lookup table of FIGS. 1a-i as plotted in the UV component plane;
- FIG. 3 is a flow diagram of alpha-blending processing for each pair of corresponding pixels of two palettized input images based on the CLUT of FIGS. 1a-i;
- FIG. 4 is a block diagram of an apparatus for implementing the alpha-blending processing of FIG. 3 .
- the present invention is directed to a scheme for performing alpha blending on palettized image data.
- One way to apply alpha blending to palettized image data is to (a) map the input pixels to three-component RGB24 color format, (b) perform the alpha blending in RGB space using Equations (1)-(3), and then (c) map the resulting blended image data in RGB24 format back to CLUT8 format.
- the first two steps are relatively easy; the third step can be computationally expensive. Because so few of the 2 24 different possible RGB24 colors are actually represented in an 8-bit CLUT (i.e., at most 256), in general, the pixels of the resulting blended image will not be represented exactly by CLUT indices.
- the blended image can be mapped back to CLUT8 space by an exhaustive search algorithm that compares each RGB24 pixel of the blended image with each RGB24 color represented in the lookup table to select the CLUT8 index corresponding to the closest color.
- the closest color may be defined, for example, as the color having the smallest geometric distance d.
- the geometric distance d i between the current blended pixel (R b ,G b ,B b ) and the i th CLUT color (R i ,G i ,B i ) may be defined as the sum of the absolute differences as in the following Equation (4):
- the present invention takes into account the structure in such CLUTs to provide an efficient and accurate method for alpha blending of palettized image data. It does so by mapping the palettized image data to an index space different from the CLUT color space, performing the alpha blending using the index-space data, and then mapping the blended data back to the CLUT color space, where the mappings to the index color space and to the CLUT color space are based on a characterization of the structure of the CLUT.
- FIGS. 1a-i there is shown an 8-bit color lookup table, according to a preferred embodiment of the present invention.
- the CLUT of FIGS. 1a-i maps 234 CLUT indices (from 10 to 243) to 234 RGB24 colors.
- the 8-bit R, G, and B values corresponding to the 234 different CLUT indices are tabulated in FIGS. 1a-i.
- the indices 0-9 and 244-255 are not part of the CLUT of FIGS. 1a-i.
- the colors for CLUT indices 0-9 and 246-255 are reserved and are defined by the particular operating system (i.e., a Microsoft Windows operating system).
- CLUT indices 10-243 are generated based on 18 different UV indices (from 0 to 17). For each UV index, there are 13 CLUT indices corresponding to a fixed (U,V) pair and 13 different Y component values ranging from 38 to 218 in increments of 15.
- FIG. 2 there is shown a graphical representation of the 18 different UV indices for the CLUT of FIGS. 1a-i as plotted in the UV component plane.
- the (U,V) component pairs for the 18 different UV indices are tabulated in Table I.
- FIG. 2 besides being separated in increments of 32 and generally distributed around (128,128), there is little pattern to the location of the UV indices in the UV coordinate plane.
- Table II presents U and V coordinates corresponding to each UV index of Table I. Each pair of U and V coordinates represents the number of increments of 32 in the U and V components corresponding to a different UV index.
- FIG. 3 there is shown a flow diagram of alpha-blending processing for each pair of corresponding pixels of two palettized input images based on the CLUT of FIGS. 1a-i, according to a preferred embodiment of the present invention.
- corresponding pixels from the two palettized input images are mapped from the one-dimensional CLUT space to a YUV index space (step 302 of FIG. 3 ).
- Alpha blending is then performed to generate Y, U, and V coordinates of a blended pixel (step 304 ) and the resulting blended pixel is then mapped back to CLUT space (step 306 ).
- mapping of each palettized pixel from CLUT space to YUV index space may be implemented according to the following Equations (6)-(7):
- I UV is the UV index in YUV index space
- I Y is the Y index in YUV index space
- DIV is the integer division function
- MOD is the modulo function.
- mappings of Equations (6) and (7) may be implemented by evaluating the mathematical equations during real-time processing or using the CLUT index C as an index into lookup tables that return values pre-computed off line using Equations (6) and (7).
- Equations (8)-(10) The blending of the two pixels in the YUV-index space (step 304 of FIG. 3) may be implemented according to Equations (8)-(10) as follows:
- V b (vLUT[I UV1 ]* ⁇ +vLUT[I UV2 ]*(256 ⁇ )+128) DIV 256 (9)
- I UV1 and I Y1 are the UV and Y indices in YUV index space for the pixel from the first input image
- I UV2 and I Y2 are the UV and Y indices in YUV index space for the pixel from the second input image
- uLUT and vLUT are lookup tables that map a UV index to U and V coordinates, respectively, as indicated in Table II,
- ⁇ is the 8-bit alpha-channel value for the pixels
- DIV is the integer division function
- Y b , U b , and V b are Y, U, and V coordinates for the blended pixel in a three-dimensional coordinate space.
- the value 128 is added before each integer division operation in Equations (8)-(9) to ensure proper rounding to the closest integer. In an alternative embodiment, the value 128 may also be added before the integer division in Equation (10).
- mapping of the three-coordinate blended pixel back to CLUT space (step 306 of FIG. 3) may be implemented according to the following Equation (11):
- C b is the CLUT index for the blended pixel in CLUT space
- uvLUT is a lookup table that maps the U and V coordinates back to the corresponding UV index.
- the lookup table uvLUT is shown in Table III.
- Lookup table uvLUT is based on the locations of the UV indices as shown in FIG. 2 . Because of the limited nature of the CLUT of FIGS. 1a-i, not all of the possible entries in uvLUT are needed.
- CLUT-to-YUV index mapper 402 receives the CLUT indices for two palettized images and maps those CLUT indices to Y and UV indices.
- YUV-index blender 404 receives the Y and UV indices and the alpha channel values and generates blended pixels with Y, U, and V coordinates.
- YUV-to-CLUT index mapper 406 maps the blended pixels back to CLUT indices of the resulting blended palettized image.
- the alpha-blending processing of FIG. 3 is implemented in software executed on a general-purpose microprocessor, such as a Pentium® or Pentium® Pro processor manufactured by Intel Corporation.
- This section presents an example of the alpha-blending processing of FIG. 3 based on the CLUT of FIGS. 1a-i.
- the pixel from the first palettized image has a CLUT index value of 48
- the corresponding pixel from the second palettized image has a CLUT index value of 120
- the alpha-channel value for blending these two pixels together is 64.
- the example is processed using Equations (1)-(3) and the exhaustive search algorithm described in conjunction with Equation (4).
- the CLUT index 48 corresponds to the RGB24 color ( 235 , 247 , 170 ) and the CLUT index 120 corresponds to the RGB24 color ( 181 , 116 , 65 ).
- Equations (1)-(3) yields the RGB24 color for the exact blended pixel (R b , G b , B b ) as follows:
- RGB24 color ( 198 , 134 , 83 ) as the closest match in the CLUT of FIGS. 1a-i to the exact blended pixel.
- This RGB24 color is represented by CLUT index 121, which is therefore used to represent the blended pixel in the resulting palettized alpha-blended image.
- the alpha-blending of FIG. 3 yields the same result as the algorithm based on alpha-blending in RGB space followed by an exhaustive search to get back to CLUT space.
- alpha blending is described in terms of palettized image data based on a CLUT that maps to RGB space, where the CLUT is generated based on structure in YUV space.
- CLUTs that map to color spaces other than RGB (e.g., YUV, YIQ) and/or CLUTs that are generated based on structure in color spaces other than YUV (e.g., YIQ, RGB).
- alpha blending was described in terms of combining two images together. Those skilled in the art will understand that the present invention also covers alpha blending of three or more images together where sufficient alpha-channel data is available to determine relative weighting between the input images. Moreover, the images may be frame of two or more video streams that are blended together.
- the present invention can be embodied in the form of methods and apparatuses for practicing those methods.
- the present invention can also be embodied in the form of computer program code embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other computer-readable storage medium, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention.
- the present invention can also be embodied in the form of computer program code, for example, whether stored in a storage medium, loaded into and/or executed by a computer, or transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via electromagnetic radiation, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention.
- the computer program code segments combine with the microprocessor to provide a unique device that operates analogous to specific logic circuits.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
Abstract
Palettized image data for two or more images, represented by color lookup table (CLUT) indices, are mapped to an index space. Blended pixels are generated from the pixels in the index space using alpha blending. The blended pixels are mapped back to CLUT indices to generate palettized blended image data. In a preferred embodiment, in which the CLUT is generated based on a characterized structure in YUV space, the CLUT indices are mapped to Y and UV indices in a YUV index space. The Y and UV indices are then used to generate three-coordinate blended pixels. The three-coordinate blended pixels are then mapped back to CLUT indices of a palettized blended image. Table lookups are used to generate the blended pixels from the Y and UV indices and to map the blended pixels back to CLUT indices.
Description
1. Field of the Invention
The present invention relates to digital image processing, and, in particular, to alpha blending.
2. Description of the Related Art
Alpha blending is a standard technique of combining two or more input images together to generate a resulting blended image, where each pixel of the blended image is the result of taking the weighted average of the corresponding pixels of the input images. The weighted average is dictated by alpha-channel values, which may vary from pixel to pixel within an image, and from frame to frame, in the case of alpha blending of two or more video streams.
Alpha blending is typically applied to image data in a three-component color format, such as RGB24where each of the red (R), green (G), and blue (B) components is represented by an 8-bit value. The alpha channel may also be represented by 8-bit values. For example, when alpha blending two images together, each pixel of the blended image may be represented by three blended components (Rb,Gb,Bb) generated based on straightforward weighted averaging according to the following Equations (1)-(3):
where α is the alpha-channel value for the blended pixel, and (R1,G1,B1) and (R2,G2,B2) are corresponding pixels of the two input images. The resulting blended image presents a visual effect based on contributions from both input images. Alpha blending is used, for example, to simulate fades between images or scenes, or certain transparency effects (e.g., a window where the viewer sees both the view through the window as well as a partial reflection off the surface of the window).
Another standard color format for image data is the color lookup table (CLUT) format. In CLUT format, each pixel is represented by a single (e.g., 8-bit) value that is used as an index to a color lookup table which maps the index to a specific three-component (e.g., RGB24) color. An 8-bit CLUT, for example, supports up to 256 different CLUT8 indices that can map to up to 256 different RGB24 colors. In general, each CLUT8 index can map to any of the possible RGB24 colors, with little or no correlation to other CLUT8 indices and other possible RGB24 colors.
It is desirable to provide the capability to perform alpha blending of image data in CLUT format (also known as palettized image data). Unfortunately, applying an equation based on the straightforward weighted averaging of Equations (1)-(3) will typically not provide the correct results, or even an acceptable result. For example, assume that a pixel from the first input image is represented by the CLUT8 index 6, defined by the CLUT to map to a particular shade of pink. Assume further that the corresponding pixel from the second input image is represented by the CLUT8 index 8, defined by the CLUT to map to a similar but different shade of pink. If the corresponding 8-bit alpha-channel value is 128, then applying straightforward weighted averaging would produce a CLUT8 index of 7 for the corresponding blended pixel. Unfortunately, because there need be little if any correlation between CLUT8 indices, the CLUT8 index 7 can map to any RGB24 color, for example, a shade of green. Clearly, alpha blending that mixes together two shades of pink to generate a shade of green will not be useful in conventional applications of alpha blending.
The present invention is directed to an efficient and accurate method of alpha blending two or more palettized images represented in a CLUT color format.
Further objects and advantages of this invention will become apparent from the detailed description of a preferred embodiment which follows.
The present invention is directed to alpha-blending palettized image data. According to a preferred embodiment, a first set of palettized image data and a second set of palettized image data are provided, wherein each pixel of the palettized image data is represented by an index of a color lookup table (CLUT), and each pixel of the first set corresponds to a pixel of the second set. A set of alpha-channel values is provided, wherein each alpha-channel value corresponds to a pixel of the first set. Each pixel of the first and second sets of palettized image data is mapped to an index space. A set of blended pixels is generated, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value. The blended pixels are mapped back to CLUT indices to generate palettized blended image data.
Other objects, features, and advantages of the present invention will become more fully apparent from the following detailed description of the preferred embodiment, the appended claims, and the accompanying drawings in which:
FIGS. 1a-i show an 8-bit color lookup table, according to a preferred embodiment of the present invention;
FIG. 2 is a graphical representation of the 18 different UV indices for the color lookup table of FIGS. 1a-i as plotted in the UV component plane;
FIG. 3 is a flow diagram of alpha-blending processing for each pair of corresponding pixels of two palettized input images based on the CLUT of FIGS. 1a-i; and
FIG. 4 is a block diagram of an apparatus for implementing the alpha-blending processing of FIG. 3.
The present invention is directed to a scheme for performing alpha blending on palettized image data. One way to apply alpha blending to palettized image data is to (a) map the input pixels to three-component RGB24 color format, (b) perform the alpha blending in RGB space using Equations (1)-(3), and then (c) map the resulting blended image data in RGB24 format back to CLUT8 format. The first two steps are relatively easy; the third step can be computationally expensive. Because so few of the 224 different possible RGB24 colors are actually represented in an 8-bit CLUT (i.e., at most 256), in general, the pixels of the resulting blended image will not be represented exactly by CLUT indices.
When there is no straightforward mathematical equation for mapping from RGB24 space back to CLUT8 space, the blended image can be mapped back to CLUT8 space by an exhaustive search algorithm that compares each RGB24 pixel of the blended image with each RGB24 color represented in the lookup table to select the CLUT8 index corresponding to the closest color. The closest color may be defined, for example, as the color having the smallest geometric distance d.
The geometric distance di between the current blended pixel (Rb,Gb,Bb) and the ith CLUT color (Ri,Gi,Bi) may be defined as the sum of the absolute differences as in the following Equation (4):
Alternatively, the geometric distance di may be defined as the square root of the sum of the squares of the differences as in the following Equation (5):
In either case, the computational load on a processor for such an approach can be great.
Pseudocode for an exhaustive search algorithm based on Equation (4) is as follows:
BestIndex = 0; | ||
BestIndex Value = MAX_INT; | ||
for (i=0; i<256; i++) | ||
{ | ||
value = abs(Rb − Ri) + abs(Gb − Gi) + abs(Bb − Bi); | ||
if (value < BestIndex Value) | ||
{ | ||
BestIndex Value = value; | ||
BestIndex = i; | ||
} | ||
} | ||
CLUTb = BestIndex; | ||
Such an exhaustive search algorithm will generate the correct blended CLUT indices (CLUTb), but is computationally expensive.
Many color lookup tables are structured lookup tables in that they follow some recognizable pattern. The present invention takes into account the structure in such CLUTs to provide an efficient and accurate method for alpha blending of palettized image data. It does so by mapping the palettized image data to an index space different from the CLUT color space, performing the alpha blending using the index-space data, and then mapping the blended data back to the CLUT color space, where the mappings to the index color space and to the CLUT color space are based on a characterization of the structure of the CLUT.
Referring now to FIGS. 1a-i, there is shown an 8-bit color lookup table, according to a preferred embodiment of the present invention. The CLUT of FIGS. 1a-i maps 234 CLUT indices (from 10 to 243) to 234 RGB24 colors. The 8-bit R, G, and B values corresponding to the 234 different CLUT indices are tabulated in FIGS. 1a-i. The indices 0-9 and 244-255 are not part of the CLUT of FIGS. 1a-i. In a preferred embodiment, the colors for CLUT indices 0-9 and 246-255 are reserved and are defined by the particular operating system (i.e., a Microsoft Windows operating system). The colors for CLUT indices 10-243 are generated based on 18 different UV indices (from 0 to 17). For each UV index, there are 13 CLUT indices corresponding to a fixed (U,V) pair and 13 different Y component values ranging from 38 to 218 in increments of 15.
Referring now to FIG. 2, there is shown a graphical representation of the 18 different UV indices for the CLUT of FIGS. 1a-i as plotted in the UV component plane. The (U,V) component pairs for the 18 different UV indices are tabulated in Table I. As is evident from FIG. 2, besides being separated in increments of 32 and generally distributed around (128,128), there is little pattern to the location of the UV indices in the UV coordinate plane.
TABLE I | |||
UV INDEX | U | V COMPONENT | |
0 | 128 | 128 |
1 | 128 | 96 |
2 | 96 | 128 |
3 | 128 | 160 |
4 | 160 | 128 |
5 | 96 | 96 |
6 | 160 | 96 |
7 | 160 | 160 |
8 | 96 | 160 |
9 | 64 | 128 |
10 | 128 | 192 |
11 | 128 | 64 |
12 | 192 | 128 |
13 | 64 | 160 |
14 | 96 | 192 |
15 | 64 | 96 |
16 | 160 | 64 |
17 | 192 | 96 |
Table II presents U and V coordinates corresponding to each UV index of Table I. Each pair of U and V coordinates represents the number of increments of 32 in the U and V components corresponding to a different UV index.
TABLE II | |||
UV INDEX | U | V INDEX | |
0 | 4 | 4 |
1 | 4 | 3 |
2 | 3 | 4 |
3 | 4 | 5 |
4 | 5 | 4 |
5 | 3 | 3 |
6 | 5 | 3 |
7 | 5 | 5 |
8 | 3 | 5 |
9 | 2 | 4 |
10 | 4 | 6 |
11 | 4 | 2 |
12 | 6 | 4 |
13 | 2 | 5 |
14 | 3 | 6 |
15 | 2 | 3 |
16 | 5 | 2 |
17 | 6 | 3 |
Referring now to FIG. 3, there is shown a flow diagram of alpha-blending processing for each pair of corresponding pixels of two palettized input images based on the CLUT of FIGS. 1a-i, according to a preferred embodiment of the present invention. According to this embodiment, corresponding pixels from the two palettized input images are mapped from the one-dimensional CLUT space to a YUV index space (step 302 of FIG. 3). Alpha blending is then performed to generate Y, U, and V coordinates of a blended pixel (step 304) and the resulting blended pixel is then mapped back to CLUT space (step 306).
The mapping of each palettized pixel from CLUT space to YUV index space (step 302) may be implemented according to the following Equations (6)-(7):
where:
C is the CLUT index,
IUV is the UV index in YUV index space,
IY is the Y index in YUV index space,
DIV is the integer division function, and
MOD is the modulo function.
Those skilled in the art will understand that the mappings of Equations (6) and (7) may be implemented by evaluating the mathematical equations during real-time processing or using the CLUT index C as an index into lookup tables that return values pre-computed off line using Equations (6) and (7).
The blending of the two pixels in the YUV-index space (step 304 of FIG. 3) may be implemented according to Equations (8)-(10) as follows:
where:
IUV1 and IY1 are the UV and Y indices in YUV index space for the pixel from the first input image,
IUV2 and IY2 are the UV and Y indices in YUV index space for the pixel from the second input image,
uLUT and vLUT are lookup tables that map a UV index to U and V coordinates, respectively, as indicated in Table II,
α is the 8-bit alpha-channel value for the pixels,
DIV is the integer division function, and
(Yb, Ub, and Vb) are Y, U, and V coordinates for the blended pixel in a three-dimensional coordinate space.
The value 128 is added before each integer division operation in Equations (8)-(9) to ensure proper rounding to the closest integer. In an alternative embodiment, the value 128 may also be added before the integer division in Equation (10).
The mapping of the three-coordinate blended pixel back to CLUT space (step 306 of FIG. 3) may be implemented according to the following Equation (11):
where:
Cb is the CLUT index for the blended pixel in CLUT space,
(Yb, Ub, Vb) are Y, U, and V coordinates for the blended pixel from Equations (8)-(10), and
uvLUT is a lookup table that maps the U and V coordinates back to the corresponding UV index.
The lookup table uvLUT is shown in Table III. Lookup table uvLUT is based on the locations of the UV indices as shown in FIG. 2. Because of the limited nature of the CLUT of FIGS. 1a-i, not all of the possible entries in uvLUT are needed.
|
11/22 LOOKUP TABLE uvLUT |
V COORDINATE |
|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
0 | ||||||||
1 | ||||||||
2 | 15 | 15 | 9 | 13 | 13 | |||
3 | 5 | 5 | 2 | 8 | 14 | |||
4 | 11 | 1 | 0 | 3 | 10 | |||
5 | 16 | 6 | 4 | 7 | 7 | |||
6 | 17 | 17 | 12 | 12 | 12 | |||
7 | ||||||||
Referring now to FIG. 4, there is shown a block diagram of an apparatus for implementing the alpha-blending processing of FIG. 3. CLUT-to-YUV index mapper 402 receives the CLUT indices for two palettized images and maps those CLUT indices to Y and UV indices. YUV-index blender 404 receives the Y and UV indices and the alpha channel values and generates blended pixels with Y, U, and V coordinates. YUV-to-CLUT index mapper 406 maps the blended pixels back to CLUT indices of the resulting blended palettized image. In a preferred embodiment, the alpha-blending processing of FIG. 3 is implemented in software executed on a general-purpose microprocessor, such as a Pentium® or Pentium® Pro processor manufactured by Intel Corporation.
This section presents an example of the alpha-blending processing of FIG. 3 based on the CLUT of FIGS. 1a-i. In this example, the pixel from the first palettized image has a CLUT index value of 48, the corresponding pixel from the second palettized image has a CLUT index value of 120, and the alpha-channel value for blending these two pixels together is 64.
In order to demonstrate the embodiment of FIG. 3, the example is processed using Equations (1)-(3) and the exhaustive search algorithm described in conjunction with Equation (4). As shown in FIGS. 1b and 1e, the CLUT index 48 corresponds to the RGB24 color (235, 247, 170) and the CLUT index 120 corresponds to the RGB24 color (181, 116, 65). Applying Equations (1)-(3) yields the RGB24 color for the exact blended pixel (Rb, Gb, Bb) as follows:
Implementing the pseudocode for the exhaustive search algorithm yields the RGB24 color (198, 134, 83) as the closest match in the CLUT of FIGS. 1a-i to the exact blended pixel. This RGB24 color is represented by CLUT index 121, which is therefore used to represent the blended pixel in the resulting palettized alpha-blended image.
The same example is now used in the alpha-blending processing of FIG. 3. Each pixel is mapped to YUV-index space (step 302 of FIG. 3) using Equations (6)-(7) as follows:
The pixels are then blended together to generate the blended pixel (Yb, Ub, Yb) (step 304 of FIG. 3) using Equations (8)-(10) as follows:
The blended pixel (Yb, Ub, Vb) is then mapped back to CLUT space (step 306 of FIG. 3) using Equation (11) as follows:
Thus, the alpha-blending of FIG. 3 yields the same result as the algorithm based on alpha-blending in RGB space followed by an exhaustive search to get back to CLUT space.
In the preferred embodiments described above, alpha blending is described in terms of palettized image data based on a CLUT that maps to RGB space, where the CLUT is generated based on structure in YUV space. Those skilled in the art will understand that the present invention also applies to palettized image data based on CLUTs that map to color spaces other than RGB (e.g., YUV, YIQ) and/or CLUTs that are generated based on structure in color spaces other than YUV (e.g., YIQ, RGB).
In the preferred embodiments described above, alpha blending was described in terms of combining two images together. Those skilled in the art will understand that the present invention also covers alpha blending of three or more images together where sufficient alpha-channel data is available to determine relative weighting between the input images. Moreover, the images may be frame of two or more video streams that are blended together.
The present invention can be embodied in the form of methods and apparatuses for practicing those methods. The present invention can also be embodied in the form of computer program code embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other computer-readable storage medium, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention. The present invention can also be embodied in the form of computer program code, for example, whether stored in a storage medium, loaded into and/or executed by a computer, or transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via electromagnetic radiation, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing the invention. When implemented on a general-purpose microprocessor, the computer program code segments combine with the microprocessor to provide a unique device that operates analogous to specific logic circuits.
It will be further understood that various changes in the details, materials, and arrangements of the parts which have been described and illustrated in order to explain the nature of this invention may be made by those skilled in the art without departing from the principle and scope of the invention as expressed in the following claims.
Claims (30)
1. A method for alpha-blending palettized image data, comprising the steps of:
(a) providing a first set of palettized image data and a second set of palettized image data, wherein:
each pixel of the palettized image data is represented by an index of a color lookup table (CLUT); and
each pixel of the first set corresponds to a pixel of the second set;
(b) providing a set of alpha-channel values, wherein each alpha-channel value corresponds to a pixel of the first set;
(c) mapping each pixel of the first and second sets of palettized image data to an index space;
(d) generating a set of blended pixels, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value; and
(e) mapping the blended pixels back to CLUT indices to generate palettized blended image data.
2. The method of claim 1, wherein the mapping of pixels by step (c) to the index space and the mapping of the blended pixels by step (e) to the CLUT indices are based on a characterized structure of the CLUT.
3. The method of claim 1, wherein, for each pixel of the first set:
step (c) comprises the step of mapping the corresponding CLUT index for the pixel to two indices in the index space;
step (d) comprises the step of generating three coordinates of a blended pixel using the two indices in the index space as indices to one or more lookup tables; and
step (e) comprises the step of using at least one of the coordinates of the blended pixel as an index to a lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
4. The method of claim 1, wherein the palettized image data is represented by CLUT indices and for each pixel of the first set:
step (c) comprises the steps of:
(1) mapping the CLUT index for the pixel of the first set to a first UV index and a first Y index in the index space; and
(2) mapping the CLUT index for the corresponding pixel of the second set to a second UV index and a second Y index in the index space;
step (d) comprises the steps of:
(1) generating a U coordinate of a blended pixel using the first UV index as an index to a U lookup table and the second UV index as an index to the U lookup table;
(2) generating a V coordinate of the blended pixel using the first UV index as an index to a V lookup table and the second UV index as an index to the V lookup table; and
(3) generating a Y coordinate of the blended pixel using the first Y index and the second Y index; and
step (e) comprises the step of using the U and V coordinates of the blended pixel as indices to a UV lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
5. An apparatus for alpha-blending palettized image data, comprising:
(a) means for providing a first set of palettized image data and a second set of palettized image data, wherein:
each pixel of the palettized image data is represented by an index of a color lookup table (CLUT); and
each pixel of the first set corresponds to a pixel of the second set;
(b) means for providing a set of alpha-channel values, wherein each alpha-channel value corresponds to a pixel of the first set;
(c) means for mapping each pixel of the first and second sets of palettized image data to an index space;
(d) means for generating a set of blended pixels, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value; and
(e) means for mapping the blended pixels back to CLUT indices to generate palettized blended image data.
6. The apparatus of claim 5, wherein the mapping of pixels by means (c) to the index space and the mapping of the blended pixels by means (e) to the CLUT indices are based on a characterized structure of the CLUT.
7. The apparatus of claim 5, wherein, for each pixel of the first set:
means (c) maps the corresponding CLUT index for the pixel to two indices in the index space;
means (d) generates three coordinates of a blended pixel using the two indices in the index space as indices to one or more lookup tables; and
means (e) uses at least one of the coordinates of the blended pixel as an index to a lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
8. The apparatus of claim 5, wherein the palettized image data is represented by CLUT indices and for each pixel of the first set:
means (c):
(1) maps the CLUT index for the pixel of the first set to a first UV index and a first Y index in the index space; and
(2) maps the CLUT index for the corresponding pixel of the second set to a second UV index and a second Y index in the index space;
means (d):
(1) generates a U coordinate of a blended pixel using the first UV index as an index to a U lookup table and the second UV index as an index to the U lookup table;
(2) generates a V coordinate of the blended pixel using the first UV index as an index to a V lookup table and the second UV index as an index to the V lookup table; and
(3) generates a Y coordinate of the blended pixel using the first Y index and the second Y index; and
means (e) uses the U and V coordinates of the blended pixel as indices to a UV lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
9. A storage medium encoded with machine-readable computer program code for alpha-blending palettized image data, comprising:
(a) means for causing a computer to provide a first set of palettized image data and a second set of palettized image data, wherein:
each pixel of the palettized image data is represented by an index of a color lookup table (CLUT); and
each pixel of the first set corresponds to a pixel of the second set;
(b) means for causing the computer to provide a set of alpha-channel values, wherein each alpha-channel value corresponds to a pixel of the first set;
(c) means for causing the computer to map each pixel of the first and second sets of palettized image data to an index space;
(d) means for causing the computer to generate a set of blended pixels, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value; and
(e) means for causing the computer to map the blended pixels back to CLUT indices to generate palettized blended image data.
10. The storage medium of claim 9, wherein the mapping of pixels by means (c) to the index space and the mapping of the blended pixels by means (e) to the CLUT indices are based on a characterized structure of the CLUT.
11. The storage medium of claim 9, wherein, for each pixel of the first set:
means (c) causes the computer to map the corresponding CLUT index for the pixel to two indices in the index space;
means (d) causes the computer to generate three coordinates of a blended pixel using the two indices in the index space as indices to one or more lookup tables; and
means (e) causes the computer to use at least one of the coordinates of the blended pixel as an index to a lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
12. The storage medium of claim 9, wherein the palettized image data is represented by CLUT indices and for each pixel of the first set:
means (c) causes the computer to:
(1) map the CLUT index for the pixel of the first set to a first UV index and a first Y index in the index space; and
(2) map the CLUT index for the corresponding pixel of the second set to a second UV index and a second Y index in the index space;
means (d) causes the computer to:
(1) generate a U coordinate of a blended pixel using the first UV index as an index to a U lookup table and the second UV index as an index to the U lookup table;
(2) generate a V coordinate of the blended pixel using the first UV index as an index to a V lookup table and the second UV index as an index to the V lookup table; and
(3) generate a Y coordinate of the blended pixel using the first Y index and the second Y index; and
means (e) causes the computer to use the U and V coordinates of the blended pixel as indices to a UV lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
13. An apparatus for alpha-blending palettized image data, comprising:
a first mapper;
a blender; and
a second mapper, wherein:
the first mapper receives a first set of palettized image data and a second set of palettized image data, wherein:
each pixel of the palettized image data is represented by an index of a color lookup table (CLUT); and
each pixel of the first set corresponds to a pixel of the second set;
the first mapper maps each pixel of the first and second sets of palettized image data to an index space;
the blender receives a set of alpha-channel values, wherein each alpha-channel value corresponds to a pixel of the first set;
the blender generates a set of blended pixels, wherein each blended pixel is generated from a pixel of the first set in the index space, a corresponding pixel of the second set in the index space, and a corresponding alpha-channel value; and
the second mapper maps the blended pixels back to CLUT indices to generate palettized blended image data.
14. The apparatus of claim 13, wherein the mapping of pixels by the first mapper to the index space and the mapping of the blended pixels by the second mapper to the CLUT indices are based on a characterized structure of the CLUT.
15. The apparatus of claim 13, wherein, for each pixel of the first set:
the first mapper maps the corresponding CLUT index for the pixel to two indices in the index space;
the blender generates three coordinates of a blended pixel using the two indices in the index space as indices to one or more lookup tables; and
the second mapper uses at least one of the coordinates of the blended pixel as an index to a lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
16. The apparatus of claim 13, wherein the palettized image data is represented by CLUT indices and for each pixel of the first set:
the first mapper:
(1) maps the CLUT index for the pixel of the first set to a first UV index and a first Y index in the index space; and
(2) maps the CLUT index for the corresponding pixel of the second set to a second UV index and a second Y index in the index space;
the blender:
(1) generates a U coordinate of a blended pixel using the first UV index as an index to a U lookup table and the second UV index as an index to the U lookup table;
(2) generates a V coordinate of the blended pixel using the first UV index as an index to a V lookup table and the second UV index as an index to the V lookup table; and
(3) generates a Y coordinate of the blended pixel using the first Y index and the second Y index; and
the second mapper uses the U and V coordinates of the blended pixel as indices to a UV lookup table to map the blended pixel to a CLUT index of the palettized blended image data.
17. A method for blending image data comprising:
mapping a first set and a second set of pelletized image data having corresponding pixels expressed in indices of a color lookup table (CLUT) to an index space;
generating blended pixels by blending said corresponding pixels of said first and second sets of pelletized image data in said index space, said blending being based, at least in part, on at least one alpha-channel value; and
mapping said blended pixels to said CLUT indices.
18. The method of claim 17, wherein mapping said sets to said index space is based, at least in part, on a characterized structure of said CLUT.
19. The method of claim 18, wherein mapping said blended pixels is based, at least in part, on said characterized structure.
20. The method of claim 17, wherein said index space comprises at least two indices.
21. The method of claim 20, wherein blending said corresponding pixels comprises:
generating at least three coordinates in said index space; and
using said at least two indices as indices to at least one lookup table; and
indexing a specific lookup table of said at least one lookup table using at least one of said at least three coordinates to map said blended pixels to said CLUT indices.
22. The method of claim 17, wherein said index space is a YUV index space.
23. The method of claim 22, wherein blending said corresponding pixels comprises:
generating Y, U and V coordinates of a blended pixel using said sets as indices to a respective at least one YUV lookup table.
24. The method of claim 23, wherein said U and V coordinates are indices to a UV lookup table to map said blended pixel to said CLUT indices.
25. An apparatus for blending image data comprising:
an image data source including a first and second set of palettized image data represented by indices of a color lookup table (CLUT), said sets having corresponding pixels;
at least one mapper capable of mapping said sets to an index space;
a blender capable of blending said corresponding pixels of said sets in said index space based, at least in part, on at least one alpha-channel value, said first set having pixels corresponding to a respective one of said at least one alpha-channel value to create blended pixels; and
said at least one mapper being further capable of mapping said blended pixels to said CLUT indices.
26. The apparatus of claim 25, wherein said CLUT comprises a characterized structure, and said mapping to said index space and said mapping to said CLUT indices is based, at least in part, on said characterized structure.
27. The apparatus of claim 25, wherein said index spaces comprises a YUV index space.
28. An article comprising: a storage medium;
said storage medium having stored thereon instructions to map to an index space a first set and second set of palletized image data having corresponding pixels expressed in indices of a color lookup table (CLUT);
blend said corresponding pixels of said first and second sets of palletized image data in said index space based, at least in part, on at least one alpha-channel value; and
map said blended pixels to indices of said CLUT.
29. The article of claim 28, wherein said CLUT comprises a characterized structure; and
said mapping to said index space and said mapping to said CLUT indices are based, at least in part, on said characterized structure.
30. The article of claim 29, wherein said index space comprises a YUV index space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US09/538,666 USRE37476E1 (en) | 1996-06-03 | 2000-03-28 | Alpha blending palettized image data |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US08/657,402 US5831604A (en) | 1996-06-03 | 1996-06-03 | Alpha blending palettized image data |
US09/538,666 USRE37476E1 (en) | 1996-06-03 | 2000-03-28 | Alpha blending palettized image data |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US08/657,402 Reissue US5831604A (en) | 1996-06-03 | 1996-06-03 | Alpha blending palettized image data |
Publications (1)
Publication Number | Publication Date |
---|---|
USRE37476E1 true USRE37476E1 (en) | 2001-12-18 |
Family
ID=24637020
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US08/657,402 Expired - Lifetime US5831604A (en) | 1996-06-03 | 1996-06-03 | Alpha blending palettized image data |
US09/538,666 Expired - Fee Related USRE37476E1 (en) | 1996-06-03 | 2000-03-28 | Alpha blending palettized image data |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US08/657,402 Expired - Lifetime US5831604A (en) | 1996-06-03 | 1996-06-03 | Alpha blending palettized image data |
Country Status (1)
Country | Link |
---|---|
US (2) | US5831604A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1341151A2 (en) * | 2002-03-01 | 2003-09-03 | Broadcom Corporation | Method and apparatus for updating a color look-up table |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FR2732787B1 (en) * | 1995-04-07 | 1997-05-16 | Thomson Csf | METHOD OF GRAPHIC INPUT OF SIGNAL PROCESSING APPLICATION |
US6331856B1 (en) * | 1995-11-22 | 2001-12-18 | Nintendo Co., Ltd. | Video game system with coprocessor providing high speed efficient 3D graphics and digital audio signal processing |
GB2317090B (en) * | 1996-09-06 | 2001-04-04 | Quantel Ltd | An electronic graphic system |
US6154217A (en) * | 1997-04-15 | 2000-11-28 | Software Architects, Inc. | Gamut restriction of color image |
JP3409734B2 (en) * | 1999-04-20 | 2003-05-26 | 日本電気株式会社 | Image synthesis system and method |
AU7664301A (en) * | 2000-06-27 | 2002-01-21 | Ruth Gal | Make-up and fashion accessory display and marketing system and method |
EP1168294B1 (en) * | 2000-06-29 | 2008-12-10 | Johnson Controls Automotive Electronics GmbH | Alpha blending with gamma correction |
DE10037661A1 (en) * | 2000-06-29 | 2002-01-10 | Borg Instr Ag | Gamma corrected alpha blending |
US6540681B1 (en) | 2000-11-24 | 2003-04-01 | U-Systems, Inc. | Extended view ultrasound imaging system |
US6707459B1 (en) * | 2001-02-01 | 2004-03-16 | Apple Computer, Inc. | Adjustment of color values for optimized image processing |
US8014615B2 (en) * | 2005-09-02 | 2011-09-06 | Adobe Systems Incorporated | System and method for decompressing video data and alpha channel data using a single stream |
US8189908B2 (en) | 2005-09-02 | 2012-05-29 | Adobe Systems, Inc. | System and method for compressing video data and alpha channel data using a single stream |
US20090310947A1 (en) * | 2008-06-17 | 2009-12-17 | Scaleo Chip | Apparatus and Method for Processing and Blending Multiple Heterogeneous Video Sources for Video Output |
CN107871303B (en) * | 2016-09-26 | 2020-11-27 | 北京金山云网络技术有限公司 | Image processing method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5625764A (en) * | 1993-03-16 | 1997-04-29 | Matsushita Electric Industrial Co., Ltd. | Weighted average circuit using digit shifting |
US5914725A (en) * | 1996-03-07 | 1999-06-22 | Powertv, Inc. | Interpolation of pixel values and alpha values in a computer graphics display device |
-
1996
- 1996-06-03 US US08/657,402 patent/US5831604A/en not_active Expired - Lifetime
-
2000
- 2000-03-28 US US09/538,666 patent/USRE37476E1/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5625764A (en) * | 1993-03-16 | 1997-04-29 | Matsushita Electric Industrial Co., Ltd. | Weighted average circuit using digit shifting |
US5914725A (en) * | 1996-03-07 | 1999-06-22 | Powertv, Inc. | Interpolation of pixel values and alpha values in a computer graphics display device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1341151A2 (en) * | 2002-03-01 | 2003-09-03 | Broadcom Corporation | Method and apparatus for updating a color look-up table |
EP1341151A3 (en) * | 2002-03-01 | 2003-09-17 | Broadcom Corporation | Method and apparatus for updating a color look-up table |
US6819331B2 (en) | 2002-03-01 | 2004-11-16 | Broadcom Corporation | Method and apparatus for updating a color look-up table |
Also Published As
Publication number | Publication date |
---|---|
US5831604A (en) | 1998-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
USRE37476E1 (en) | Alpha blending palettized image data | |
US5793885A (en) | Computationally efficient low-artifact system for spatially filtering digital color images | |
US8791952B2 (en) | Method and system of immersive generation for two-dimension still image and factor dominating method, image content analysis method and scaling parameter prediction method for generating immersive sensation | |
US6897876B2 (en) | Method for transforming three color input signals to four or more output signals for a color display | |
Smith et al. | Blue screen matting | |
US5933253A (en) | Color area compression method and apparatus | |
EP0441558B1 (en) | Improvements relating to control data arrays | |
US6909438B1 (en) | Video compositor | |
US7667717B2 (en) | System and method for displaying images utilizing multi-blending | |
EP2309760A2 (en) | Method and apparatus for efficiently calculating multiprimary color conversion matrices | |
US5260695A (en) | Color map image fader for graphics window subsystem | |
US20040233217A1 (en) | Adaptive pixel-based blending method and system | |
JPH04246690A (en) | Method of displaying image having high quality by normal resolution | |
US6956581B2 (en) | Gamut mapping algorithm for business graphics | |
US20010014175A1 (en) | Method for rapid color keying of color video images using individual color component look-up-tables | |
JP3449860B2 (en) | Image sharpness processing device | |
US7671871B2 (en) | Graphical user interface for color correction using curves | |
US6525741B1 (en) | Chroma key of antialiased images | |
US6894720B2 (en) | Method and apparatus for applying tone mapping functions to color images | |
Morovic et al. | Evaluating gamut mapping algorithms for universal applicability | |
US5231385A (en) | Blending/comparing digital images from different display window on a per-pixel basis | |
US6456295B1 (en) | Method for simulating diffusion on a raster | |
US20070109314A1 (en) | Adaptive pixel-based blending method and system | |
US7834888B2 (en) | Mechanism for color-space neutral (video) effects scripting engine | |
JPH0715743A (en) | Method for separating foreground picture signal from combined picture signal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FEPP | Fee payment procedure |
Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
LAPS | Lapse for failure to pay maintenance fees |