Top Banner
June 20, 2022 1
51

COMPUTER GRAPHICS

Jan 05, 2016

Download

Documents

stash

UNIVERSITY OF KUFA. EDUCATION COLLEGE. COMPUTER GRAPHICS. Lecture #1 Introduction. Assoct.Prof . DR. NIDHAL EL ABBADI. E-mail : [email protected]. Textbooks: Title: Computer Graphics Author: D. Hearn & M. Baker Publisher: Prentice Hall, 2000 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COMPUTER GRAPHICS

April 20, 2023 1

Page 2: COMPUTER GRAPHICS

Textbooks:

Title: Computer Graphics

Author: D. Hearn & M. Baker

Publisher: Prentice Hall, 2000

In addition to the above, the students will be provided with handouts by the lecturer.

April 20, 2023 2

Page 3: COMPUTER GRAPHICS

Allocation of Marks

Assessment Instruments Mark

First examination 20 %

Second examination 20 %

Final Exam (written unseen exam) 50 %

Reports, assignments, Quizzes, Home works, Tutorials 10 %

Total 100%

Assessment Instruments

April 20, 2023 3

Page 4: COMPUTER GRAPHICS

DEFINTION OF Computer Graphics

almost everything on computers that is not text or soundA branch of computer science that deals with the theory and techniques of computer image synthesis. Computers produce images by analyzing a collection of dots

Creating computer graphics requires: -A digital computer to store and manipulate images -A display screen -Input/output devices -Specialized software that enables the computer to:

• Draw• Color• and manipulate images held in memory

Page 5: COMPUTER GRAPHICS

• Visualize your imagination in computers

• Computer graphics = reality + imaginationApril 20, 2023 5

Page 6: COMPUTER GRAPHICS

Why Computer graphics

• Graphics is cool– I like to see what I’m doing– I like to show people what I’m doing

• Graphics is interesting– Involves simulation, algorithms, architecture…

• Almost no area in which graphical displays cannot be used

April 20, 2023 6

Page 7: COMPUTER GRAPHICS

Why should we study Graphics?

• Many of the leading scientists through the ages have been ‘visual thinkers’…

– Leonardo da Vinci– Einstein– Clerk Maxwell

April 20, 2023 7

Page 8: COMPUTER GRAPHICS

April 20, 2023 8

Page 9: COMPUTER GRAPHICS

Areas of computer graphics

•Geometry (Modeling)•Rendering•Motion (Animation)

April 20, 2023 9

Page 10: COMPUTER GRAPHICS

Modeling: creating and representing the geometry of objects in the 3D world

• Representations of geometryο Curves: splinesο Surfaces: meshes, splines

• Procedural modelingο Sweepsο Fractalsο Grammars

April 20, 2023 10

Page 11: COMPUTER GRAPHICS

Rendering: (light, perspective) generating 2D images of the objects

• 3D Rendering Pipelineο Modeling transformationsο Viewing transformationsο Hidden surface removalο Illumination, shading, and textures ο Scan conversion, clippingο Hierarchical scene graphicsο OpenGL

• Global illuminationο Ray tracingο Radiosity

OpenGL

April 20, 2023 11

Page 12: COMPUTER GRAPHICS

Animation: (movement) describing how objects change in time

• Keyframingο Kinematicsο Articulated figures

• Motion captureο Captureο Warping

• Behaviorsο Planning, learning, etc.

April 20, 2023 12

Page 13: COMPUTER GRAPHICS

•Video games

•Cartoons•Film special effects•CAD/CAM•Simulation•Medical imaging•Scientific & Information visualization

Applications of Computer Graphics

April 20, 2023 13

Page 14: COMPUTER GRAPHICS

Graphics Applications

Entertainment: Cinema

April 20, 2023 14

Page 15: COMPUTER GRAPHICS

Graphics Applications

Entertainment: Games

April 20, 2023 15

Page 16: COMPUTER GRAPHICS

Film Special Effects

•Lord of the rings•King Kong

April 20, 2023 16

Page 17: COMPUTER GRAPHICS

Graphics ApplicationsMedical Visualization

April 20, 2023 17

Page 18: COMPUTER GRAPHICS

Surgical Simulation

April 20, 2023 18

Page 19: COMPUTER GRAPHICS

Medical Imaging

MedicView

April 20, 2023 19

Page 20: COMPUTER GRAPHICS

Graphics Applications

Scientific Visualization

April 20, 2023 20

Page 21: COMPUTER GRAPHICS

Graphics Applications

Computer Aided Design (CAD)

April 20, 2023 21

Page 22: COMPUTER GRAPHICS

Curve and Surface Modelingin Computer-Aided Design (CAD)

12 3

4

5

6

78

April 20, 2023 22

Page 23: COMPUTER GRAPHICS

