Computer Science 101 Picture Files. Computer Representation of Pictures Common representation is as a bitmap. Common representation is as a bitmap. Two.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

Information Representation
BMP Hide ‘n’ Seek What is BMP Hide ‘n’ Seek ? –It’s a tool that lets you hide text messages in BMP files without much visible change in the picture. –Change.
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
HTML Creating Web pages. HTML Hyper Text Markup Language Not programming, but a markup language using tags to format text in Web browsers.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
The Binary Numbering Systems
Chapter 11 File Systems and Directories. 2 File Systems File: A named collection of related data. File system: The logical view that an operating system.
Connecting with Computer Science, 2e
1 Computers and Representations Ascii vs. Binary Files Over the last few million years, Earth has experienced numerous ice ages when vast regions of the.
Using a hex editor to edit an image We can actually use hex editors to change image files Usually, we will use programs like PhotoPlus or PhotoShop But.
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
1 The Information School of the University of Washington Nov 6fit more-digital © 2006 University of Washington Digital Information INFO/CSE 100,
©Brooks/Cole, 2003 Chapter 2 Data Representation.
First Bytes - LabVIEW. Today’s Session Introduction to LabVIEW Colors and computers Lab to create a color picker Lab to manipulate an image Visual ProgrammingImage.
March 2006Taner Erig - EMU2-1 Metamorphosis of Information How is information represented and how do computers store information?
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
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.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Presenting Information on WWW using HTML. Presenting Information on the Web with HTML How Web sites are organized and implemented A brief introduction.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
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.
Working with text ASCII and UNICODE.   
© GCSE Computing Candidates should be able to:  explain the representation of an image as a series of pixels represented in binary  explain the need.
Image Processing & Perception Sec 9-11 Web Design.
Digital Media Dr. Jim Rowan ITEC Monday, August 27.
Digital Media Dr. Jim Rowan ITEC Monday, August 27.
1 Working with Cascading Style Sheet (CSS) (contd.)  What we will cover… 1. Color (decimal and hexadecimal representation) 2. Floating elements 3. Styling.
1 Real-World File Structures by Tom Davis Asst. Professor, Computer Science St. Edward's University 3001 South Congress Avenue Austin, Texas 78704
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.
File Name Extensions Computer Applications 7th grade.
3.2 Data Portability. Overview Understand the need for data compression and software needed to compress/decompress data. Identify common file types such.
Number Systems CIT Network Math
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Number Representations What all the numbers can mean.
Georgia Institute of Technology Making Text for the Web Barb Ericson Georgia Institute of Technology March 2006.
Digital Media Lecture 4.1: Image Encoding Practice Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
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 2 Data Representation.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Chap 14 Presentation Layer Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
HTML (Hyper Text Markup Language) Lecture II. Review Writing HTML files for web pages – efficient compact – fundamental. Text files with htm extension.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
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,
Digital Media Lecture 4.2: Image Encoding Practice Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
More Digital Representation Discrete information is represented in binary (PandA), and “continuous” information is made discrete.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
1 HTML. 2 Full forms WWW – world Wide Web HTTP – Hyper Text Transfer Protocol HTML – Hyper Text Markup Language.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
Text and Images Key Revision Points.
Chapter 8 & 11: Representing Information Digitally
Image Processing Objectives To understand pixel based image processing
CSS Layouts CH 13.
Bitmap Basics Review Refresher from Year 8.
Binary Representation in Audio and Images
Image Processing & Perception
To do … Web Exercise: Quiz-3, HW#2 Score: update
Representing Images 2.6 – Data Representation.
What do these words mean to you?
Numbers and their bases
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Chapter 2 Data Representation.
(c) V/2-Com (Verhaart) Multimedia Elements & standards 4/15/2019 (c) V/2-Com (Verhaart)
Visuals are analog signals...
Real-World File Structures
WJEC GCSE Computer Science
Presentation transcript:

Computer Science 101 Picture Files

Computer Representation of Pictures Common representation is as a bitmap. Common representation is as a bitmap. Two dimensional array of dots called pixels (picture element).Two dimensional array of dots called pixels (picture element). The array consists of rows and columns of pixels.The array consists of rows and columns of pixels. With the RGB system, each pixel has associated a 3-byte RGB value.With the RGB system, each pixel has associated a 3-byte RGB value.

Picture from W&L Home Page (stored as bmp file)

At 800%

At 2400%

How does the software know? We know that all of the information stored in a computer file is stored as bits, broken into 8-bit bytes. We know that all of the information stored in a computer file is stored as bits, broken into 8-bit bytes. How does the software know whether this binary data is to be interpreted as text, picture, music, program instructions, etc. How does the software know whether this binary data is to be interpreted as text, picture, music, program instructions, etc.

File extensions As you know, files are usually stored as As you know, files are usually stored as Name of fileName of file A dot (or period)A dot (or period) An extension that indicates the general category of the file.An extension that indicates the general category of the file.

Some common extensions.txtPlain text.docMicrosoft word document.docxMicrosoft Word Open XML Document.pdfPortable Document Format File.msgOutlook mail message.pptPowerpoint presentation.xlsExcel spreadsheet.bmpBitmap image file.jpgJPEG image file.mp3Mp3 audio file.wavWave audio file.txtPlain text.docMicrosoft word document.docxMicrosoft Word Open XML Document.pdfPortable Document Format File.msgOutlook mail message.pptPowerpoint presentation.xlsExcel spreadsheet.bmpBitmap image file.jpgJPEG image file.mp3Mp3 audio file.wavWave audio file

