You are on page 1of 77

Overview of Computer Graphics

Graphics output technology may be split into two categories:


Non-permanent output to a screen Permanent output to a paper

Recently all devices are digital in nature:


Therefore, producing images become the process of setting individual points on the screen or on paper The points are laid out in a regular pattern on the output media.

For example, a screen may have 768 rows of 1024 points laid out in a rectangular array. The most popular output device : CRT which is a Raster Scan device. In a raster scan decide the picture is built up row by row from top to bottom of the image over a discrete set of points in each row with intensity applied at each point being set individually.

Examples
Laser writers (300, 600, 1200 individually addressable points per inch) Flat panel screens:
Light emitting diode devices Liquid Crystal Devices Plasma Panel Displays

Definitions
Scan Conversion: is the process of converting continuous graphics entities (e.g. a line joining two end points, into a discrete set of points on the display device to represent the line) Graphics Primitives and Attributes:
The usual set of basic primitives provided in graphics packages are:

A single point A line with given end points A polyline, i.e. a line joining a sequence of points A filled polygonal area with given points as vertices Text Additional (not essential) primitives such as rectangles, circles, curves of various types, images etc

Attributes: determines the appearance of a primitive on the output device For example, a line has the following attribute: color, width, style (full, dotted, dashed, etc)

Representations in graphics
Vector Graphics Image is represented by continuous geometric objects: lines, curves, etc. Raster Graphics Image is represented as an rectangular grid of coloured squares

Vector Display
Vector display (1960s) - vector system consists of: display processor (controller), display buffer memory CRT - The buffer stores the computer-produced display list or display program - Display program contains point- and point-plotting commands with (x, y, z) endpoint coordinates - The commands for plotting are interpreted by the display processor - The principle of vector system is random scan The beam is deflected from endpoint to endpoint, as dictated by the order of the display command - display list needed to be refreshed (e.g., 30Hz)

Raster Display
Raster display (since 1970s)
- Raster system consists of: display processor (input, refreshing, scan converting) video controller buffer memory (frame buffer) CRT - The buffer stores the primitive pixels, rather than display list or display program - Video controller reads the pixel contents to produce the actual image on the screen - The image is represented as a set of raster scan lines, and forms a matrix of pixels. - need refresh the raster display (e.g., 60Hz)

Graphics Packages
Graphics facilities are usually implemented a package of functions which can be linked to a users program. Low level: A line may be drawn by setting individual memory locations that represent the line on a raster scan display Higher level: Functions to draw the commonly available primitives and to set their attributes

Examples
Xlib: The device level functions in which the X window system is implemented Direct X: one of the Application Programming Interfaces (API) of the Microsoft Window System

(cont)
At a higher level:
GKS: Graphics Kernel System

Highest Level:
PHIGS: The programmers Hierarchical Interactive Graphics System OPEN GL: Microsoft API

Producing the Image (three basic processes)


Modeling: The process of producing the description of an object or of a scene.
We must have some definition of the properties of the object, e.g. its geometric properties such as a listing of its faces, edges, etc. Physical properties such as color. This totality of information is called the model

Viewing: Defines which particular view of the model is required. This involves indicating where a virtual camera should be placed and in which direction it should point.

Rendering: Producing the image on the output device. Includes:


Removing hidden surfaces Calculating the shade of visible surfaces Scan converting the graphics primitives (lines, polygons, etc) into corresponding sets of points on the display device.

Overview of Graphics Systems


Video Display Devices
Refresh Cathode-Ray Tubes (CRTs) Raster-Scan Displays Random-Scan Displays Color CRT Monitors Flat-Panel Displays

Refresh Cathode-Ray Tubes (CRT)

Refresh Cathode-Ray Tubes (CRT)


A beam of electrons emitted by an electron gun, passes through focusing and deflection systems that direct the beam toward specified positions on the phosphor-coated screen. Because the light emitted by the phosphor fades very rabidly, the refresh process is needed to maintain the picture on the screen.

Refresh CRTs - continued


Refreshing is done by redrawing the picture repeatedly by quickly directing the electron beam back over the same screen points. Refresh rate: the frequency at which a picture is redrawn on the screen.

Components of the Electron Gun :


1. The heated metal cathode 2. A control grid

Heat is supplied to the cathode by directing a current through a coil of wire (the filament) inside the cathode. This causes electrons to be boiled off the hot cathode surface. Then, the free, negatively electrons are then accelerated towards the phosphor coating by a high positive voltage.

