7> N93" 20k73 - NTRS - NASA

0 downloads 0 Views 694KB Size Report
The human eye can distinguish hundreds of thousands of different .... was chosen as 100 times the number of nodes (colors), or 25,600. However, to improve the ...
;,'7>

i

..__¢

.J

N93"

i Compression

of Color-mapped A.C.

University

Images*

Hadenfeldt

of Nebraska

Omaha,

20k73 //J

Medical

Nebraska

Center

68198

and K. Sayood Department Center

of Electrical and

for Communication University

Engineering

and Information

Science

of Nebraska-Lincoln

Lincoln,

NE 68588

Telephone: (402) 472-6688 FAX: (402) 472--4732 email:

COMSOC

Technical

[email protected]

Committee:

Signal Processing

Hot topic session

and Communication

number:

Electronics

HT28

Abstract

In a standard data, especially schemes

image coding

scenario,

if the image is a natural

(e.g., DPCM)

to perform

pixel-to-pixel

correlation

scene. This correlation

efficient

compression.

In a color-mapped

in the pixel array are no longer

directly

which

are numerically

may point to two very different

(close)

still exists,

but only via the colormap.

reintroduce

the structure.

resulting

structure

In this paper

to the pixel intensity.

This fact can be exploited we study the sorting

can be used in both lossless

always

exists in the

is what allows predictive

stored

adjacent

related

nearly

image,

coding

the values

Two color indices

colors.

The correlation

by sorting the color map to

of colormaps

and lossy compression

and show how the

of images.

" This work was supported by the NASA Goddard Space Flight Center (NAG 5-1612) and the NASA Lewis Research Center (NAG 3-806).

3

Compression

of Color-mapped

Images _ A.C. Hadenfeldt

°

1 Introduction

Many lower-cost

image display systems

there has been considerable images, the compression The human depending

attention

on viewing

a means of displaying

devoted

of color-mapped

eye can distinguish conditions

use color-mapped

to the compression

images

hundreds

of thousands

similar

of different

is illustrated

While

and fuLl-color

attention.

colors

(also called true-color)

Such a system

displays.

of monochrome

has not received

[1]. A fuU-color

this wide range.

(or pseudo-color)

in a color space,

frame buffer

in Figure

provides

1.

!"!!

,iii iii t1|

Analog voltages

t I tt--

_

iil_i | IL.

IIII I

IIIIII

I II

IIIII111111111tltl )llllllllllllJllll

I

I lttlllllllllltllllpt , IIIItlllllltll_lillf llllllltltlllllililii

Bit Planes

NN_NI

I

/

t ! I |

t I _ I 1 I I ! I I I _ _

CRT _reen Figure Many applications If a fuU-color display

of digital images benefit is used, an application

Also, the images

involved

on a mass-storage

device.

These applications

1 Full-Color

naturally

A smaller amount of image memory The values stored

may become

in memory

of storage

solution

too costly to implement space, whether

or color-mapped

of those found on personal

is required,

are used as indices

to be effective. practically.

in display memory

or

is needed.

lead to the pseudo-color

Figure 2. This type of display is typical

Buffer

from, or require, color capabilities

require large amounts A less expensive

Frame

one-third

frame buffer, shown in

computers

that of the fuU-color

into a 24-bit

and workstations. system example.

table, the colormap.

Compression

of Color-mapped

hnages

_ A.C. Hadenfeldt

°

Each entry in the colormap the pixel. These three values

consists

are then passed

guns of the CRT, as with fuU-color small number of colors

colormap,

a large variety

full-color

display

of images

of

DACs to the red, green, and blue electron

The color-mapped

(224 for this example).

system

in the figure,

By careful

can be displayed,

allows the display

which can be selected

selection

often with quality

of a

of the colors approaching

in the

that of a

system.

q_

i!!!

I_

+

I

I

I , _ _

I I I :.,,

liii

IIII

I

system.

through

for the red, green, and blue portions

at a time, 2 s for the system shown

