Data Representation Robin Burke IT 130. Outline Data Representation Binary Numbers Image types.

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

Information Representation
The Binary Numbering Systems
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
1 IMAGES: A Picture Is Worth a Thousands Words, Image Formats Image Sizes Graphic Tips Image Tag Attributes Centering Images.
Lecture 6 Graphics, Number Systems. 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Image Representation CS105. Data Representation Text representation – ASCII character set – Unicode – Data compression Images!
Last time 3 main components to a computer system Types of computers Talked about software – task oriented What are some kinds of data that a computer works.
15 September How Computers Work: Other Forms of Data.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 12 Data.
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.
Photoshop: Designing Graphics for the Web Christine Vucinich & Vicki Weidler ITS Training Services 224 B Computer Building University Park, PA 16802
CS110: Computers and the Internet Color and Image Representation.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
WEB GRAPHICS. The Pixel Computer displays are comprised of rows and columns of pixels. Pixels are indivisible. Some common screen resolutions are:, 600.
1 Part I: Machine Architecture 4 A major process in the development of a science is the construction of theories that are confirmed or rejected by experimentation.
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.
Lecture 5.
Faculty of Sciences and Social Sciences HOPE Website Development Graphics Stewart Blakeway FML 213
File Formats COM 366 Web Design & Layout. Native file format –Format native to software program –.psd > PhotoShop default Preserves layers –Use “Save.
Computing Higher - Unit 1… Computer Systems 1 Higher Computing Unit 1 – Topic 1 Data Representation.
Computers and Scientific Thinking David Reed, Creighton University Data Representation 1.
Graphic images for computers Stored in files of binary data - Binary blobs Software has to know the binary format to decode the file and render an image.
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.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
CS Topic 1 - Data Representation v2 1 Data representation considers how a computer uses numbers to represent data inside the computer. Three types of data.
Chapter 2 Computer Hardware
Shawlands Academy Higher Computing Data Representation.
© Keith Vander Linden, 2005 Jeremy D. Frens, Open up the box of a computer, and you won't find any numbers in there. You'll find electromagnetic.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
8 Using Web Graphics Section 8.1 Identify types of graphics Identify and compare graphic formats Describe compression schemes Section 8.2 Identify image.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Communicating Quantitative Information Is a picture worth 1000 words? Digital images. Number bases Standards, Compression Will [your] images last? Homework:
Raster Graphics. An image is considered to be made up of small picture elements (pixels). Constructing a raster image requires setting the color of each.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
Graphics on the Web How much do you want to know?? Terry Griffin.
Multimedia Basics (1) Hongli Luo CEIT, IPFW. Topics r Image data type r Color Model : m RGB, CMY, CMYK, YUV, YIQ, YCbCr r Analog Video – NTSC, PAL r Digital.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Data Representation The storage of Text Numbers Graphics.
Project Two Adding Web Pages, Links, and Images Define and set a home page Add pages to a Web site Describe Dreamweaver's image accessibility features.
1 Information Representation in Computer Lecture Nine.
Digital Images are represented by manipulating this…
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
Data Representation.
Digital File Formats By Ali Aslam. JPEG JPEG Stands for Joint Photographic Experts Group. JPEG uses a lossy compression routine. Lossy compression means.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Image File Formats Harrow Computer Club – Wed, 1 Dec 2010 Bob Watson MA CMath MIMA MBCS.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
1 MIT 5316 Web-Based Computing Lecture 1. 2 Welcome Introduction Syllabus.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Software Design and Development Storing Data Computing Science.
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 12 Data Representation.
Chapter 1: Data Storage.
Computer Science: An Overview Eleventh Edition
Data Representation.
Binary Representation in Audio and Images
Web Graphics 101 Web Image File Formats Image Optimization
Photoshop: Creating and Preparing Images for the Web
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Presentation transcript:

Data Representation Robin Burke IT 130

Outline Data Representation Binary Numbers Image types

Apology Errors The math in this chapter is full of errors

