1 Introduction to Computer Graphics
T. Raghuveera
Objectives:
- To get introduced to the world of Computer Graphics by Basic Terminology.
- To understand the Graphic Types (Raster and Vector).
- To know about the types of Coordinate Systems used.
- Keywords – Resolution, Refresh Rate, Color Depth, Scan Conversion, Graphics Standards.
Topics covered:
- Basic terminology
- Important Definitions
- Display Processor
- Raster and Vector Graphics
- Coordinate Systems
- Graphics Standards
Basic Terminology:
- PIXEL DIMENSIONS
- RESOLUTION
- ASPECT RATIO
- REFRESH RATE
- SCANNING MODES
- DOT PITCH
- COLOR DEPTH
- VIEWING ANGLE
- SCAN CONVERSION
- Graphics Systems
- Graphic types
- Graphics Software standards
- Coordinate systems
What a graphic is?
Definition:
Anything that we see on a display device is a picture or a graphic. The subject deals with storage, representation, display and manipulation of pictorial information.
Pixel Dimensions:
Number of pixels along the width and number of pixels along height
Ex: 320×240, 640×480, 1366X768
A pixel is a picture element. Monitor is a collection of pixels in a rectangular array. The number on the left indicates the pixels along the width which is generally higher and the number of the right indicates the pixels along the height. (Mobile phone displays are on the opposite pixel dimension order i.e. their displays are more taller than wider)
Ex: Display standards
VGA (Video Graphics Array) – 640×480
SVGA (Super Video Graphics Array) – 800 x 600
XGA (Extended Graphics array) – 1024 x 768
HDTV (High Definition TV) – 1920 X 1080, 1280 X 720 Progressive
Let’s try to understand the difference between Pixel dimensions and resolution. Both are not the same. The number of pixels we can pack in an inch space constitutes resolution. That means a high resolution image has more number of pixels packed in an inch space, while a low resolution image has few pixels packed in the same inch space. We can pack more information in a high resolution display than in a low resolution display. Some standard resolution ex: 76ppi, 80 ppi etc.,
Printers too have resolutions which are measured in dpi (say 2000 dpi, 3000 dpi etc.,) which are far higher than monitor resolutions. The quality of a picture is determined by resolution not by pixel dimensions.
ASPECT RATIO:
Ratio of width to height
Some standard aspect ratios are ex: 4:3, 16:9
These settings can be commonly noticed on Television displays.
REFRESH RATE / FRAME RATE:
It is the Number of frames scanned in one second (frames per second-fps) Unit – Hz Ex: 60 Hz, 75 Hz
Every display device has a refresh rate. When a display device has to throw information onto the screen it displays and redraws same information at a rate of 60 times a second or 70 times a second and so on, which is called the refresh rate measured in Hz.
Each line on the display (scan line) is scanned horizontally from left to right and there is a horizontal retrace (shown in dotted line-horizontal ), which is simply repositioning the electron gun so that it starts displaying from the start of the second row, and this continues till the last scan line is scanned. At this point a frame is considered to be completely scanned. Then there is a vertical retrace (shown in dotted line – vertical), where the electron gun is repositioned at the left corner to repeat the scanning process again.
For monitors (CRT) this can be changed to a convenient setting at 70 Hz. Human eye is more sensitive to changes in refresh rates, while low refresh rates say at 60 Hz tend to give more strain on the eye, high refresh rates tend to consume more power and waste processing resources. So we need to check for an appropriate refresh rates which are generally at 70 or 75 Hz.
Scanning Modes:
Interlaced Scanning:
Human eyes are sensitive to flicker which is due to low refresh rates. This technique is used to increase refresh rate. In the first pass all odd lines are scanned and in the second pass all even lines are scanned. i.e., in two passes the whole of the screen is drawn. One frame is thus scanned in two passes. For ex: assume a screen with 30 Hz monitor that means each frame takes 1/30 sec. Due to interlacing only half of the frame gets refreshed in one pass. i.e., half frame takes 1/60th of a second, giving the users a feeling of higher refresh rates. Our monitors bear spec. that talks about ‘interlaced’ or ‘non-interlaced’.
Ex: HD – 1920 x 1080 i (i –interlaced)
The ‘i’ by the side indicates ‘interlaced’
Progressive scanning:
It’s a technique used to display high quality images. First all the coarse details (imp. Details that make up the picture) are displayed and subsequently the finer details are displayed. The image gets clearer with a time delay. Ex: HD – 1920 x 1080 p (p – progressive)
When we buy Televisions (flat), from a nearby shop, the spec says 1080 p. What does that mean to the buyer? It means, that it is HD standard with the number of the left is a default 1920 and it is a 1920X1080 monitor, with a progressive scanning mode.
The progressive scan is relatively better in quality when compared to interlaced scan. Being a progressive scan based device, they are relatively costlier.
Dot Pitch:
Distance between centers of two successive dots/pixels measured in mm. ie. A color pixel is made up of 3 phosphor dots (Red, Green, Blue) arranged in the shape of a triangle called Triad. What we see as color of pixel is the combined effect of the three phosphorous dots of a pixel. i.e., we see white, when all the three dots are lit at their maximum intensity level.
The smaller the dot pitch the higher the resolution and vice versa.
Color Depth:
It is defined as the Number of bits per pixel measured in bpp. The number of colors that a display device can reproduce depends on the number of bits assigned to a pixel.
Ex: 24 bpp, 32 bpp
i.e. 224 colors are possible for a 24 bpp monitor / display device.
VIEWING ANGLE:
It is the angle between the display surface and the line connecting the viewer’s eye with the display device. Human eye has viewing angles both along horizontal and along vertical. On some monitors some colors appear differently for different viewing angles, thereby creating a bad viewing experience.
For flat devices, there is limit to the viewing angle for acceptable viewing.
Display Processor:
Graphics display processor is a hardware that enhances the graphics capability of the machine. Ex: NVidia graphics card. A graphics card has a memory in itself called the Display processor memory. Frame buffer stores the information about the picture to be displayed on the monitor screen. Both Display Processor memory and frame buffer are of same size and both have the same information. The display processor has the implementation of algorithms necessary to create picture elements. It converts a picture definition in the form of a program into equivalent pixel intensity values and this process is called “scan conversion”.
Scan Conversion:
It is the process of converting or digitizing a picture definition given in an application program into a set of pixel intensity values.
Types of Graphics Systems (based on how a picture is displayed):
Raster and Random scan
In Raster type a frame is scanned completely (irrespective of the picture) starting at the top left corner and ending at the bottom right corner.
In Random type only the part of the frame that contains the picture definition is scanned.
Graphic types:
There are two ways of ways of representing a graphic. A Raster Graphic type or Vector Graphic type.
- Raster or Bitmap: matrix or rectangular array of pixel values
- Vectors: combination of mathematical objects and equations
Difference between Raster and Vector:
If a raster graphic is created using 640×480 pixel dimensions, then it is best viewed only on a display device with the same pixel dimensions, i.e. if we alter the dimensions of the display device and still try to view the image, we get to have a distorted view of the image. That is why a raster image is resolution/pixel dimension dependent. When we stretch a raster image, it gets distorted and pixelated.
A high quality raster image uses more pixels and thus the file size is big, because of its direct relationship with the number of pixels used.
If there is 640X480 and 80 ppi image, how much physical space does it occupy? Ans: 8’X6’
Vector Graphic: Any picture definition is stored as a set of mathematical equations. A picture is made up of many mathematical objects / elements like points, lines, arcs, triangles, etc. These are resolution independent. Even if we stretch the image to any size, its quality does not get disturbed.
Graphics software standards:
- A software standard is a set of algorithms defined for drawing graphics
- These are programming language independent specs.
- A language binding is also specified. For example OpenGL has language binding with C++. What does that mean? We can download the required libraries of OpenGL with C++ and install them. Once installed we can include these libraries in the header of a C++ program, and from within C++ program we can call OpenGL statements.
Ex: GKS(Graphics Kernel System), PHIGS (programmers hierarchical interactive Graphics standard), CGI (Computer Graphics Interactive), VRML (Virtual Reality Markup Language), OPENGL (Open Graphics Library), SVG (Scalable Vector Graphics), DirectX.
Graphics Programming:
- OpenGL (Open Graphics Library)
- DirectX
- Cg (Graphics for C)
- VRML (Virtual Reality Markup Language)
- FRAN (Functional Reactive Animation)
- PROCESSING
- ALICE
- JAVA
Every program we write in graphics deals with coordinate systems. Here transformations happen between coordinate systems. Particularly in 3D Graphics, the study of coordinate systems will be quite useful. Consider for ex: 3D studio Max or Maya, we drag and drop basic objects from the menu into the view. We resize them i.e. set various properties like width, height, radius, length etc., after this we will be repositioning the object depending on our chosen viewing position. The next step is give the objects, shading, texturing, lighting, shadowing, etc. followed by rendering. In this process, the coordinates get transformed from one coordinate system to the other;
A coordinate system is a reference frame / position in space. Image an object needs to be created. For this we drag and drop an inbuilt object on to a position in the viewing space. The centre of the object is the origin of the modelling / local coordinate system with respect to which the object is manipulated. From the centre three mutually perpendicular directions emerge completing the modelling coordinate system. We can then change other attributes like size, orientation, etc., i.e. every object has got its own local coordinate system, with respect to which it can be manipulated. When may such objects are constructed and positioned with respect to a common coordinate system or reference frame (world coordinate system), the objects assume world coordinates. When we define a viewing position / frame in space and if we attempt to measure the objects with respect to this new position, the objects assume viewing coordinates and finally the device coordinates in the device coordinate system. Right from modelling till it is shown on a display device, many transformations happen from one coordinate system to the other.
Summary:
- Outlined the different Basic Terminology and definitions of Computer Graphics.
- Explored the types of Graphic
- Background theory behind using and converting between coordinate systems.
you can view video on Introduction to Computer Graphics |