Intensity of the electron beam is controlled by the voltage at the control grid. A high negative voltage applied to the control grid will shut off the beam. A smaller negative voltage on the control grid decreases the number of electrons passing through. The brightness of a display point is controlled by varying the voltage on the control grid.

The focusing system forces the electron beam to converge to a small cross section as it strikes the phosphor. Deflection of the electron beam can be controlled by the deflection coils. Spots of light are produced on the screen by the transfer of the CRT beam energy to the phosphor. Persistence: how long phosphors continue to emit light after the CRT beam is removed.

Persistence is defined as the time that it takes the emitted light from the screen to decay to one-tenth of its original intensity. Lower-persistence phosphors require high refresh rates to maintain a picture definition on the screen without flicker and they are useful for animation. Higher-persistence phosphors are useful for displaying highly complex, static pictures.

Few Notes
Any given phosphor has several different quantom-levels to which electors can be excited, each corresponding to a color associated with the return to an unexcited state. Phosphorescence is the light given off by the return of the relatively more stable excited electrons to their unexcited state once the electron beam excitation is removed. It is typically 10-60 microsecond.

More notes
As refresh rate decreases , flicker develops because eye can no longer integrate the individual light impulses coming from pixel.

The refresh rate above which a picture stops flickering and fuses into a steady image is called the critical fusion frequency.

A flicker free picture appears constant or steady


to the viewer. The longer the persistence, the lower the CFF. To see the continuously refreshed image without flicker the refresh rate has to be at least 60 c/s. To allow continuous refreshing of an image there must be some stored representation of the image from which the refresh system can obtain the graphical information required to redraw the image.

=> A set of values of intensity/color at each of a discrete set of points laid out in a rectangular array covering the screen.

Advantages:
It is possible to edit an image by changing the stored representation between refresh cycles for what appears to be instantaneous updating of the image. Animation

Resolution: the maximum number of points that can be displayed without overlap on the CRT. Resolution of the CRT is dependent on the type of phosphor, the intensity to be displayed, and the focusing and deflection systems. Typical resolution on high-definition systems is 1280 by 1024

Raster Scan
Raster scan methods have increasingly became the dominant technology since about 1975. The screen is coated with discrete dots of phosphor, usually called pixels or pels (picture elements), laid out in a rectangular array. The image is then determined by how each pixel is intensified.

The memory area holding the image representation is called the frame buffer (or refresh buffer) where a frame refers to the total screen area.

The values in the frame buffer are held as a sequence of horizontal lines of pixel values from the top of the screen down. The scan generator then moves the beam in a series of horizontal lines with fly-back (nonintensified) between the end of the frame and the beginning of the next frame.

Raster-Scan Displays
The electron beam is swept across the screen one row at a time from top to bottom. Each row is referred to as a scan line. Picture definition is stored in the frame buffer. This memory area holds the set of intensity values for the screen points. These stored values are then retrieved from the refresh buffer and used to control the intensity of the electron beam as it moves from spot to spot across the screen.

Define each of the following terms:

Horizontal retrace Vertical retrace

The scan is synchronized with the access of the intensity values held in the frame buffer. The maximum resolution is determined by:
The characteristics of the monitor Memory capacity available for storing the frame buffer

Aspect ratio: the number of horizontal points to vertical points necessary to produce equal-length lines in both directions on the screen. An aspect ratio of 4/3 means that a horizontal line plotted with four points has the same length as a vertical line plotted with three points. The range of colors that can be displayed on a raster system depends on both the types of phosphor used in the CRT and the number of bits per pixel available in the frame buffer.

For example, a system with 24 bits per pixel and a screen resolution of 1024 by 1024 requires 3 megabytes of storage for the refresh buffer. A bitmap image: a frame buffer with one bit per pixel. a pixmap image: a frame buffer with multiple bits per pixel. Typically refresh rates are 60 to 80 frames per second

Horizontal retrace: the return of the electron beam to the left of the screen after refreshing each scan line. Vertical retrace: the return of the electron beam to the top left corner of the screen to begin he next frame. On some raster-scan systems and TV sets, each frame is displayed in two passes using an interlaced refresh procedure.

In the first pass, the beam sweeps across every other scan line (even-numbered) from top to bottom. After the vertical retrace, the beam then sweeps out the remaining scan lines (odd numbered). Advantages of interlacing:
The screen is displayed in one-half the time taken by the other method. Used with slower refresh rates to avoid flicker.

An effective technique provided that adjacent scan lines contain similar display information. More about scan conversion:
The conversion of continuous quantities to discrete quantities can cause aliasing errors such as stair case effect.

