100% found this document useful (1 vote)
5K views

1.9 Color and Gray Scale - Attributes of Output

This document is a lecture on color and grayscale levels in computer graphics. It discusses how color can be represented numerically and stored in a frame buffer or color table. It explains that the number of available colors depends on the amount of storage per pixel. Color tables allow indexing into a table of 24-bit RGB color values, providing millions of possible colors. Grayscale is also covered, where color values are mapped to a range from 0 to 1. Multiple choice questions review key points about color coding and storage.

Uploaded by

mani12345
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5K views

1.9 Color and Gray Scale - Attributes of Output

This document is a lecture on color and grayscale levels in computer graphics. It discusses how color can be represented numerically and stored in a frame buffer or color table. It explains that the number of available colors depends on the amount of storage per pixel. Color tables allow indexing into a table of 24-bit RGB color values, providing millions of possible colors. Grayscale is also covered, where color values are mapped to a range from 0 to 1. Multiple choice questions review key points about color coding and storage.

Uploaded by

mani12345
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Computer Science III B.

Sc CS Sem : VI Year 2019 - 2020

Subject: Graphics and Multimedia

Google Classroom : oefqdki Subject code: 63A

Attributes of Output Primitives


Unit 1: Color and Grayscale Levels
Dr.M.Manimaran,
Associate Professor,
Department Computer Science,
SKACAS
oefqdki - Graphics & Multimedia Unit I Output Primitives 1
Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

SNAP TALK / ATTENDANCE

oefqdki - Graphics & Multimedia Unit I Output Primitives 2


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Lecture Agenda
• Color and Grayscale Levels

Color Tables

Grayscale

oefqdki - Graphics & Multimedia Unit I Output Primitives 3


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

EXPECTED OUTCOME
After studying this class, you should be able to:

• To understand the concepts of Color and Grayscale Levels

• To understand the concepts of Color Tables

• To understand the concepts of Grayscale

oefqdki - Graphics & Multimedia Unit I Output Primitives 4


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


• Various color and intensity-level options can be made
available to a user, depending on the capabilities and
design objectives of a particular system.
• In a color raster system, the number of color choices
available depends on the amount of storage provided per
pixel in the frame buffer

oefqdki - Graphics & Multimedia Unit I Output Primitives 5


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


• Color-information can be stored in the frame buffer in
two ways:
– We can store color codes directly in the frame buffer
– We can put the color codes in a separate table and use
pixel values as an index into this table
• A minimum number of colors can be provided in this
scheme with 3 bits of storage per pixel, as shown in Table

oefqdki - Graphics & Multimedia Unit I Output Primitives 6


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


• Colors are represented by colors codes which are positive
integers.
• Color information is stored in frame buffer or in separate
table and use pixel values as index to the color table.
• In raster scan systemswide range of colors
• Random scan monitorsfew color choices.

oefqdki - Graphics & Multimedia Unit I Output Primitives 7


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


Color tables
• Each pixel can reference any one of the 256 table
positions.
• Each entry in the table uses 24 bits to specify the RGB
color.
• There are 17 million colors available .
• User can also set the color table entries in aPHIGS
application program with the function
• SetColourRepresentation(ws, ci, colorptr)
• Ws is a work station, ci as color index, colorptr points
RGB color values.

oefqdki - Graphics & Multimedia Unit I Output Primitives 8


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels

oefqdki - Graphics & Multimedia Unit I Output Primitives 9


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels

• 3 bits - 8 choice of color


• 6 bits – 64 choice of color
• 8 bits – 256 choice of color

oefqdki - Graphics & Multimedia Unit I Output Primitives 10


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


• setColourRepresentation (ws, ci, colorptr)
• Parameter ws identifies the workstation output device;
• parameter ci specifies the color index, which is the
color-table position number (0 to 255) and
• parameter colorptr points to a trio of RGB color values
(r, g, b) each specified in the range from 0 to 1

oefqdki - Graphics & Multimedia Unit I Output Primitives 11


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


Gray Scale
• 8 bits per pixel will allow 256 combination
• Dividing the actual code with 256 will give range of 0
and 1
• Ex:
– Color code in color display is 118
– To map to nearest grayscale then

oefqdki - Graphics & Multimedia Unit I Output Primitives 12


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


Gray Scale
• Apply for monitor that have no color
• Shades of grey (white->light grey->dark grey->black)
• Color code mapped onto grayscale codes
• 2 bits can give 4 level of grayscale

oefqdki - Graphics & Multimedia Unit I Output Primitives 13


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Color and Grayscale Levels


Grayscale
• Numeric values over the range from 0 to 1 can be used to
specify grayscale levels

oefqdki - Graphics & Multimedia Unit I Output Primitives 14


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Area fill Attributes


• Options for filling a defined region include a choice
between a solid color or a pattern fill and choices for
particular colors and patterns

oefqdki - Graphics & Multimedia Unit I Output Primitives 15


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Key Points
– Gray scale
– Color table
– SetColourRepresentation

oefqdki - Graphics & Multimedia Unit I Output Primitives 16


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
1. The color options are numerically coded with the following
values.
a) Ranging from 0 through the positive integer
b) Ranging from 0 to 1
c) Ranging from 0 to -0
d) Only c

oefqdki - Graphics & Multimedia Unit I Output Primitives 17


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
2. In color raster system, the number of color choices
available depends on
a) colors in frame buffer
b) Amount of storage provided per pixel in frame buffer
c) RGB color
d) Neither a nor b

oefqdki - Graphics & Multimedia Unit I Output Primitives 18


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
3. The color code “000” is for
a) White
b) Black
c) Blue
d) Green

oefqdki - Graphics & Multimedia Unit I Output Primitives 19


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ
4. Color information can be stored in
a) Main memory
b) Secondary memory
c) Graphics card
d) Frame buffer

oefqdki - Graphics & Multimedia Unit I Output Primitives 20


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

MCQ ANSWERS
1) Answer: a
Explanation: Color options can have any value from 0 to any
positive number.
2) Answer: b
Explanation: The amount of storage provided per pixels
in frame buffer provides verity range of colors.
3) Answer: b
Explanation: All zero means it is black color (the
mixture of red, green and blue).
4) Answer: d
Explanation: The frame buffer is a space that is used to
store the color information.

oefqdki - Graphics & Multimedia Unit I Output Primitives 21


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

VIDEO URL

https://www.youtube.com/watch?v=Wy03M_
V6Id8

oefqdki - Graphics & Multimedia Unit I Output Primitives 22


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

One mark URL

https://www.sanfoundry.com/computer-
graphics-mcqs-color-grayscale-levels/

oefqdki - Graphics & Multimedia Unit I Output Primitives 23


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

Next Lecture
Attributes of output primitives – Area fill
attributes and Character attributes

oefqdki - Graphics & Multimedia Unit I Output Primitives 24


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

DISCUSSIONS

oefqdki - Graphics & Multimedia Unit I Output Primitives 25


Computer Science III B.Sc CS Sem : VI Year 2019 - 2020

oefqdki - Graphics & Multimedia Unit I Output Primitives 26

You might also like