Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.

Slides:



Advertisements
Similar presentations
Pixels and Digital Images Yrd. Doc. Dr. Ahmet Sayar Kocaeli Universitesi Bilgisayar Muhendisligi Ileri Bilgisayar Grafikleri.
Advertisements

Web Design Vocab 3 PNG, JPG, GIF, MP3, MPEG.
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.
Dale & Lewis Chapter 3 Data Representation. Representing color Similarly to how color is perceived in the human eye, color information is encoded in combinations.
School of Computing Science Simon Fraser University
1 Data Compression Engineering Math Physics (EMP) Steve Lyon Electrical Engineering.
Computer Science 335 Data Compression.
Fundamentals of Python: From First Programs Through Data Structures
Graphics in the web Digital Media: Communication and Design
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
Images and Color Multimedia Systems (Module 1 Lesson 2)
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
Image Compression JPEG. Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg and can be embedded.
Image and Sound Editing Raed S. Rasheed Image Image. Digital image. – Raster images. – Vector Images. – Stereo Images. – Image File Formats Lossless.
Part A Multimedia Production Rico Yu. Part A Multimedia Production Ch.1 Text Ch.2 Graphics Ch.3 Sound Ch.4 Animations Ch.5 Video.
An Introduction to Scanning and Storing Photographs and Graphics Bryn Jones Aug 2002
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
Department of Physics and Astronomy DIGITAL IMAGE PROCESSING
1 Ethics of Computing MONT 113G, Spring 2012 Session 11 Graphics on the Web Limits of Computer Science.
Introduction to JPEG Alireza Shafaei ( ) Fall 2005.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
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.
Klara Nahrstedt Spring 2011
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Images The Science of Images What is an Image on the computer? The Psychology of Images What do we use images for? What effect color has on our mood and.
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.
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Indiana University Purdue University Fort Wayne Hongli Luo
1 Chapter 2: Color Basics. 2 What is light?  EM wave, radiation  Visible light has a spectrum wavelength from 400 – 780 nm.  Light can be composed.
Intelligent Vision Systems Image Geometry and Acquisition ENT 496 Ms. HEMA C.R. Lecture 2.
Image formats. Basic terminologies… Pixels: Pixels are the building blocks of every digital image. a pixel is a single point in a graphic image. Resolutions:
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. Introduction. Goals of Image Processing “One picture is worth more than a thousand words” 1.Improvement of pictorial information for human.
Computer Images Can store color info about each pixel, but makes file BIG Compression for Web 15.
Understanding JPEG MIT-CETI Xi’an ‘99 Lecture 10 Ben Walter, Lan Chen, Wei Hu.
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Graphics workshop Library and Information Services University of St Andrews.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
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.
Images. Digital Images Rectangular arrays of pixel data Pixel - picture element, smallest addressable part of the frame buffer. Color depth - the depth.
CSCI-100 Introduction to Computing Hardware Part II.
 By Bob “The Bird” Fiske & Anita “The Snail” Cost.
Image File Formats. What is an Image File Format? Image file formats are standard way of organizing and storing of image files. Image files are composed.
CS 101 – Sept. 14 Review Huffman code Image representation –B/W and color schemes –File size issues.
Computer Science 121 Scientific Computing Winter 2014 Chapter 14 Images.
Digital File Formats By Ali Aslam. JPEG JPEG Stands for Joint Photographic Experts Group. JPEG uses a lossy compression routine. Lossy compression means.
Intelligent Vision Systems Image Geometry and Acquisition ENT 496 Ms. HEMA C.R. Lecture 2.
Lesson 2: Introduction to Digital Imaging Digital Photography MITSAA IAP 2003 Rob Zehner.
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.
HTTP transaction with Graphics HTML file + two graphics files.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
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.
DIGITAL MEDIA FOUNDATIONS
Image Processing Objectives To understand pixel based image processing
Sampling, Quantization, Color Models & Indexed Color
Binary Representation in Audio and Images
Computer Science Higher
Chapter 3 Graphics and Image Data Representations
Chapter III, Desktop Imaging Systems and Issues: Lesson IV Working With Images
Digital Images.
Image File Size and File Compression
Representing Images 2.6 – Data Representation.
Judith Molka-Danielsen, Oct. 02, 2000
Presentation transcript:

Lab #5-6 Follow-Up: More Python; Images

Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that varies over time. ● An image (picture) can be thought of as a two-dimensional quantity that varies over space. ● Otherwise, the computations for sounds and images are about the same!

Black-and-White Images

● Eventually we get down to a single point (pixel, “picture element”) whose color we need to represent. ● For black-and-white images, two basic options – Halftone: Black (0) or white (1); having lots of points makes a region look gray – Grayscale: Some set of values (2 N, N typically = 8) representing shades of gray.