Random-Scan Displays
The electron beam directed only to those parts of the screen where a picture is to be displayed. Sometimes called: store-writing or calligraphic displays. Picture definition is stored as a set of linedrawing commands. Draws all the component lines of a picture 30 to 60 times each second, with up to 100,000 short lines in the display list.

Designed for line-drawing applications and they cannot display realistic shaded scenes. A pen plotter operate in a similar way. Draws the components lines of an object in any order specified. Have higher resolution than raster-scan systems. Produce smooth line drawing.

Refresh rate on a random scan system depends on the number of lines to be displayed.

Picture definition is now stored as a set of linedrawing commands in an area of memory referred to as the refresh display file. Other names: display list, display program or refresh rate A set of commands

After all line drawing commands have been processed, the system cycles through the set of commands in the display file.

All component lines of a picture are drawn 30 to 60 times each second When a small set of lines is to be displayed each refresh cycle is delayed to avoid refresh rates greater than 60 frames per second.

Advantages:
For line drawing applications Higher resolution than raster scan systems Smooth lines

Disadvantages:
Cannot display realistic shaded scenes Faster refreshing of the set of lines could burn out the phosphor

Adv & Dis of Raster Graphics


Advantages:
Inexpensive: Many facilities, e.g. filled areas, pattern, colors, shaded images etc. can be used to produce realistic images Because it is a refresh type system, it may be used for image amendment and animation by changing the contents of the frame buffer between refresh cycles The refresh process is independent of the image complexity

Disadvantages:
Every graphical output primitive has to be scan converted before display Aliasing errors, e.g. stair case effect Increasing resolution is expensive => more memory

Full-Color (RGB) Displays


For 24 bit color:
store 8 bits each of red, green, and blue per pixel. E.g. (255,0,0) is pure red, and (255, 255, 255) is white. 2^24 = 16 million colors.

For 15 bit color: 5 bits red + 5 green + 5 blue The video hardware uses the values to drive the R,G, and B guns.

Color Lookup Table


A single number (e.g. 8 bits) stored at each pixel.
Used as an index into an array of RGB triples. With 8 bits per pixel, you can get the 256 colors of your choice

Deeper Frame Buffers


Some frame buffers have 96 or more bits per pixel. What are they all for? We start with 24 bits for RGB. Alpha channel: an extra 8 bits per pixel, to represent transparency. Used for digital compositing. Thats 32 bits. A Z-buffer, used to hold a depth value for each pixel. Used for hidden surface 3-D drawing. 16 bits/pixel of z brings the total to 48 bits. Double buffering:
For clean-looking flicker-free real time animation. Two full frame buffers (including alpha and z). Only one at a time is visibleyou can toggle instantly. Draw into the back buffer (invisible), then swap. Can be faked with off-screen bitmaps (slower.) 2 x 48 = 96.

Display Resolution
X Windows term Meaning

PseudoColor colormapped with color display (8 or 4 bit) High Color RGB (15=5+5+5 or 16=5+6+5 bit) True Color, Direct Color RGB (24=8+8+8 bit)
Spatial resolution: The maximum number of points that can be displayed without overlap on a CRT. Higher resolution gives a shaper image Intensity or color resolution depends on
frame buffer resolution display H/W characteristics sampling method

Display Processor
Raster graphics system with a dedicated display processor

Interlacing
Lower refresh rates result in flickering, which is the visually discernible disruption of light intensity on screen. An acceptable refresh rate is determined by the acuity of the human vision. Refresh rate must be matched with the excitement persistence of phosphor coating. Interlacing
a usual frame display rate : 60 Hz divide a frame into even-numbered scan lines and oddnumbered scan-lines(each 1/60 sec)

whole frame takes 1/60 + 1/60 = 1/30 sec Recently, progressive scan is becoming popular

Flat Panel Displays


Plasma-panel (gas-discharging) displays Liquid crystal displays Comparison to CRT
Thin, light Flicker free Narrower color gamut

Output Devices
Stereoscopic viewing glasses: the user wears them to perceive stereoscopic view of 3D scenes displayed on screen
Used in screen-based Virtual Reality (VR) Has high resolution Limited head-movement

Head-mounted display (HMD): two small TV screens are embedded in a rack and placed in front of the two eyes.
It allows full-freedom head movement, and gives the feel of immersion Widely used in Virtual Reality (VR) A tracking system is used to report the position of HMD in 3D space.