Number Systems A number system for n Digits from 0 to n-1 k th position = factor of n k Decimal (n=10) digits in position 2 = 1 * in position 1 = 5 * 10 4 in position 0 = 4 * 10 0 = 4 * 1 Hexadecimal (n=16) digits 0-9ABCDEF 3EA 3 in position 2 = 3 * 16 2 E in position 1 = 14 * 16 A in position 0 = 10 * 1 in decimal 1002

Babylonian (base 60)

Binary Numbers Binary (n = 2) digits 0 and 1 binary digit (bit) in position 3 = 1 * in position 2 = 1 * in position 0 = 1 * 1 in decimal 13

Why binary? Switches the computer is a bunch of intricately-connected switches transistors a switch is either off or on Early computers were actually programmed with switches early personal computers, too

An Early Home Computer

Memory Usually described in terms of kilobytes (KB) or megabytes (MB) 1 byte = 8 bits 1 KB = 2 10 or 1024 bytes 1 MB = 2 20 or 1,048,576 bytes 256 MB of RAM 268,435,456 bytes or 2,147,483,648 bits more than 2 billion transistors actually transistor / capacitor pair

16 million transistors in this L2 cache

Data Representation Everything in the computer is binary the program the operating system HTML files the values manipulated by JavaScript Part of what the computer does is translate from our representations to its representation = binary and back

Obvious Example Images More about images later

Integers Modern computers allocate 4 bytes (32 bits) to an integer 2 32 = 4.3 billion bit patterns but we need some for positive numbers and some for negative Basic idea give up one bit (highest-order) as a "sign" bit the problem

Two's complement Represent negative numbers in opposite order (not 2 -31, typo in book)

Integer representation 32 bits first bit = sign bit if sign bit = 0 interpret as binary number if sign bit = 1 flip all the other bits interpret as negative number What is ( ) + 1?

Floating point Think of scientific notation convert so that the decimal point has one digit in front of it x 10 3 since we know where the decimal point is three things to track  + or –  exponent of 10  value

Floating Point 32 bits sign bit 8 bits exponent 23 bits fractional part sign bit = 0 exponent = 3 = fraction = = Double-precision 64 bits 11 for exponent 52 for fraction more accuracy

Characters Historically 1 byte (8 bits) = 1 character 8 bits = 256 possible bit patterns Character set mapping between bit patterns and characters A = (65), a = (97) does not work for languages with larger character sets Unicode a character = 16 bits 65,536 characters

Characters ASCII the most common mapping used today A-Z = 65-91, a-z =

Strings Strings are lists (really arrays) of characters "foo" think of a list with 3 elements, each a character Not 100% accurate see on Wednesday

Data Representation Is determined by context what kind of variable is declared where the value came from Example

Images Complex topic actually Basic idea divide the picture into an evenly-spaced grid picture elements = pixels build a representation of the grid data turn into a file To display reverse the process to create picture

Monochrome (B/W) Each pixel 0 (on) or 1 (off)

Eight bit color 256 color palette associated with display 8 bit value indexes into palette

24-bit color 8 bits per color (RGB)

But Consider a simple image 288 x 200 pixels = pixels x 3 bytes (24 bits) / pixel = 172, 800 bytes At 3 K / sec 57 = 1 min All useful image formats use compression

Image formats Most common GIF JPEG PNG How they differ use of color type of compression availability

GIF Format Graphics Interchange Format.gif oldest uses repetitive pattern encoding Pluses compression is accurate, no loss of quality Minuses less compression possible image can only have 256 colors shading looks ugly Applicability good for line drawings animation is supported

JPEG Format Joint Photographic Experts Group.jpg average color values across pixels Pluses Level of compression is adjustable Supports 24-bit color Minuses Compression loses information

PNG Format Portable Net Graphics.png developed in web era Pluses has aspects of both GIF and JPG Minuses older browsers don't support it

Bottom line GIF line art unless there is continuous tone content JPG images compression advantages of JPG not apparent below 200x200 or so can often get away with high compression PNG consider using if your audience has the latest software

Rules of Thumb Speed Dial-up about 5 K / sec DSL / Cable about K / sec Don't make user wait more than 2-3 sec for homepage Images deeper in site can be bigger Note images are cached by browser won't be downloaded every time they appear navigation bars, buttons, etc.

Wednesday Strings Ch. 15