from a larger set of colors

I

of 8-bit vaIues

ill!

iiil

i l,

II1_

III

:::

,

liii

I I

il;;

--_

....

II" II IIII

III

8 bits

i

GI B

/--'_ --_

II

Colormap BitPlanes

I I I I IIit IIII

_ I I I I tllll iliti

IllI

ILil

Ill!

]III

lllliiil iii

ItL=

lilI)!()

IIII III

IIIl:::: ttll

_ _ _ ;

:::

lll

IIII

....

::::

"'

'""Ill

!

I "

II

i

iitl II ....

I

..

iI.

iii V

CRT_reon

Figure

2 Color-Mapped

The use of the colormap, however, of this can be obtained quantities

were computed

are listed in Table

1.

by calculating

disguises the zero-th

using the index arrays

Frame

Buffer

the spatial structure

in the image.

and first order entropies

An indication

of the image.

These

for the four test images shown in Figure 3, and

Compression

of Color-mapped

hnages-

Table

The large values values

1 Entropies

of the Source Ito

IIt

Lena

7.617

7.413

Park

7.470

7.797

Omaha

7.242

7.165

Lincoln

5.916

6.674

of H1 in the table verify

of selecting

quantization

implies

that the color

in, for example,

index

an achromatic

in which

image,

to what might be encountered

resultant Since

errors

were introduced

images were of poor subjective

quantization

schemes

2 Colormap

Sorting

In the previous

become

section,

The root of these problems

several

Colon'nap as vectors, dimensional

problems

coding

is defined

function

at best,

in the image are more

To further

index

critical

verify this, an experiment bit of a color-mapped

values

were quantized.

and often completely

coding

unique

schemes,

The

unrecognizable.

the available

to color-mapped

choices

for

images

were discussed.

indices stored in the image have little relationship

for progressive

optimization

as foUows.

vector space and a distance

a.{, find an ordering

image.

due to the color

transmission.

In this section,

methods

are discussed.

sorting is a combinatorial

the problem

stored

pixel

are also relatively

The data compression

values

source

is that the colormap

this relationship

of/'/o

in the least significant

quality

in the image

limited.

with each other, which complicates of restoring

correlation

The values

if the color

is a part of many popular

compression

process.

an 8-bit colon-nap.

was conducted similar

that the spatial

by the color-mapping

large, a direct result process

Images

Image

has been reduced

than similar values

A.C. Hadenfeldt

L(k)

Given

measure

which

problem.

a set of vectors

d(i,j)

minimizes

Treating

defined

{ax,a2,

between

the total distance

the K colormap ...,a_c}

entries

in a three-

any two vectors

ai and

D:

K-1

D=

,IC Ck),

+ i))

O)

-

Compression

of Color-mapped

The ordering function Another possibility is, the colormap by/_,(1).

Images

L is constrained

by L(K)

In this case, an additional

The sorting problem

complete

of possible

only for K no greater

exactly

second

were tested.

is an algorithm annealing

described

in more detail

has performed

was chosen

L*a*b*

were investigated.

Three

to the color primaries

would

selected

since they provide

2.1 Sorting

give similar

results a means

Using Simulated

Simulated annealing basis for the technique of materials implementation

as they

images.

were not considered,

measure

[3][6]

discussed

is necessary.

in Section

as simulated

2.1. The annealing.

in this work,

and is

Euclidean

were selected:

distance,

and different

the NTSC RGB space,

color

the CIE

space. The NTSC RGB space was chosen since it corresponds

of the original

the NTSC RGB space

a local minimum

approach

for the colormaps

to be (unweighted)

color spaces

space, and the CIE L*u*v*

method

are computationally

for locating

known

to be NP-

2.2.

The distance metric d was chosen spaces

technique,

D.

- 1)!][4]. Algorithms

these algorithms

well in practice,

as the sorting

in Section

is known

such as K = 256, another

first is a "greedy"

formula

problem, and is identical