Plotter Printer

Output Devices
Wide Screen

Input Devices
Keyboard Mouse Trackball: a 2D input device, usually used on a mouse or a lap-top computer. Space ball: hand held, non-movable. It uses a strain gauge to detect pull, push, and twist applied to the ball, and translate them into 3D locations. Used for navigation in virtual environments, CAD, etc. Head Mounted Display: Although it is primarily a display device, it can also track position and orientation Joystick: similar to the space ball. Can be movable and non-movable.

Input Devices
Data glove: a glove with sensors. Used to control a virtual hand for grasping, dropping, and moving an object in a virtual environment. Image scanner: input still picture, photo, or slides as images into computer. Touch panel: highly transparent and embedded over a display surface. Digital camera: directly stores photo shots as images on a diskette. Digital video recorder: input a video clip in digital form; often used for tele-conferencing. Laser range scanner: input discrete and scattered points on a 3D surface model from which a digital one can be built.

Input Devices
Motion Capture: input fullbody, facial, hand movements

Motion Capture
Reptile capture Breakdance Dynamic duo

Graphics Rendering Pipeline


Rendering: the conversion of a scene into an image 3D Scene 3D Scene render
2D Image

Scene is composed of models in 3D space. Models are composed of primitives supported by graphics packages such as OpenGL. Models entered by hand or created by a program

Graphics Rendering Pipeline

Modeling (local) coordiantes World coordinates Normalized (device-independent) coordinates Device (screen) coordinate

Functions of a Graphic Package


Graphics Library such as Core, OpenGL, DirectX
Provide primitives for graphic description Build and maintain graphic representation models Provide primitives for viewing operations Support user interaction with application program Interact directly with users to allow them modify viewing parameters, if possible

Graphics System

API

CGI (Computer Graphics Interface)

Graphics system: a library of graphics functions

General Graphics Packages


Graphics packages are device-independent Official Standards
Core: ACM SIGGRAPH 1977, U.S. GKS : ANSI85, 2D, Europe GKS-3D : ANSI88 PHIGS : ANSI88 - Hierarchical structures PHIGS+ : ISO 92

Non-official Standards
X Window System, PEX Silicon Graphics OpenGL (1992) Open Inventor Microsoft DirectX Sun Mircorsystems VRML

Bit-Mapped vs. Object-Based


Painting programs
bit-mapped representation e.g., Adobe Photoshop, bitmap fonts

Drawing programs
object-based representation e.g., Powerpoint, outline fonts

Bit-Mapped Graphics
Bit-mapped memory - represent graphical images and patterns by assigning a block of memory for the direct storage of the intensity patterns Objectiveness of a line, polygon, or brush stroke is lost Limitations
pixel democracy - all pixels are created equal once, they are set in a bit-mapped image no support of images requiring precision or numerical dimensioning device dependency

Object-Based Graphics
Mathematical representation of lines, rectangles, ovals, polynomial curves, and so on. Objectiveness is maintained
Objects designed may have a hierarchical structure Easily editable

Difficulties
the representation is more complex

Image File Formats


GIF (Graphics Interchange Format)
the CompuServe Information Service and F&R Block Company copyrighted bitmap format uses compression can store only 256-color images, any size

Image File Formats


TIFF (Tag-based Image File Format)
Aldus Corp. and Microsoft to support digital scanner manufacturers and desktop publishing systems to describe and store raster image data run-length encoding with compression. independent of OS, processors, compilers, and filing systems become a standard for image storage and communication

Image File Formats


JPEG
international compression standard (1992) high compression rate can be acquired by removing the following redundancy in an image:
spatial (between neighboring pixels), spectral (between color planes), temporal (between adjacent frames in a sequence)

highly lossy compression But, objectionable blocking artifacts may occur. poor lossless compression efficiency (less than 3) lossy compression method is limited to input images with maximum bit depth of 8bits/pixel. lossless support 2 to 16 bits/pixel. no support for true-color

Image File Formats


JPEG 2000
new international compression standard (2002.1) significantly higher compression efficiency than JPEG new functionalities:
integrated lossy/lossless compression region-of-interest(ROI) encoding Multi-resolution capability progressive decoding

Image File Formats


EPS (Encapsulated PostScript)
Adobe Systems Incorporated importing and exporting PostScript language files grayscale or color usually ASCII No compression can be mix of raster and geometric data

Graphics pipeline

User

Edit Model Map Geometry, colour

Screen

Display

Interactive Computer Graphics

User

input Application

Screen

image

You might also like