How pictures are stored in computers. While it is useful to know how to use picture editing software, Computer Scientists should understand how pictures.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
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.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
1 The Information School of the University of Washington Nov 6fit more-digital © 2006 University of Washington Digital Information INFO/CSE 100,
A 24-bit depth.bmp file made in XVI32 This 2-by-2 image was handcrafted in XVI32 Bytes 1C-1D hex in the Info Header say that the image uses 24-bit (18.
1 Programming & Programming Languages Overview l Machine operations and machine language. l Example of machine language. l Different types of processor.
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
A bug in PhotoPlus When PhotoPlus X2, version , is used to create a new.bmp file, it does not create the Pixel Data correctly This bug may have.
Binary and Decimal Numbers
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.
Agenda Data Representation Purpose Numbering Systems Binary, Octal, Hexadecimal (Hex) Numbering System Conversions Binary to Octal, Octal to Binary Binary.
Peripherals and Storage Looking at: Scanners Printers Why do we need storage devices anyway? What are magnetic disks? How do magnetic disks physically.
Unit 30 P1 – Hardware & Software Required For Use In Digital Graphics
BR 8/99 Digital Devices Integrated Circuits that operate on Digital Data are in 95% of every electrical powered device in the U.S. The theory of operation.
© GCSE Computing Candidates should be able to:  explain the representation of an image as a series of pixels represented in binary  explain the need.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
The number systems of Computer Science
Shawlands Academy Higher Computing Data Representation.
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
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.
Follow the Data Data (and information) move from place to place in computer systems and networks. As it moves it changes form frequently. This story describes.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Bits & Bytes Created by Chris McAbee For AAMU AGB199 Extra Credit Created from information copied and pasted from
7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report.
D75P 34 – HNC Computer Architecture Interim Week Hexadecimal revisited! © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except.
Memory Map, Programming Language, and Windows Dr. Harold D. Camp IT February 2007.
CS161 Computer Programming Instructor: Maria Sabir Fall 2009 Lecture #1.
Communicating Quantitative Information Is a picture worth 1000 words? Digital images. Number bases Standards, Compression Will [your] images last? Homework:
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Quiz # 1 Chapters 1,2, & 3.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Data Representation Conversion 24/04/2017.
Data Representation The storage of Text Numbers Graphics.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
COMPUTER GRAPHICS. Can refer to the number of pixels in a bitmapped image Can refer to the number of pixels in a bitmapped image The amount of space it.
Chapter 3 The Power of HEX Finding Slivers of Data.
 By Bob “The Bird” Fiske & Anita “The Snail” Cost.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
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,
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
IC 3 BASICS, Internet and Computing Core Certification Computing Fundamentals Lesson 2 How Does a Computer Process Data?
Part 1 File Formats Definition: A file format is a way to write the code of information for storage of an electronic file on a computer. Different software.
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
1 Section 1.3 Binary Number Systems Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Binary Representation in Text
Binary Representation in Text
Binary Notation and Intro to Computer Graphics
Day 6 - Encoding and Sending Formatted Text
Binary Representation in Audio and Images
Digital Devices Integrated Circuits that operate on Digital Data are in 95% of every electrical powered device in the U.S. The theory of operation of these.
Chapter 1 Data Storage.
Representing Images 2.6 – Data Representation.
Hexadecimal Conversions
Topic 3: Data Hexadecimal.
Fundamentals of Data Representation
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Follow the Data Data (and information) move from place to place in computer systems and networks. As it moves it changes form frequently. This story.
Abstraction – Number Systems and Data Representation
WJEC GCSE Computer Science
CHAPTER 69 NUMBER SYSTEMS AND CODES
Dr. Clincy Professor of CS
Presentation transcript:

How pictures are stored in computers

While it is useful to know how to use picture editing software, Computer Scientists should understand how pictures are stored in computers This is important in its own right But it will also be important when you start writing programs in PHP to create pictures In what follows, you will –learn something about the format of image files –discover that picture editing software can contain bugs –discover that many programs do not adhere strictly to the image format standards

How pictures are stored in computers Understanding computer storage of pictures involves several main points: a picture is a collection of dots, called pixels the colour of each dot in a picture must be stored any colour can be represented as a mixture of certain proportions of red, green and blue in computers, all information is stored as a sequence of zeros and ones there is frequently a lot of repetition in a picture, so the zeros and ones can often be compressed

Representation of information as zeros and ones In computers, all information is stored as a sequence of zeros and ones –since only two symbols are used, this is called binary representation the Latin prefix, bi-, means two Why are only two symbols used? Because most forms of electronic storage device have only two easily-distinguishable states A clear example can be seen by looking at early computer technology

The CDC 6600 computer designed by Seymour Cray first delivered in 1964 was considered a "supercomputer" –three times faster than the fastest computer before it cost $10 million each –at a time when a 3- bedroom house in Ireland cost about $2500 –so it cost the same as 4000 houses

CDC 6600 memory Memory boards from a CDC 6600 computer Let's look more closely

A single memory board

Closer view of a CDC 600 memory board Memory boards were then called "mats" It's easy to see why A mat consisted of wires woven through rings Each ring was called a core

Closer view (of a different board) Each core was several millimetres in diameter

Core memory was used for a long time Core memory was developed around 1950 It was the fastest memory available until the late 1980s

Why cores were used Each core was actually a circular magnet

Why cores were used A core could be magnetized in one of two directions, clockwise or anti- clockwise

Two states means only two values These two direction could be used to represent two different symbols –Clockwise, say, can represent a 0, –while anti-clockwise can represent a 1

How cores are magnetized The direction of magnetization in a core can be changed by temporarily running a current along a wire that runs through the core

Direction of current The final direction of magnetization in the core depends on the direction of the current along the wire

Threshold current To change the direction of magnetization in a core the current must exceed a threshold current, I

Threshold current If the current is less than the threshold current, the state of the core is not changed

How cores were controlled It's worth seeing how individual cores in a mat were controlled Similar principles are still used in newer memory technologies

Several wires through each core There were actually three wires running through each core Two wires ran in each of two perpendicular directions –These are called the address wires The third wire ran diagonally –this is called the sense wire

Wires in a core mat The perpendicular and diagonal wires on a core-memory mat from 1951

Selecting (addressing) a specific core The fact that the current must exceed a threshold is used to select the core we want to change To change a specific core, we send half the threshold current along each of the two address wires that pass through the target core

How to write information into a core To achieve a specific state in the core, –we send the currents in a specific direction One direction creates 0 The other direction creates 1

How to read from a core To read a core, we set it to 0 and see if that causes a pulse along the sense wire Then, if necessary, we reset the core to the correct value If the core originally contained 0, we need to do nothing But if the core originally contained 1, we must write that 1 back into the core

Memory locations The address wires run in two perpendicular directions One direction, say the horizontal, is more significant than the other Each wire in this direction selects a group of cores that belong to one memory location Wires in the other direction can select individual bits in the location

Sizes of memory location Early computers had locations of different sizes In the top board shown here, each location had 16 bits In the bottom board, each location had 8 bits In most (all?) modern computers, each memory location has 8 bits A group of 8 bits is called a byte So modern computer memory is what is called byte-addressable

Contents of a memory byte A memory byte can contain 256 different patterns, ranging from to

Contents of a memory byte It is easier to write a byte pattern as two groups of four bits, with a space in the middle So, a memory byte can contain 256 different patterns, ranging from to

Shorthand notation A group of 4 bits is sometimes called a nibble A nibble can contain 16 different patterns

Shorthand notation A group of 4 bits is sometimes called a nibble A nibble can contain 16 different patterns It is common to use a shorthand notation for these 16 different patterns

Shorthand notation A group of 4 bits is sometimes called a nibble A nibble can contain 16 different patterns It is common to use a shorthand notation for these 16 different patterns This notation is called hexadecimal notation

Shorthand notation for bytes So, a byte can contains 256 different hexadecimal patterns, ranging from

Shorthand notation for bytes So, a byte can contains 256 different hexadecimal patterns, ranging from 00 to FF

Image files Binary representation is not confined to the internal memory of a computer It is also used in files that are stored on disks So, image files also use binary representation We can see this by using a program which shows us the raw contents of an image file

Hex editors A hex editor is a program which can be used to examine and edit the raw contents of any file on a computer disk They are called hex editors because they display the contents of the file using hexadecimal notation We will use a freely-available hex editor called XVI32 But many others are available

An example image file Consider the following file: It is in the BMP format - the Windows bitmap format It was created using PhotoShop, not PhotoPlus –as we will see later, this is not unimportant We will examine this file with XVI32 But, first, let's see what image the file contains Download the file to your computer And open it in PhotoPlus

test.bmp It is a very small image

test.bmp Use menu Image -> Image Size to check the size

test.bmp It is 4 pixels wide by 4 pixels high

test.bmp Even though the picture contains only 16 pixels, the file is quite big –it contains 1,094 bytes

Using XVI32 to examine test.bmp XVI32 is on your workstation desktop

Using XVI32 The initial display, when no file has been opened

Viewing test.bmp in XVI32 The display when test.bmp has been opened

Viewing test.bmp in XVI32 The display when test.bmp has been opened

Viewing test.bmp in XVI32 The highlighted area is used to show the binary contents of the file Each byte is shown in hexadecimal notation

Viewing test.bmp in XVI32 Consider the first byte in the file, byte 0 It contains 42 hex That is

Viewing test.bmp in XVI32 Consider the fortieth byte in the file, byte 28 hex It contains 0B hex That is

Viewing test.bmp in XVI32 The highlighted area gives a different view of the contents of the file It interprets the bytes as characters using the ASCII code

The ASCII code interprets a byte as one 256 different characters This slide shows the first 128 of these

The ASCII code interprets a byte as one 256 different characters This slide shows the second 128 of these

Viewing test.bmp in XVI32 The first three bytes in the file contain 42 hex 4D hex 46 hex If these were interpreted as ASCI character codes, they would represent BMF However, most of the time, we will not be interested in the ASCII interpretations