● To turn a b/w image into a grid of pixels, imagine running a stylus horizontally along the image:

● This gives us a one-dimensional function showing gray level at each point along the horizontal axis:

● Doing this repeatedly with lots of evenly-spaced scan lines gives us a grayscale map of the image: ● Height = grayscale value ● Spacing between lines = spacing within line

Color ● Light comes in difference wavelengths (frequencies):

● Like a sound, energy from a given light source (e.g., star) can be described by its wavelength (frequency) spectrum : the amount of each wavelength present in the source. Spectrum of vowel “ee” Frequency (Hz) Energy (dB) Spectrum of star ICR3287 Wavelength (nm) Intensity

● Light striking our eyes is focused by a lens and projected onto the retina. ● The retina contains photoreceptors (sensors) called cones that respond to different wavelengths of light: red, green, and blue. ● So retina can be thought of as a transducer that inputs light and outputs a three- dimensional value for each point in the image: [R, G, B], where R, G, and B each fall in the interval (0,1). ● So we can represent any color image as three “grayscale” images:

=, R, G B

Digital Sampling of Images ● Same questions arise for sampling images as for sound: – Sampling Frequency (how often to sample) – Quantization (# of bits per sample) ● With images, “how often” means “how many times per linear unit (inch, cm) – a.k.a. resolution (dpi) ● Focus on quantization – Each sample is either an RGB triple or an index into a color map – With too few bits, we lose gradual shading

Color Maps ● With 8 bits per color, 3 colors per pixel, we get 24 bits per pixel: 2 24 ≈ 17 million distinct colors ● We can actually get away with far fewer, using color maps ● Each pixel has a value that tells us what row in the color map to use ● Color map rows are R, G, B values:

Color Maps (in Matlab) >> colormap ans = >> size(colormap) ans = 64 3

Quantization Problems With too few bits, we lose gradual shading: 5 bits 1 bit 2 bits 3 bits 4 bits 6 bits 7 bits 8 bits

Sampling and Storing Images in Files Cameras / scanners usually output images in one of several formats – JP(E)G (Joint Photographic Experts Group) – GIF (Graphics Interchange Format) – PNG (Portable Network Graphics) – TI(F)F (Tagged Image File Format) As with sound formats, main issues in image formats are compression scheme (how images are stored and transmitted to save space/time) and copyright

JPEG Compression Images contain lots of redundant information

530 x 279 x 3 = bytes (assuming 3 bytes per pixel)

MOSTLY BLUE MOSTLY BROWN MOSTLY GREEN MOSTLY WHITE

Homebrew Compression

530, 84, 151,129, , 72, 255,255, , 66, 0,128,64 530, 60, 128,64,0 Homebrew Compression

Assuming two bytes per number 4*5*2 = 40 bytes / 40 = factor of 11000! 530, 84, 151,129, , 72, 255,255, , 66, 0,128,64 530, 60, 128,64,0

Lossy Compression This sort of compression is lossy: reduces size but loses resolution JPEG offers a better lossy compromise – typically, around factor 10 without noticeable loss in quality

1.Convert each RGB pixel into a form in which brightness (“Luminance”) has its own value, and use just two values (“Chrominance”, red or blue) for color. The JPEG Algorithm

2.Quantize the chroma data by a factor of two, because the eye is more sensitive to brightness than to color. The JPEG Algorithm E.g.:

3.Break the transformed image down into blocks of 8x8 pixels. We can represent each block as the weighted sum of various patterns, or frequency components, which will differ from block to block. The set of 64 weights becomes the new representation of the block. The JPEG Algorithm

4.Quantize the frequency weights, giving more precision (bits) to the low-frequency components: again, because the eye is more sensitive to low-frequency variations (big, slowly changing patterns). JPEG Quality refers to how much we allow the high-frequency components to persist. The JPEG Algorithm

JPEG Quality Re-compressed with Quality = 0:

5.Compress the quantized block weights using a lossless algorithm like Huffman Coding The JPEG Algorithm

The basic idea: Values that occur more often should be given shorter codes. In the previous sentence: Huffman Coding

So maybe use this code (ignoring space): Values that occur … …

Uses a tree structure to determine when we’re at the end of a code item: Huffman Code

All digital data (MS Word files, JPEG images, MP3 songs, MP4 videos) is just a sequence of numbers How we interpret those numbers depends on the program we’re using to look at the data Compressions schemes (JPEG, MP3) rely on ignoring the numbers that don’t make as much of a difference in our perception of the image, song, etc. JPEG is not a single algorithm; it’s a grab-bag of techniques that yield good results in combination Images: Summary