1 Lecture 6 Attributes of graphical primitives Colors Colors in OpenGL Algorithms for scan-conversion.

Slides:



Advertisements
Similar presentations
The Electromagnetic Spectrum
Advertisements

Presented by: Stacy C. Lovell. How do we perceive color? Our eyes contain only 3 types of photosentitive cells tuned to three frequencies Red, Green,
Color Physics –Light is E-M radiation of different frequencies. –Superposition principle Perception –3 cones -> 3D color space. (Metamers). –Convex subset.
Aalborg University Copenhagen
Chapter Twenty-Five: Light 25.1 Properties of Light 25.2 Color and Vision 25.3 Optics.
Fundamentals of Digital Imaging
Informationsteknologi Monday, October 29, 2007Computer Graphics - Class 21 Today’s class Graphics programming Color.
School of Computing Science Simon Fraser University
Colour Theory and Application B.Sc. (Hons) Multimedia ComputingMedia Technologies.
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
What is color for?.
CSc 461/561 CSc 461/561 Multimedia Systems Part A: 2. Image.
1 Perception. 2 “The consciousness or awareness of objects or other data through the medium of the senses.”
Color of (digital image) Raed S. Rasheed Agenda Color. Color Image. Color Models – RGB color model. – CMYK color model. – HSV and HSL color model.
Color Models AM Radio FM Radio + TV Microwave Infrared Ultraviolet Visible.
Color in OpenGL (Chapter 4) Presented by: Stacy C. Lovell.
Color & Color Management. Overview I. Color Perception Definition & characteristics of color II. Color Representation RGB, CMYK, XYZ, Lab III. Color Management.
Color Model AbdelRahman Abu_absah Teacher: Dr. Sana'a Alsayegh.
1 Internet Graphics. 2 Representing Images  Raster Image: Images consist of “dots” of color, not lines  Pixel: Picture element-tiny rectangle  Resolution:
COLOR MODELS Ramya Sarma Anusha Holla
Course Website: Digital Image Processing Colour Image Processing.
Digital Image Processing Colour Image Processing.
CS 376 Introduction to Computer Graphics 01 / 26 / 2007 Instructor: Michael Eckmann.
Digital Images The digital representation of visual information.
C O L O R S PRINT VS MULTIMEDIA. Main Difference Print –Primary Colors CMYK Cyan, Magenta, Yellow, Black - Subtractive Color system –Add together = black.
Color Definitions Graphic Design. There are tens of thousands of colors at designers’ disposal, and almost infinite ways of combining them.
Human Eye and Color Rays of light enter the pupil and strike the back of the eye (retina) – signals go to the optic nerve and eventually to the brain Retina.
Color Management. How does the color work?  Spectrum Spectrum is a contiguous band of wavelengths, which is emitted, reflected or transmitted by different.
And Elvis said ……… ……Let there be Light The Visible Spectrum.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Week 6 Colour. 2 Overview By the end of this lecture you will be familiar with: –Human visual system –Foundations of light and colour –HSV and user-oriented.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
Waves How do we see color?
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Introduction to OpenGL. OpenGL is a low-level graphics library specification. It makes available to the programmer  a small set of geometric primitives.
A color model is a specification of a 3D color co-ordinate system and a visible subset in the co-ordinate System within all colors in a particular color.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
Light and Color. Light basics Photons: –tiny wave-like particles of light –carry energy Light travels in –Rays: straight-line path of light in a vacuum.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Value The art element that describes the darkness or lightness of a color.
Digital Image Processing In The Name Of God Digital Image Processing Lecture6: Color Image Processing M. Ghelich Oghli By: M. Ghelich Oghli
Introduction to Computer Graphics
Color Models. Color models,cont’d Different meanings of color: painting wavelength of visible light human eye perception.
Color Web Design Professor Frank. Color Displays Based on cathode ray tubes (CRTs) or back- lighted flat-screen Monitors transmit light - displays use.
1 Graphics CSCI 343, Fall 2015 Lecture 5 Color in WebGL.
Colors of Pigment The primary colors of pigment are magenta, cyan, and yellow. [
Elements of Design 1.02 Investigate Design Principles and Elements.
Physics 1 H Created by Stephanie Ingle
Intro to Color Theory. Objectives Identify and discuss various color models including RGB, CMYK, Black/white and spot color. Investigate color mixing.
Digital & Interactive Media
BASIC COLOUR COURSE Algemeen
1.02 Color Here we go AGAIN!. A chart used to choose colors—helps you choose colors that look good together. Color Palette.
Color and Color for the Web First, discuss idea of color (some overlap with lecture on HVS) First, discuss idea of color (some overlap with lecture on.
22.3 Using Color pp Mr. Richter. Agenda  Warm-Up  Review HW  Notes:  How We See Objects  Mixing Pigments (The Subtractive Color Process)
Chapter 4 -- Color1 Color Open GL Chapter 4. Chapter 4 -- Color2 n The goal of almost all OpenGL applications is to draw color pictures in a window on.
Chapter 4: Color in Image and Video
Light Part Four: The Colors of White. Hiding within a pure beam of white light, sits all the colors of the rainbow. As they are all mixed together, we.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
The Col o r of Light – Notes inverselyThe wavelength and frequency of EM waves are inversely proportional (c = f). Seven types of electromagnetic radiation.
Computer Graphics: Achromatic and Coloured Light.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Do Now Question: Why/how do you think we see colors? CRO Format 5/11.
Design Concepts: Module A: The Science of Color
COMS 161 Introduction to Computing
Colour The Elements of Design.
Light Light has wave-like properties
Primitive Objects Lecture 6 Wed, Sep 5, 2007.
Color and Shading Lecture 9 Mon, Sep 26, 2005.
Color Model By : Mustafa Salam.
Color Models l Ultraviolet Infrared 10 Microwave 10
Presentation transcript:

1 Lecture 6 Attributes of graphical primitives Colors Colors in OpenGL Algorithms for scan-conversion

2 Colors  It is difficult to explain colors: they should be experienced.  Color is nothing more that wavelengths of light at a certain frequency.  Actually, the human eye is only said to perceive a small fraction of the total light available.  Certain lights called Gamma Rays, X-rays, and Ultraviolet lights are too low of a frequency for humans to see.  Lights like Infrared, Microwaves, and Radio waves, are too high of a frequency for the human eye to see.  Humans only see a small portion of light between these frequencies and we calls these lights color.

3 Colors  The color of an object is evident by the amount of light it reflects.  For example, a red apple reflects mostly red light, and absorbs mostly all other colors.  The color white is obtained when all colors are reflected off an object (no colors absorbed) giving the object appearance of white.  Black is the absorption of all colors. It is not considered as a color.  Black is considered the absence of color, and therefore is not allowed to join its color family.

4 Colors: RGB Model  There are different ways to choose color for your drawing.  The easiest and most powerful way is to use RGB color.  RGB color stands for Red, Green, and Blue, and is called additive color.  It is given this name because RGB starts with the absence of color, and then adds elements of red, green, and blue to achieve the desired color.

5 Colors: RGB Model  It is not possible to obtain all colors with RGB model, or with any other color model. RGB just matches a color as close as possible.  Usually there are 256 different values for each red, green, and blue. This also means that there are about 16.7 million different colors available (256*256*256 = 2 8 * 2 8 * 2 8 ).  Some systems and languages, such as OpenGL, uses a similar idea with RGB color, except that they may use numbers from 0.0 to 1.0.  Theoretically this means that there is an infinite amount of colors formed from RGB because there is an infinite amount of numbers between 0 and 1.

6 Colors RGB model

7 Colors RGB Color cube

8 Colors CMY model

9 Colors CMY cube

10 Colors HSV model (hue, saturation, value): used by artists Called also HSL model (L-light) Hue: the name that we give to a color: red, yellow, cyan, etc. Saturation: “how pure the color is”, that is how far is a hue from the same hue mixed with white so that the color has more pastel shade Value/Light - how bright the color appear

11 Colors HSV model (hue, saturation, value)

12 Levels of Gray Levels of gray/colors: instead of 0/1 more digits

13 Levels of Gray Reducing the levels of gray: Original scanned picture

14 Levels of Gray Reducing the levels of gray: Three bits per pixel

15 Levels of Gray Reducing the levels of gray: One bit per pixel

16 Color palette Color table (palette)

17 Colors in OpenGL  OpenGL uses RGB color model  The values of red, green, and blue are numbers from 0.0 to 1.0.

18 Colors in OpenGL  The instruction glColor3f( float red, float green, float blue ) sets a color.  The syntax is the same as in the sample program for drawing a triangle.  Problem: Draw 5 triangles with different colors. Write the values of RGB and the color obtained.

19 Colors in OpenGL  Syntax of OpenGL instructions: FunctionName2i or FunctionName3f  2 or 3 means number of parameters: 2 or 3  i - integer values, f- float values, d-double values.  All the following instructions will give the same color - red: glColor1f( 1.0 ); glColor1d( 1.0 ); glColor4i( 1, 0, 0, 0 );

20 Colors in OpenGL  There is an optional fourth value in the color definition called the alpha value.  Alpha values are used for displaying different effects, e.g., blending, transparency, lighting and shadows.  OpenGL may interpolate different colors.  Problem: Use the sample triangle program and assign different colors for each vertex. Describe the result.

21 Colors in OpenGL glBegin( GL_TRIANGLES ); // Begin a triangle glColor3f( 1.0, 0.0, 0.0 );// Red color glVertex3f( 0.25, 0.25, 0.0 ); glColor3f( 0.0, 1.0, 0.0 );// Green color glVertex3f( 0.75, 0.25, 0.0 ); glColor3f( 0.0, 0.0, 1.0 );// Blue color glVertex3f( 0.75, 0.75, 0.0 ); glEnd(); // End the triangle

22 Scan-Conversion

23 Triangle Scan-Conversion

24 Simple Algorithm

25 Inside Triangle Test

26 Inside Triangle Test

27 Triangle Sweep-Line Algorithm

28 Triangle Sweep-Line Algorithm

29 Polygon Scan Conversion

30 Inside Polygon Rule

31 Polygon Sweep-Line Algorithm

32 Polygon Sweep-Line Algorithm

33 FloodFill Algorithm

34 Scan Conversion of Polygons: Hardware Conversion