© De Montfort University, 20041 Vector and Bitmapped graphics Howell Istance School of Computing De Montfort University.

Slides:



Advertisements
Similar presentations
Unit 30- Digital Graphics THEORY P2 and D2
Advertisements

Digital Color 24-bit Color Indexed Color Image file compression
L.Ghadah R. Hadba CT1514-L1.  Computer Graphics :refers to processing of creating a new image from Geometry, Lighting parameters, Materials and Textures.Using.
Graphics CS 121 Concepts of Computing II. What is a graphic? n A rectangular image. n Stored in a file of its own, or … … embedded in another data file.
ISYS 3074 Graphics File Formats File formats have developed with applications. At least 50 currently in use. Examples include: GIF, JPEG, TIFF, BMP, DIB,
Media Data and File Formats
Introduction to Computer Graphics
Graphics and Images September 28, Unit 3.
How Images are Represented Bitmap images (Dots used to draw the image) Monochrome images 8 bit grey scale images 24 bit colour Colour lookup tables Vector.
Components Text Text--Processing Software A Word Processor is a software application that provides the user with the tools to create and edit text.
V Obtained from a summer workshop in Guildford County July, 2014
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
1 Bitmap Graphics It is represented by a dot pattern in which each dot is called a pixel. Each pixel can be in any one of the colors available and the.
Higher Computing Data Representation.
Color Names All standards-compliant browsers should handle these color names These color names can be used with the CSS properties of color and background-color.
Faculty of Sciences and Social Sciences HOPE Website Development Graphics Stewart Blakeway FML 213
Dean Pentcheff NHMLAC MBPC/Crustacea 17 April 2006.
Computer Systems Nat 4.5 Computing Science Data Representation Lesson 4: Storing Graphics EXTENSION.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
File Formats About graphic file formats And image compression.
Lecture 4 - Introduction to Computer Graphics
Image Storage Bitmapped Graphics – in which an image is represented as a collection of dots Vector Graphics – in which an image is represented as a set.
Vector vs. Bitmap
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
1 Computer Graphics Part 2: Images. 2 What is an image?  An image is the graphical and visual representation of some information that can be displayed.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
1 Image Formats. 2  To be able save image data for future manipulation and display we need to be able to store it in a consistent manner  Formats enable.
Digital Cameras And Digital Information. How a Camera works Light passes through the lens Shutter opens for an instant Film is exposed to light Film is.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Information Processes and Technology Multimedia: Graphics.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 3 This presentation © 2004, MacAvon Media Productions Introduction to Computer Graphics.
Graphics. Graphic is the important media used to show the appearance of integrative media applications. According to DBP dictionary, graphics mean drawing.
Graphics workshop Library and Information Services University of St Andrews.
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
2D Graphics Theory & Principles. Single Point Smallest addressable area on screen or digital image.
File Formats and Vector Graphics. File Types Images and data are stored in files. Each software application uses different native file types and file.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Computer Systems Nat 4.5 Computing Science Data Representation Lesson 4: Representing and Storing Graphics EXTENSION.
Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.
Digital Images are represented by manipulating this…
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Digital Graphics for Computer Games Pixels Types of Digital Graphics (Raster and Vector) Compression.
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Digital Media Dr. Jim Rowan ITEC 2110 Chapter 3. Roll call.
Image File Formats Harrow Computer Club – Wed, 1 Dec 2010 Bob Watson MA CMath MIMA MBCS.
Image Editing Vocabulary Words Pioneer Library System Norman Public Library Nancy Rimassa, Trainer Thanks to Wikipedia ( help.
Scanner Scanner Introduction: Scanner is an input device. It reads the graphical images or line art or text from the source and converts.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
Mohammed AM Dwikat CIS Department Digital Image.
Computer Systems Nat 5 Computing Science Data Representation
BITMAPPED IMAGES & VECTOR DRAWN GRAPHICS
File Compression 3.3.
Images Data Representation.
Data Representation.
Computer Science Higher
How to Convert Pictures into Numbers
Raster Images CPSC 1030.
Chapter 3:- Graphics Eyad Alshareef Eyad Alshareef.
LET’S LEARN ABOUT GRAPHICS!
Introduction to Computer Graphics
Representing Images 2.6 – Data Representation.
Digital Media Dr. Jim Rowan ITEC 2110.
Web Programming– UFCFB Lecture 7
Computer Systems Nat 4.5 Computing Science Data Representation
Lecture 4 - Introduction to Computer Graphics
Presentation transcript:

© De Montfort University, Vector and Bitmapped graphics Howell Istance School of Computing De Montfort University

© De Montfort University, What’s the difference..? Vector Graphics: image represented and stored as a collection of shapes, together with data (parameters) defining how the shapes will be produced and where they will be located Bitmapped Images: image represented and stored as a collection of pixels which displayed make up the image

© De Montfort University, 2004 Bitmapped images Pixels make up an image

© De Montfort University, 2004 #FF00A3 #255,0,163 # , , Colour - Depth Each pixel has a colour depth. A certain number of ‘bits’ are used to define a pixels colour e.g. held as an RGB value. For 256 (or less) colours a palette is used as an index describing which 256 actual colours to use in an image. 240,200,171

© De Montfort University, Pixmaps FF 255 red 00 0 green 00 0 blue Pixmap – area of memory In Windows, this is known as a device context (DC) 3 bytes per pixel = 24 bits

© De Montfort University, Location in memory corresponds to display location Send to device (display) driver

© De Montfort University, Vector graphics Model Transform (scale) Clip Render – convert model to array of pixel values

© De Montfort University, Models in Vector graphics Model is a series of mathematical constructs, together with data to define the location, size and attributes of each, such as colour, line style… Constructs include –shapes (rectangle, oval, lines), –curves –polygons (sets of points, coordinate pairs, with lines joining consecutive points), polylines –polygon meshes (set points with instructions to show which points are to be joined by lines) (0,0)x y

© De Montfort University, Rendering Conversion of model into an array of pixel values May include addition of effects such as application of textures, lighting and shading High demands on efficiency, involves very low level code Simple example of rendering a circle, radius r, centre at a,b For n = 0 to 360 { x = r*sin(n) y = r*cos(n) draw_point_at( a+ x, b + y) } r (a,b) y x

© De Montfort University, Transform and clip Transform between world coordinates to view port coordinates (scale up or down) –World coordinates – arbitrary, used to define model layout –View Port coordinates – correspond to display location –May involve several stages, or transformations Clip to the visible area of the window or ‘viewport’ Map pixel value contents at viewport coordinates to pixmap locations

© De Montfort University, Bitmapped Images… Model – array of pixel values Transform (scale) Clip ‘Logical’ pixel values ‘Physical’ pixel values

© De Montfort University, Models for bitmapped images Model consists a 2-D array of pixel values May be of a different size and colour depth from the image which will be finally displayed. A view of the image displayed on screen in an image editor is not the model, the view has been transformed and clipped and displayed You do not see the model

© De Montfort University, Persistance… Transform (scale) Clip File storage requires formats to store each type of model efficiently

© De Montfort University, Storing models….as bitmapped images The image will contain 128 * 128 = pixels If 3 bytes are used to store each pixel value, then * 3 bytes = bytes are required Size is constant regardless of complexity of image within the 128 pixel square 4.5 cm If the rectangles measure 4.5 cm, then on a 72 dpi (dots per inch) monitor, each side will contain 128 pixels

© De Montfort University, Storing models….as vector graphics 78 bytes required! But Postscript renderer required, which slows the display process and has to be available on the host machine Size increases as complexity of image increases, as more instructions are needed to define the image 4.5 cm (Post Script) setrgbcolour rectfill setrgbcolour rectfill

© De Montfort University, Representation as vector graphics… Vector graphics enable images to be composed of filled shapes Each object can be manipulated individually Scaling objects is easy (by applying mathematical transforms to the object definition)

© De Montfort University, Distorted poppy… Easy to manipulate individual elements of image here…

© De Montfort University, Vector representation of complex images To approach realistic image, complex definition of gradient meshes is required File size approx. 10 MB Generated in Illustrator Taken from Wiley book site

© De Montfort University, Rendered as a bitmapped image File size of this image is 152K No longer possible to interact with separate components Edits and application of effects are done on the vector version and the end result is saved as a bitmapped image.

© De Montfort University, Scaling bitmapped images… Mapping 1 logical pixel to more than 1 physical pixel requires a decision about what values to assign to the physical pixels Duplicating the values leads to ‘jagged edges’ of contours ‘Anti-aliasing’ assigns computed intermediate values to reduce this effect Logical (model) pixelsphysical pixels Scale factor = 1 Scale factor = 2

© De Montfort University, Effects of Anti-aliasing The bitmapped image of the iris has been scaled up 6 times No anti-aliasing Anti-aliasing applied

© De Montfort University, Vector graphics Model Transform (scale) Clip

© De Montfort University, Vectorising and rasterising Bitmapped image ModelVector graphics Model Rasterising (rendering) vectors to bitmaps is ‘easy’ Vectorising bitmaps to vectors is not – requires tracing contours of edges and features in bitmaps on the basis of differences between adjacent pixel values (‘magic wand’ tool) – Resultant vectors then have to be converted into meaningful objects rasterising vectorising

© De Montfort University, Bitmapped image file formats Many different formats, at least 50 currently in use Examples include: GIF, JPEG, TIFF, BMP, DIB, PCD, PNG ……. Main differences lie in compression technique used and number of bits used to represent pixel values (colour depth) Lossless compression: stored compressed image can be decompressed to be identical to the original (e.g LZW run length encoding) Lossy compression: some information is lost as a result of decompression, intended to be visually insignificant

© De Montfort University, 2004 Compression - LZW / RLE Runs of colour can be defined in a simple Run / Colour / Number format. e.g. R0206 for black, R0304 for gray, RF005 for green, R04FE for red, R0203 for black, R0614 for blue - taken from the palette below The palette

© De Montfort University, 2004 Compression - LZW / RLE TIF uncompressed = 289k TIF lzw compressed = 248k TIF uncompressed = 90k TIF lzw compressed = 5k

© De Montfort University, GIF Developed by Compuserve to exchange images across platforms Limited to 256 colours – ie one byte per value Lossless compression – uses LZW run length encoding 1 colour can be designated as transparent Good for simple images with limited tonal ranges, poor for photographic images

© De Montfort University, PNG Successor to GIF, developed by W3C Uses different compression technique, but still lossless Not licenced, freely implementable Transparency retained, in more sophisticated form More than 256 colours possible.

© De Montfort University, JPEG Lossy compression technique JPG image format incorporates JPEG compression Uses discrete cosine transformation (DCT) – divides image up into areas and stores a transformation of the values within each area Compression factor can be specified when converting to jpg format (higher compression, more loss, lower quality) Good for images with large tonal ranges such as photographs Use for post production storage only

© De Montfort University, Comparison Image size 840 * 560 pixels Family.bmp 1428K Family.jpg (15%) 130K Family.jpg (50%) 63K Family.jpg (90%) 24K Family.gif 381K