is 1/2[(I(

algorithms

That

to the entry specified

the problem

to consider

[4][5]; however,

colormaps

The

which

Simulated

As such,

than about 20. Efficient

exist [4] for K < 145. For large

salesman

{1, ..., K}.

as a ring structure.

is added to the distance

travelling

orderings

of integers

to be adjacent

L(1))

as a ring structure.

[3], and the number

Two techniques

is now considered

is similar to the well-known

is considered

of the sequence

entries is considered

term of d(L(K),

exist which can solve the problem feasible

to be a permutation

results when the list of colormap

entry specified

if the colormap

_ A.C. Hadenfeldt

Color spaces

which can be linearly transformed

since the use of an unweighted

for such a color to measure

space.

perceptual

The

Euclidean

to

distance

two CIE color spaces

were

color differences.

Annealing

is a stochastic

technique

comes from thermodynamics are cooled.

The

technique

in [6].

4

for combinatorial

and observations described

minimization.

concerning

in this section

The

the properties

is based

on the

Compression

of Color-mapped

To illustrate move

freely

molecules

this concept,

with respect

(cooled

consider

A.C. Hadenfeldt

an iron block.

to each other.

will be locked

annealed

Images _

together

very slowly),

If the block

in a high-energy

the molecules

energies

is characterized

is quenched

state.

lattice

which

by the Boltzmann

the iron molecules

(cooled

very quickly),

On the other hand,

will tend to redistribute

energy, with the result being a lower energy molecular

At high temperatures,

if the block

themselves

is much stronger.

the

as they lose

The distribution

of this distribution

will have a high energy.

In a combinatorial

can be used to temporarily

allow increases

achieve

(2)

and k is Boltzmann's

is that even at low temperatures,

of

distribution:

P( E) ~ e-z/kr where E is the energy state, T is the temperature,

is

there

optimization

constant.

The significance

is some probability

that a molecule

situation,

in the cost function,

the Boltzmann

distribution

while still generally

striving

to

a minimum.

Solving minimizing annealing, algorithm

the

colorrnap

sorting

problem

the sum of the distances an initial

path through

then proceeds

1. Select

3. If AN

the colors. (colors)

T and a cooling

new path by perturbing

in path cost, AE

> 0, randomly

number

selecting

each

color

To find a solution

is chosen,

only

once

while

using simulated

and its cost computed.

as follows:

a temporary

the change

between

the nodes

an initial temperature

2. Choose

involves

decide

r from a uniform

= E_w whether

factor

a.

the current path (see below),

- Eola. If AE

< 0,

or not to accept

distribution

in the range

and compute

accept the new path.

the path.

Generate

a random

[0, 1), and accept

the new path

for I iterations.

Then, "coor'

if r < exp(-AE/T). 4. Continue

to perturb

the system

the path at the current

by the cooling

factor:

Tn_,

temperature

= c_Told. Continue

iterating

using

the new

at a particular

temper-

temperature. 5. Terminate ature.

the algorithm

when no path changes

are accepted

The

Compression

of Color-mapped

The decision-making process

process

function.

annealing

to the path which

method

to avoid easily

Hence, the algorithm

For the images space used.

algorithm

of this work,

to improve

to the choice

was chosen

the execution

path changes

Also, a method

to occur too slowly

speed of the algorithm

were made using the suggestions to the path are made, chosen

of Lin [4][6].

at random.

removes

The simulated

as values outside

or too quickly.

The number

of nodes (colors),

the range

of iterations

or 25,600.

suggested

on the

annealing

of this value,

However,

by [6] was added,

if (10)(number

of nodes) = 2560

In this work, the perturbations one of two possible

The first is a path transport,

a segment

in the path, but with the nodes

point in the path. at random.

of the current

in reverse

order.

which removes

The location

The second

path and reinserts

The location

and length

changes a segment

of the segment,

perturbation

method,

it at the same point of the segment

are

chosen.

The algorithm outlined problem.

structure.

the case,

allowing

in the previous

This type of problem

desires

ring-like

both structures

as 0.9.

At each iteration,

point are chosen

and the new insertion

the salesman

chosen

the path must be selected.

its length,

salesman

for

of the cost

from 80 to 500, depending

to the next temperature

it at another

randomly

in a local minimum

an improvement

of the current path and reinserts

again

it possible

are made at a given temperature.

for perturbing

called path reversal,

trapped

as 100 times the number

to proceed

Note that the decision

its cost. This makes

of T ranged

to be most sensitive

which causes the algorithm successful

initial values

_x was usually

the cooling

algorithm.

to the initial path choice.

factor

[0.85, 0.95] caused per temperature/"

increase

being

is less sensitive

The cooling

seemed

-- A.C. Hadenfeldt

is known as the Metropolis

will allow some changes

the simulated

color

Images

paragraphs usually

to return to the original However,

the simulated

the colormap

were

formulates

assumes

city).

Hence,

annealing

to be considered

conducted.

6

colormap

a complete

tour will be made (i.e.,

the colormap

technique

sorting as a travelling

is assumed

to have a

can also be used if this is not

as a linear list structure.

Experiments

using

-

Compression

of Color-mapped

3 Colormap

Sorting

and

Images

Lossless

_ A.C. Hadenfeldt

Compression

The results of sorting the colormaps in the following

of the test images using simulated

tables. Table 2 shows results

for sorting the colormap

while Table 3 shows the results of sorting the colormap are values for the resulting

first-order

Table 2 Resultant Image

entropy Images

as a circular

as a linear structure.

With Circularly

Sorted

are shown

ring structure,

Given in the tables

and the final path cost (the distance

RGB Space

measure

D).

Colormaps

L*a*b Space

L*u*v*

Space

Name

Cost

Ht

Cost

Ht

Lena

13.88

5.641

857.80

5.627

208.49

5.480

Park

19.32

6.325

1609.46

6.330

310.41

6.218

Omaha

11.04

6,209

1081.82

6.303

363.21

6.178

Lincoln

10.62

5.513

1193.88

5.831

224.06

5.478

Table 3 Resultant

Images

L*a*b

Cost

I/1

Lena

II.68

5.575

Park

15.66

Omaha Lincoln

the colormap first-order

847.29

5.933

200.3I

5.512

6.260

1509.25

6.775

292.29

6.546

10.81

6.532

1004.69

6.554

283.66

6.199

10.61

5.774

1177.80

6.120

204.64

5.735

entropy//o

the frequency

of the resultant

images

results,

space

between

sorting

colormap

by the sorting

of occurrence

indicate

in each case.

the L*u*v*

differences

is not changed

The sorting if entropy

quality, the second

In terms of lossless

goal stated

compression,

previously.

the sorting

reduction

color.

The lower

correlation

between

(the first goal stated above) is with the added advantage

has been considered.

We examine

has resulted 7

of a particular

since permuting

results for the NTSC RGB space show

gives better results, entries

process,

that some of the spatial

from this sort should also be able to accept quantization

subjective

Space //1

that sorting in this space yields good

the perceptual

L*u*v* Cost

color indices has been restored

the goal. However,

H1

Colormaps

Space

Cost

entries does not change

entropies

Sorted

Cost

//1

Note that the zero-order

images

With Linearly

RGB Space

Image Name

-

annealing

errors

Hence, while

that

the resultant

maintaining

good

this further in the next section.

in a drop of 2 bits per pixel for the

Compression

of Color-mapped

Images _

A.C. Hadenfeldt

Lena image and 1 to 1.5 bits per pixel for the other images.

For a 512x512

to a savings of between

32,768 to 65,536

For a large database

could

saving.

be a considerable

4 Coiormap

Sorting

and Lossy

The sorting of the colormap

bytes

per image.

restores

some perceptual

subjective

the three least significant

results were obtained

8-bit original.

quantizing

the Park image to 5 bits/pixel,

list in L*u*v*

before

the sorted

not be assumed

(compressed between distances

image.

In some cases,

and decompressed)

those pixels

would correspond

compress

them using particular

the Discrete

Cosine Transform

4.1 DCT Coding

in shading

of Color-mapped

and after sorting.

The

5 shows the result of

properties

the original

image.

A caveat meaning,

as an eight-

and reconstructed

In the monochrome

might be overlooked

lend themselves

Pulse

case large

by the viewer.

to lossy compression

lossy compression

Code Modulation

we

techniques,

(DPCM).

Images

with the unsorted

colormap

color map. As can be seen from the figure, the original

that remains is seemingly

Good

there might be a drastic change in color

of two popular

and Differential

it

from the

has been sorted.

the same

between

which

images

implementations

In Figure 6 we coded the Lena image the unsorted

to have

if the distance

color-mapped

(DCT)

Park images.

indices have more perceptual

and reconstructed

to changes

To see how well the sorted

the eight-bit

indices is large enough,

in the original

sense. Therefore

the image. To verify this

space. Figure

and after the color'map

between

bit monochrome

destroying

indices in the

levels down to as low as 5 bits/pixel

is in order here. While the distance image should

without

for the Park image, before

shown was sorted as a linear

colonnap

to the colormap

bits of the L*u*v*-sorted

using quantization

Figure 4 shows the colormap

sorted colormap

structure

value are also close in some perceptual,

should be possible to introduce errors into the indices we dropped

of images this

Compression

sense that indices close in numerical

hypothesis,

image this translates

random colors.

at two bits per pixel using image is totally lost and all

It should be noted that for eight-bit

8

monochrome

images,

Compression

of Color-mapped

Images _

A .C. HadenfeMt

DCT coding at two bits per pixel generally

provides

a reconstruction

which is indistinguishable

from the original. In Figure 7 we show the same image, this time with the sorted color map, coded per pixel with the fixed bit allocation.

[7] The

images

in Figure

bit per pixel using the JPEG [8] algorithm, l Note that while allocation

shown in Figure 7 is far superior

annoying

artifacts.

minimizes

This is because

the average

the color-mapped

to the image

of the nonadapdve

sensitive

The JPEG algorithm

adapts

Therefore,

in Figure

is coded

4.2 DPCM

Coding

Standard

of Color-mapped

especially

edges,

In monochrome

which may be acceptable

the prediction images

of large errors in individual

its bit allocation

for certain

while it

blocks.

As

for the low

on a block-by-block

at half the rate of the image

of the quantization

error is always

output alphabet

to entropy

bounded

images.

is problematic

is generally values

because

large,

result

However,

colors.

by the use of a recursively

the quantizer

error

application.

avoids t.his problem

to the coding of color-mapped

images

these noise

values will result in splotches of different

indexed by _.

Another

in color-mapped

quantizer

This attribute advantage

without

leading

in a blurred

The Edge Preserving

can be kept small

basis.

in Figure

7

to large overload look around edges, images these noise

DPCM (EPDPCM)

[9,10], makes

system

in which the magnitude it ideal for application

of the EPDPCM

incurring

in the busy regions

overload

system is that, as error, the output

is

coding.

Results using the EPDPCM system

are shown

coded at a rate of 2 bits per pixel, while the image

1

which,

Images

DPCM coding of color-mapped

noise values.

amenable

nature of the algorithm

superior quality.

still provides

of images,

8(b) which

the image coded using the fixed bit

to large errors, this could account

quality reproduction. the image

8 were coded at two and one

in Figure 6 there are still quite a few

error, may permit the introduction

images are particularly

at two bits

in Figure in Figure

10. The image

in Figure

10(a) was

10(b) was coded with 1.35 bpp.

The IPEG coded images were coded using software from the independent JPEG foundation.

Compression

of Color-mapped

The advantage and higher speed. is generaUy

Images _ A.C. Hadenfeldt

of DPCM However,

significantly

systems

over transform

the reconstruction

higher

coded image is actually

coded image. Thus using the EPDPCM and speed,

and reconstruction

systems

not the case for the sorted

quality of the two-bit EPDPCM

systems

quality obtained

than that of DPCM

10(a) and 8(a), this is obviously

coding

system provides

is their low complexity

using transform

at a given

rate.

colormapped

somewhat

higher

advantages

coding systems

Comparing

images.

Figure

In fact, the

than the two-bit DCT

both in terms of complexity

quality.

5 Conclusion

In this paper amenable

we have shown

to both lossless

that use of sorted

and lossy compression.

dictates

the use of DCT coding

DPCM

coding

colormaps

makes

color-mapped

images

For lossy compression

conventional

wisdom

However,

for color-mapped

images

Computer

Graphics:

for most types of images.

might be more advantageous.

6 References

[1] Foley, J.D., van Dam, A., S.K. Feiner, and Practice [2] Graphics June

(Second

Interchange

Edition), Format

Reading,

MA: Addison-Wesley,

(GIF) Specification,

CompuServe,

Principles

1990. Inc.,

Columbus,

OH,

1987.

[3] Aarts, E., and J. Korst, Simulated Wiley

and Sons,

Journal, [5] Bellman, Princeton

pp.

Solutions

2245-2269,

R.E.,

Annealing

and Boltzmann

Machines,

New York: John

1989.

[4] Lin, S., "Computer

-

and J.F. Hughes,

and

University

of the Traveling

December

S.E.

Dreyfus,

Press,

1962.

Salesman

Problem,"

Bell System

Technical

1965. Applied

10

Dynamic

Programming,

Princeton,

NJ:

Compression

of Color-mapped

Images u

[6] Press, W.H., B.P. Flannery, C, New York: [7] Iayant,

ACM, [9] Rost,

Cambridge

G.K., '_'he

34(4):31--44,

University

April

Sayood,

IEEE Transactions

Coding

Numerical

Recipes

in

1988.

of Waveforms, compression

Prentice-Hall,

standard,"

1984.

Communications

of the

1991. "An Edge Preserving

on Image Processing,

K. and S. Na.

and W.T. Vetterling,

Press,

JPEG still picture

M.C. and K. Sayood,

IEEE Transactions [10]

S.A. Teukolsky,

N.S. and P. Noll, Digital

[8] Wallace,

A.C. Hadenfeldt

"Recursively

on Information

Differential

1:250-256, Indexed

Theory,

Coding

Scheme,"

1992.

Quantization

IT-38,

11

April

Image

November

of Memoryless 1992.

Sources,"

Compression

of Color-mapped

Images -- A.C. Hadenfeldt

List of Figures

Figure

1. Full-Color

Frame

Figure 2. Color-Mapped Figure

3. Test Images

Figure

4. Colorrnap

Buffer

Frame

Buffer

for Park Image

Figure 5. Park image

quanfized

(a) before

and (b) after sorting

to five bits per pixel

with (a) unsorted

and (b) sorted

colormaps Figure

6. Lena image

with unsorted

colormap

coded

at two bits per pixel using

IPEG

DCI _ algorithm Figure 7. Lena image

coded at two bits per pixel using DCT with fixed bit allocation

Figure

coded

8. Lena JPEG

Figure Figure

9. DPCM

image

at (a) two bits per pixel

and (b) one bit per pixel

using

and (b) 1.35 bits per pixel

using

algorithm structure

10. Lena image EPDPCM

coded

at (a) 2 bits per pixel

12

F Lgure

3 .

Test

I mag

e'_

PI_EGEDING

PAGE

BLANK

NOT

FILMED

_, ..... ;: :i!:? :i_::ii:e:_!:_Lf!:

Figure

4.

Colormap

for

Park

image

(a)

before

and

(b)

after

sorting

Figure

5.

Park image quanitzed to five bits unsorted and (b) sorted colormaps

per

pixel

with

(a)

m

Figure

6.

Lena pixel

image using

with JPEG

unsorted colormap DCT algorithm

coded

at

two

bits

per