Grafik Komputer : Pendahuluan Dr. Mohammad Iqbal

TOT Dosen D3-MI Universitas Gunadarma 2012 (21Sep2012)

2 of 75

Introduction

“One picture is worth more than ten thousand words” Anonymous

3 of 75

Buku Referensi 1. [DON96] Donald H and M. Pauline Baker, Computer Graphics Principle and Practice in C, 2nd Edition, Addison Wesley, 1996 2. [SAM03] Samuel R.Buss, 3-D Computer Graphics A Mathematical Introduction with OpenGL, Cambridge University Press, 2003 3. [GON02] Rafael C. Gonzales and Richard E. Woods, Digital Image Processing, 2nd Edition, Prentice Hall, 2002 4. [PRAT01] William K. Pratt, Digital Image Processing, 3rd Edition, Addison Wesley, 2001 5. [ACH05] Acharya Tinku, K. Ray Ajoy, Image Processing: Principles and Application, John Wiley & Son, 2005 6. [ION93]Pitas, Ioannis. 1993. Digital Image Processing Algorithms. Prentice Hall International (UK) Ltd

4 of 75

Konten Hari ini Akan membahas: – Apakah Grafik Komputer ? – Tipe Citra Dalam Grafik Komputer – Apa yang Mendorong Grafik Komputer ? – Area Fokus Komputer Grafik – Utilitas Grafik Komputer

5 of 75

Apakah Grafik Komputer ? What is Computer Graphics? • Creation, Manipulation, and Storage of geometric objects (modeling) and their images (rendering) • Display those images on screens or hardcopy devices • Image processing • Others: GUI, Haptics, Displays (VR)...

6 of 75

Tipe Citra dalam Komputer Grafik Examples of presentation graphics 1.

2. 3.

2D computer graphics • Pixel art (raster graphics) • Vector graphics 3D computer graphics Computer animation Raster graphic sprites (left) and masks (right)

2D computer graphics

2D computer graphics are the computer-based generation of digital images—mostly from two-dimensional models, such as 2D geometric models, text, and digital images, and by techniques specific to them. The word may stand for the branch of computer science that comprises such techniques, or for the models themselves.

7 of 75

Tipe Citra dalam Komputer Grafik Examples of presentation graphics •

2D computer graphics are mainly used in applications that were originally developed upon traditional printing and drawing technologies, such as typography, cartography, technical drawing, advertising, etc..

Pixel art (raster graphics ) „ Pixel art is a form of digital art, created through the use of raster graphics software, where images are edited on the pixel level. Graphics in most old (or relatively limited) computer and video games, graphing calculator games, and many mobile phone games are mostly pixel art.

8 of 75

graphics Tipe Citra dalamVector Komputer Grafik Examples of presentation graphics Vector graphics Vector graphics formats are complementary to raster graphics, which is the representation of images as an array of pixels, as it is typically used for the representation of photographic images. An understanding of the advantages and limitations of each technology and the relationship between them is most likely to result in efficient and effective use of tools. Example showing effect of vector graphics versus raster (bitmap) graphics.

9 of 75

graphics Tipe Citra dalamVector Komputer Grafik Examples of presentation graphics Raster graphics, also known as bitmaps, use a grid of pixels to form the image. As such, these bitmaps are static, or resolution dependent. Here lies the main difference between raster and vector; raster images work great at their native resolution, but if you were to zoom in on a section of the image, you'll begin to notice the pixelation or "boxiness" of the shapes. The image begins to look fuzzy since the individual pixels are now enlarged and cover multiple pixels. Vector graphics, on the other hand, do not rely on pixel grids but instead use geometrical primitives, such as points, lines and curves to create the image through the use of mathematical equations. So, instead of modifying the image's pixels themselves when resizing, a vector simply modifies the formula used to calculate the location and size of the shapes in the image. This allows vector images to be resolution independent. The image can be resized to fit any device's specifications without a loss of quality.

10 of 75

graphics Tipe Citra dalamVector Komputer Grafik Examples of presentation graphics

For Graphics Images

For photorealistics Image

11 of 75

graphics Tipe Citra dalamVector Komputer Grafik Examples of presentation graphics 3D computer graphics „ 3D computer graphics are graphics that use a threedimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images. Such images may be for later display or for real-time viewing. „ 3D computer graphics rely on many of the same algorithms as : 1. 2D computer vector graphics in the wire frame model 2. 2D computer raster graphics in the final rendered display „ 3D computer graphics Æ reffered to as 3D models „ A 3D model is the mathematical representation of any threedimensional object. A model is not technically a graphic until it is visually displayed. Due to 3D printing, 3D models are not confined to virtual space. A model can be displayed visually as a two-dimensional image through a process called 3D rendering, or used in non-graphical computer simulations and calculations