Information Visualization

April 20, 2023 23

Page 24: COMPUTER GRAPHICS

Weather Data Visualization

Mars Data Visualization

Scientific Visualization

April 20, 2023 24

Page 25: COMPUTER GRAPHICS

Simulation / Virtual Reality (VR)

FlightSafety International Beech 1900D Simulator, at the Orlando Training CenterApril 20, 2023 25

Page 26: COMPUTER GRAPHICS

How are images generated?

April 20, 2023 26

Page 27: COMPUTER GRAPHICS

April 20, 2023 27

Page 28: COMPUTER GRAPHICS

pixel The basic unit of the composition of an image on a television screen, computer monitor, or similar display.

(PIX [picture] ELement) Generally, the smallest addressable unit on a display screen or bitmapped image Screens are rated by their number of horizontal and vertical pixels; for example, 1024x768 means 1024 pixels are displayed in each row, and there are 768 rows (lines). Likewise, bitmapped images are sized in pixels: a 350x250 image has 350 pixels across and 250 down.

With color systems, each pixel contains red, green and blue subpixels, and the subpixel is actually the smallest addressable unit. The monitor's circuits address subpixels, and the software may also

Page 29: COMPUTER GRAPHICS

In remote sensing, an element of a picture; the basic unit from which an image may be built up. Pixels can be taken from an area of 5m 2 to 10 km2, or more. Pixel information for band or brightness varies according to the sensor system used

April 20, 2023 29

Page 30: COMPUTER GRAPHICS

• The pixel is the smallest addressable screen element.

• It is the smallest unit of picture that can be controlled.

• Each pixel has its own address.

• The address of a pixel corresponds to its coordinates.

• Pixels are normally arranged in a two-dimensional grid, and are often represented using dots or squares.

• Each pixel is a sample of an original image; more samples typically provide more accurate representations of the original

• The intensity of each pixel is variable

• In color image systems, a color is typically represented by three or four component intensities such as red, green, and blue, or cyan, magenta, yellow, and black

Pixels Properties

April 20, 2023 30

Page 31: COMPUTER GRAPHICS

Pixel Coordinate Systems

Pixels (1,5), (1.8,7.1), etc.

April 20, 2023 31

Page 32: COMPUTER GRAPHICS

This example shows an image with a portion greatly enlarged, in which the individual pixels are rendered as little squares and can easily be seen

A photograph of sub-pixel display elements on a laptop's LCD screen

April 20, 2023 32

Page 33: COMPUTER GRAPHICS

A pixel does not need to be rendered as a small square. This image shows alternative ways of reconstructing an image from a set of pixel values, using dots, lines, or smooth filtering

April 20, 2023 33

Page 34: COMPUTER GRAPHICS

The more pixels used to represent an image, the closer the result can resemble the original.

Standard display resolutions

The display resolution of a digital television or display device is the number of distinct pixels in each dimension that can be displayed

The term "pixels" can be used in the abstract, or as a unit of measure, in particular when using pixels as a measure of resolution, such as: 2400 pixels per inch, 640 pixels per line, or spaced 10 pixels apart.

April 20, 2023 34

Page 35: COMPUTER GRAPHICS

Bits per pixelColor depth

• 1 bpp, 21 = 2 colors (monochrome) • 2 bpp, 22 = 4 colors • 3 bpp, 23 = 8 colors

• 8 bpp, 28 = 256 colors

• 16 bpp, 216 = 65,536 colors ("Highcolor" )

• 24 bpp, 224 ≈ 16.8 million colors ("Truecolor")

The number of distinct colors that can be represented by a pixel depends on the number of bits per pixel (bpp).

The measures dots per inch (dpi) and pixels per inch (ppi) are sometimes used interchangeably, but have distinct meanings, especially for printer devices, where dpi is a measure of the printer's density of dot (e.g. ink droplet) placement

April 20, 2023 35

Page 36: COMPUTER GRAPHICS

April 20, 2023 36

Page 37: COMPUTER GRAPHICS

April 20, 2023 37

Page 38: COMPUTER GRAPHICS

April 20, 2023 38

Page 39: COMPUTER GRAPHICS

Megapixel

A megapixel (MP or Mpx) is 1 million pixels, and is a term used not only for the number of pixels in an image, but also to express the number of image sensor elements of digital cameras or the number of display elements of digital displays

3.1 megapixels" (2048 × 1536 = 3,145,728).

April 20, 2023 39

Page 40: COMPUTER GRAPHICS

Name Megapixels Width x Height

CGA 0.06 320×200

EGA 0.22 640×350

VGA 0.31 640×480

SVGA 0.48 800×600

XGA 0.79 1024×768

SXGA 1.31 1280×1024

UXGA 1.92 1600×1200