Some common extensions (cont.).logLog file.movApple QuickTime movie.mpgMPEG video file.exeExecutable file.htmlHypertext Markup Language file.zipZipped file.javaJava source file.pyPython source file.logLog file.movApple QuickTime movie.mpgMPEG video file.exeExecutable file.htmlHypertext Markup Language file.zipZipped file.javaJava source file.pyPython source file

Extension is not enough Often the software needs more information than is conveyed by the extension. Often the software needs more information than is conveyed by the extension. A.bmp file stores the RGB values for each pixel, thus 24 bits in 3 bytes for each pixel. A.bmp file stores the RGB values for each pixel, thus 24 bits in 3 bytes for each pixel. Suppose there is RGB information for 100 pixels. Is the picture a 10 by 10, 25 by 4, 5 by 20 or what? Many other such questions. Suppose there is RGB information for 100 pixels. Is the picture a 10 by 10, 25 by 4, 5 by 20 or what? Many other such questions.

File headers Many file formats specify how some needed information is to be stored in the beginning of the file. Many file formats specify how some needed information is to be stored in the beginning of the file. The extension tells the type of format being used; the file header encodes additional information needed by the software accessing the file. The extension tells the type of format being used; the file header encodes additional information needed by the software accessing the file. File has File has Header informationHeader information File dataFile data

BMP File Header For more on this topic see For more on this topic see format.htmlhttp:// format.htmlhttp:// format.htmlhttp:// format.html #BMP_File_Headerhttp://en.wikipedia.org/wiki/BMP_file_format #BMP_File_Headerhttp://en.wikipedia.org/wiki/BMP_file_format #BMP_File_Headerhttp://en.wikipedia.org/wiki/BMP_file_format #BMP_File_Header

BMP Header (from Fastgraph)

BMP Header (cont.) Offset: Offset: How many bytes into the file the specified information is located. Here we have 0; so this information is at the very beginning of the file.How many bytes into the file the specified information is located. Here we have 0; so this information is at the very beginning of the file. In this table the offset is given in decimal; we’ll need to use hexadecimal. Get ready to convert.In this table the offset is given in decimal; we’ll need to use hexadecimal. Get ready to convert. Size: How many bytes are used for the information. Size: How many bytes are used for the information.

BMP Header (cont.) Signature: Signature: Identifies the kind of file dataIdentifies the kind of file data Often 2 byte information has the information in “right to left” order.Often 2 byte information has the information in “right to left” order. Here the 42 in hex is 66 in decimal. The 4D is 77 in decimal.Here the 42 in hex is 66 in decimal. The 4D is 77 in decimal. 66 is ASCII for B, and 77 is ASCII for M.66 is ASCII for B, and 77 is ASCII for M. BM is confirming that the data is bitmap data.BM is confirming that the data is bitmap data.

BMP Header (cont.) Start of image data: Start of image data: Where the RGB values are found.Where the RGB values are found. Let’s remember that the offset 10 is A in hex.Let’s remember that the offset 10 is A in hex. Also remember that this information is 4 bytes long.Also remember that this information is 4 bytes long.

BMP Header (cont.) Width: Width: At offset 18 decimal or 12 hex.At offset 18 decimal or 12 hex. 4 bytes.4 bytes. Height Height At offset 22 decimal or 16 hex.At offset 22 decimal or 16 hex. 4 bytes.4 bytes.

BMP Header Summary Some of the header info (offsets in hex): Some of the header info (offsets in hex): Signature at offset 0 – 2 bytesSignature at offset 0 – 2 bytes File size at offset 2 – 4 bytesFile size at offset 2 – 4 bytes Offset for start of image data at offset A – 4 bytesOffset for start of image data at offset A – 4 bytes Width in pixels at offset bytesWidth in pixels at offset bytes Height in pixels at offset 16 – 4 bytesHeight in pixels at offset 16 – 4 bytes

96 pixels So each square is 24 by 24

Colored Squares with Hex Editor We see the 42 4D at offset 0 We see the 42 4D at offset 0

File Size (offset 2) We see 366C for size. We see 366C for size. Actually bytes are right to left so 6C36. Converting this to decimal gives bytes.Actually bytes are right to left so 6C36. Converting this to decimal gives bytes. We have 96 by 96 or 9216 pixelsWe have 96 by 96 or 9216 pixels 3 bytes per pixel for RGB; so data bytes3 bytes per pixel for RGB; so data bytes Plus the 54 bytes in the header giving 27702Plus the 54 bytes in the header giving 27702

Width and Height (offset 12 and 16) We see 60 for both the width and height. In decimal this would be 96. We see 60 for both the width and height. In decimal this would be 96.

Bitmap Data Location (offset A) We see 36 at location A. This means that the bitmap data begins in location 36. We see 36 at location A. This means that the bitmap data begins in location 36.

Bitmap Data (offset 36) At location 36, we see values FF 00 FF. At location 36, we see values FF 00 FF. But the upper left square has red pixels.But the upper left square has red pixels. The BMP documents specify bottom row first.The BMP documents specify bottom row first. Red and Blue give the purple color.Red and Blue give the purple color.

Bitmap Data – Color Change In the bottom row, there are 24 purple pixels, FF 00 FF. Then we see FF times. In the bottom row, there are 24 purple pixels, FF 00 FF. Then we see FF times. This would seem to indicate Red.This would seem to indicate Red. Again, the BMP specifications indicate the colors will be in BGR order.Again, the BMP specifications indicate the colors will be in BGR order.

Suzie Pup Pup Pup Now Now Now