12 of 75

Computer animation „

Computer animation is the art of creating moving images via the use of computers. It is a subfield of computer graphics and animation. Increasingly it is created by means of 3D computer graphics, though 2D computer graphics are still widely used for stylistic, low bandwidth, and faster real-time rendering needs.

13 of 75

Apa yang Mendorong Grafik What drives computer graphics? What is Computer Graphics? Komputer ? • Movie Industry – Leaders in quality and artistry – Not slaves to conceptual purity – Big budgets and tight schedules – Reminder that there is more to CG than technology – Hey, How'd they do that? – Defines our expectations

Slide information from Leonard McMillian's slides http://www.cs.unc.edu/~mcmillan/comp136/Lecture1/compgraf.ht ml

14 of 75

Apa yang Mendorong Grafik What drives computer graphics? What is Computer Graphics? Komputer ? • Game Industry – The newest driving force in CG • Why? Volume and Profit • This is why we have commodity GPUs

– – – –

Focus on interactivity Cost effective solutions Avoiding computating and other tricks Games drive the baseline

Slide information from Leonard McMillian's slides http://www.cs.unc.edu/~mcmillan/comp136/Lecture1/compgraf.ht ml

15 of 75

Apa yang Mendorong Grafik What drives computer graphics? Komputer ? • Medical Imaging and Scientific Visualization – Tools for teaching and diagnosis • No cheating or tricks allowed

– – – –

New data representations and modalities Drive issues of precision and correctness Focus on presentation and interpretation of data Construction of models from acquired data

Nanomanipulator, UNC Joe Kniss, Utah

Gordon Kindelman, Utah

16 of 75

Apa yang Mendorong Grafik What is Computer Graphics? What drives computer graphics? Komputer ? • Computer Aided Design – Mechanical, Electronic, Architecture,... – Drives the high end of the hardware market – Integration of computing and display resources – Reduced design cyles == faster systems, sooner

ProEngineer, www.ptc.com

17 of 75

Apa yang Mendorong Grafik What What drives is Computer computer Graphics? graphics? Komputer ?

• Teknologi Graphic User Interfaces (GUI) – Major component – Window manager (multiple-window areas) – To make a particular window active, click in that window (using an interactive pointing device) – Interfaces display – menus & icons – Icons – graphical symbol designed to look like the processing option it represents – Advantages of icons – less screen space, easily understood – Menus contain lists of textual descriptions & icons

18 of 75

Area Fokus Komputer Grafik What is Computer Graphics? • Look at 5 areas – Hardware – Rendering – Interaction – Modeling – Scientific Visualization

Slide information from Richard Riesenfeld

Area Fokus Komputer Grafik : Hardware: What is Computer AmazingGraphics? Changes Hardware – Amazing Change

19 of 75

• Fundamental architecture shift – Dual computing engines: • CPU and GPU • More in GPU than CPU

• Fast, cheap GPUs – ~$300

• Cheap memory • Displays at low cost – How many monitors do you have/use?

• Wired -> Unwired • World of Access

20 of 75

Area Fokus Komputer Grafik : Hardware: What is Computer AmazingGraphics? Changes Hardware – Amazing Change The graphics Process 1. The graphics app (e.g Game) launched

2. The data loads into RAM

21 of 75

Area Fokus Komputer Grafik : Hardware: What is Computer AmazingGraphics? Changes Hardware – Amazing Change The graphics Process 3. The CPU Processes the data

4. The Graphics Driver Translates the Data

22 of 75

Area Fokus Komputer Grafik : Hardware: What is Computer AmazingGraphics? Changes Hardware – Amazing Change The graphics Process 5. The Graphics Port Transfers the Data

6. The VRAM Stores the Data

23 of 75

Area Fokus Komputer Grafik : Hardware: What is Computer AmazingGraphics? Changes Hardware – Amazing Change The graphics Process 7. The GPU Core Processes the Data

24 of 75

Area Fokus Komputer Grafik : Hardware – The Graphics Pipeline

25 of 75

Area Fokus Komputer Grafik : Hardware – Transformation

26 of 75

Area Fokus Komputer Grafik : Hardware 1- Translation Translation Matrix

27 of 75

Area Fokus Komputer Grafik : Hardware 1- Translation Example

28 of 75

Area Fokus Komputer Grafik : Hardware 2- Scaling & Reflection Scaling & Reflection Matrix

• If Sx=Sy=Sz Æ Uniform Scaling (>1: Expansion,