CSE 232 Spring 2003 - PowerPoint PPT Presentation

About This Presentation
Title:

CSE 232 Spring 2003

Description:

each 8-bit number is an index into a color look up table. can change colors without changing image ... by the closest one of a set of 256 triples in color table; ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 8
Provided by: good4
Learn more at: http://www.cse.msu.edu
Category:
Tags: cse | by | color | number | spring

less

Transcript and Presenter's Notes

Title: CSE 232 Spring 2003


1
CSE 232 Spring 2003
  • Notes on the color table and indexed color concept

2
General idea
  • Images can consume a large amount of storage
    space in main or disk memory
  • Gray scale or labeled image needs only small
    integer pixels (0, 255 range is good)
  • RGB color image can be 3X as large
  • Can use a color table to convert an integer label
    L to color code RL, GL, BL
  • Just need to make a table so that color codes
    can be obtained using index L

3
Color table cheaper graphics
  • image has 8-bit pixels
  • each 8-bit number is an index into a color look
    up table
  • can change colors without changing image

512 x 512 RGB image with 3x8-bit color values
requires 750K Bytes. 512 x 512 8-bit codes 256K
Bytes 256 x 3x8-bit color table 257K Bytes
4
Color Table concept
int pixel image (P2)
Color table
RGB pixel image (P3)
5
GIF image format imagetable (plus other stuff)
  • header information
  • color table
  • image pixels (up to 8 bits each) LZW compressed
  • RGB data is stored in the color table and NOT
    in the image pixels themselves
  • get good compression and ability to quickly
    change the colors
  • there are only 256 different colors for any
    single image, but table RGB triples can be
    changed
  • gif files are very good for line drawings

6
ColorTable ADT
  • model is an ADT array of up to 256 colors
  • array index is an int in 0, 255, which well
    call a pseudo color or color index
  • operations are create, destroy, add new entry,
    (see P2 specs for others)

7
Types of compression
  • Lossless no information is lost every bit of
    the original image can be recovered.
  • if an image has no more than 256 different color
    triples in it, then color table can exactly
    recreate it.
  • Lossy information is approximated the original
    image cannot be recovered exactly.
  • Suppose there are 1000 color triples in the
    original image but we replace each by the closest
    one of a set of 256 triples in color table
  • e.g. (218, 58, 150) ? (220, 60, 150)
Write a Comment
User Comments (0)
About PowerShow.com