Representation of image data

Slides:



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

Digital Images in Java Java’s imaging classes. Java imaging library  Java has good support for image processing  Must master a handful of classes and.
L.Ghadah R. Hadba CT1514-L1.  Computer Graphics :refers to processing of creating a new image from Geometry, Lighting parameters, Materials and Textures.Using.
CSE Lecture 6 – Complex Numbers & Images
Image Representation and Manipulation CS302 Data Structures Prof. George Bebis
ISYS 3074 Graphics File Formats File formats have developed with applications. At least 50 currently in use. Examples include: GIF, JPEG, TIFF, BMP, DIB,
Eleven colors and rasters. Color objects Meta represents colors with color objects You can create a color by saying: [color r g b] r: amount of red (0-255)
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.
Image representation methods. Bitmap graphic method of a black-and-white image.
Graphics in the web Digital Media: Communication and Design
CS110: Computers and the Internet Color and Image Representation.
L.
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
WEB GRAPHICS. The Pixel Computer displays are comprised of rows and columns of pixels. Pixels are indivisible. Some common screen resolutions are:, 600.
Filtering (I) Dr. Chang Shu COMP 4900C Winter 2008.
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.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
Digital Images Chapter 8, Exploring the Digital Domain.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Foundations of Web Design I Photoshop CS5 Michael Daniel
Department of Information Technology Chapter 8 - Creating Hypertext links Lecturer: Ms Melinda Chung.
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.
September 21, COMPUTER VISION WEB PAGE IS UP !! OR Simply go to computer science homepage.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
ADOBE PHOTOSHOP VECTOR VS RASTER. Pixel A pixel is the fundamental unit of an image in Photoshop. It is a small square block of color. An image often.
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.
Introduction to Raytracing Raytracing Introduction (from Wikipedia) In computer graphics, ray tracing is a technique for generating an image by tracing.
Images. Digital Images Rectangular arrays of pixel data Pixel - picture element, smallest addressable part of the frame buffer. Color depth - the depth.
Mirjana Devetakovic, M.Sc. CAAD - Images Beograd, 2011.
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.
Screen Basic color – RGB Print Basic Color - CMYK R – Read G – Green B - Blue Total Color combination: 256x256x256=16,777,216 Total Printing Color.
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.
Image Representation and Read/Write CS479/679 – Prof. Bebis.
Photoshop CS6 – Nelson Unit 3: Photoshop CS6. Objectives Define photo editing software Start Photoshop and view the workspace Use the Zoom tool and the.
Hank Childs, University of Oregon April “29 th”, 2015 CIS 330: _ _ _ _ ______ _ _____ / / / /___ (_) __ ____ _____ ____/ / / ____/ _/_/ ____/__ __ / /
Multidimensional Arrays
Computer Application in Engineering Design
Images Data Representation.
Getting Started with Adobe Photoshop CS6
Image Processing Objectives To understand pixel based image processing
David Meredith Aalborg University
The Machine Model Memory
Sampling, Quantization, Color Models & Indexed Color
Image Processing CS177.
Chapter 2: How are data represented?
Images In Matlab.
Chapter 3 Graphics and Image Data Representations
Reading Netpbm Images.
DIP 9 65 Original 210 Eye Zoomed.
Week 13 - Monday CS 121.
Raster Images CPSC 1030.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Colors.
CS320n –Visual Programming
Outline Image formats and basic operations Image representation
Representing Images 2.6 – Data Representation.
Multidimensional Arrays and Image Manipulation
Nuts and Bolts of Digital Imaging
Fourth Year – Software Engineering
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Colors Computers build colors from Red, Green, and Blue; not Red, Blue, and Yellow. RGB = Red Green Blue Creating Colors Red + Blue = Purple No Red, No.
Multimedia System Image
Hank Childs, University of Oregon
Basic Concepts of Digital Imaging
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
PGM Format CS474/674 – Prof. Bebis.
Presentation transcript:

Representation of image data Images (e.g. digital photos) consist of a rectanglular array of discrete picture elements called pixels. An image consisting of 200 pixels rows of 300 pixels per row contains 200 x 300 = 60,000 individual pixels. The Portable PixMap (.ppm) format is a particularly simple way used to encode a rectangular image (picture) as an uncompressed data file. The .ppm file can be viewed with a number of tools, including xv and gimp. Other well-known image formats include JPEG (.jpg), TIFF (.tif), and PNG (.png)

Representation of image data A .ppm image file contains the representation of an image (like a .jpg or .gif file) and can be in one of several different formats for an image. The PPM (Portable PixMap) format is used to represent images that contain color. A PGM (Portable GrayMap) format is used for grayscale images. The format of the file can be determined by the first two bytes. The code “P5” indicates a PGM file, the code “P6” indicates a PPM file.

Color Images correspond to color photographs each pixel consists of 3 bytes with each byte represented as an unsigned char this format is called RGB. three bytes represent the red component green component blue component when red == green == blue a grayscale "color" is produced. (255, 255, 255) is bright white.

Images Colors are additive (255, 255, 0) = red + green = bright yellow (255, 0, 255) = red + blue = magenta (purple) (0, 255, 255) = green + blue = cyan (turquoise) (255, 255, 255) = red + green + blue = white

PPM file structure A ppm file consists of two components: ppm header packed image data

PPM file structure Example of a .ppm header for a color image P6 # This is a comment 600 400 255 The P6 indicates this is a color image The width of the image is 600 pixels The height of the image is 400 pixels The 255 is the maximum value of a pixel Following the 255 is a \n (0x0a) character.

PPM file structure The image data The red component of the upper left pixel must immediately follow the new line. For the image described earlier, there must be a total of 3 x 600 x 400 = 72,000 bytes of data.

Example /* CPSC 1070: redgreen.c This program creates a ppm file for a 600x400 box, that is red in the left half and green in the right half. The ppm image is written to the file specified on the command line, e.g. the program is initiated as: ./redgreen output-filename which would create the PPM image file specified by output-filename */

Example const int WIDTH = 600; const int HEIGHT = 400; #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "image.h" int main(int argc, char *argv[]) { color_t *img; /* image array */ color_t *pixaddr = NULL; /* address of current pixel */ int rowNdx, colNdx; /* row and column indices */ int half; /* half-way width */

Example /* Declare and open the PPM output file */ FILE *imageFP = fopen("img.ppm", "w"); half = WIDTH / 2; pixaddr = img; /* Write the ppm header */ fprintf(imageFP, "P6 %d %d 255\n", WIDTH, HEIGHT);

Example /* Write the pixel data */ for (rowNdx = 0; rowNdx < HEIGHT; rowNdx++) { for (colNdx = 0; colNdx < WIDTH; colNdx++) { pixaddr->blue = 0; /* No blue in image */ if (colNdx < half ) { /* Left half of image */ pixaddr->red = 255; pixaddr->green = 0; } else { /* Right half of image */ pixaddr->red = 0; pixaddr->green = 255; pixaddr++;

Example 2 /* Write out the pixel */ fwrite(img, sizeof(pixel_t), WIDTH * HEIGHT, imageFP); /* release allocated memory */ free(img); return 0; } The code produces the following red-green image