WUXGA 2.30 1920×1200

Selected standard display resolutions include:

April 20, 2023 40

Page 41: COMPUTER GRAPHICS

Pixel Structures

In storage, pixels are made up of one or more bits. The greater this "bit depth," the more shades or colors can be represented. The most economical system is monochrome, which uses one bit per pixel (on/off). Gray scale and color typically use 4 to 24 bits per pixel, providing 16 to 16 million colors

Displaying the Pixel

On a display screen, pixels are either phosphor or liquid crystal elements. For monochrome, the element is either energized fully or not. For gray scale, the pixel is energized with different intensities, creating a range from light to dark. For color displays, the red, green and blue subpixels are each energized to a particular intensity, and the combination of the three color intensities creates the perceived color to the eye

April 20, 2023 41

Page 42: COMPUTER GRAPHICS

April 20, 2023 42

Page 43: COMPUTER GRAPHICS

The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors

A representation of additive color mixing. Projection of primary color lights on a screen shows secondary colors where two overlap; the combination of all three of red, green, and blue in appropriate intensities makes white

COLORS

April 20, 2023 43

Page 44: COMPUTER GRAPHICS

o Zero intensity for each component gives the darkest color (no light, considered the black), and full intensity of each gives a white

o When the intensities for all the components are the same, the result is a shade of gray, darker or lighter depending on the intensity

o When the intensities are different, the result is a colorized hue, more or less saturated depending on the difference of the strongest and weakest of the intensities of the primary colors employed.

o When one of the components has the strongest intensity, the color is a hue near this primary color (reddish, greenish, or bluish).

o When two components have the same strongest intensity, then the color is a hue of a secondary color (a shade of cyan, magenta or yellow).

o A secondary color is formed by the sum of two primary colors of equal intensity: cyan is green+blue, magenta is red+blue, and yellow is red+green

April 20, 2023 44

Page 45: COMPUTER GRAPHICS
Page 46: COMPUTER GRAPHICS

There are two major types of 2D graphics used by designers:

Raster images are also commonly known as bitmaps and are composed of pixels in a grid.

Vector images are composed of paths creating individual, scalable objects. These objects are defined by mathematical equations to render high quality graphics. Vector graphics consist of lines, curves, and shapes with editable attributes such as color, fill, and outline

raster (or bitmap)

vector images.

Page 47: COMPUTER GRAPHICS

When increasing the size of a raster image the pixels defining the image can be increased in either number or size. The image will begin to lose detail and clarity when the pixels are spread over a larger area. Scanned graphics and web graphics are the most common forms of raster images.

• Vector-based Images are Resolution Independent

Changing the attributes of a vector graphic does not affect the graphic itself. You can change any number of the graphic attributes without destroying the basic image. Because they’re scalable, vector-based images are resolution independent. You can increase and decrease the size of vector images to any degree and your lines will remain crisp and sharp, both on screen and in print.

April 20, 2023 47

Page 48: COMPUTER GRAPHICS

• Raster-based Images Are Resolution Dependent

The resolution of an image is usually stated in dpi (dots per inch) or ppi (pixels per inch). Raster images are displayed on your computer screen at approximately 100 ppi. When printing raster images, your printer needs much more image data than a monitor. To render a bitmap image accurately, the typical desktop printer needs 300-600 dpi. The quality of the print increases when a higher resolution is used.Bitmaps cannot be scaled without the loss of quality to the image. Because raster images are resolution dependent, it's difficult to increase or decrease their size without sacrificing the overall quality. The image may appear clear on screen, but once printed the loss of quality is more apparent as the image may appear pixelated or blurry.

April 20, 2023 48

Page 49: COMPUTER GRAPHICS

• When To Use Vector Images

Wherever possible use the vector format for all your type, line art and illustrations. Vector images are very useful when developing something for scale or sending to a printing company and are ideal for logo design and illustration. A disadvantage is that vector images are unsuitable for producing photo-realistic imagery

• When To Use Raster Images

Raster images are best used for photographs and images with subtle shading. This graphic type is useful when editing, manipulating, or adding special effects to an image. Raster images should not be used when transparent backgrounds are preferred or on images where high quality needs to be maintained once the image is scaled.

April 20, 2023 49

Page 50: COMPUTER GRAPHICS

int gdriver = DETECT , gmode ; // auto detectioninitgraph ( &gdriver, &gmode, “\\tc\\bgi “ ); // graph initialization

cleardevice() ; // clear a graphics screenclosegraph() ; // close a graphics screen

#include<graphics> // using in header

Important Instructions with C++

To draw pixel in (x, y) coordinate with specific color, use the instruction:

void putpixel (int x, int y, int color);

April 20, 2023 50

Page 51: COMPUTER GRAPHICS

Any question?

April 20, 2023 51