PPM file format CSE 681.

Slides:



Advertisements
Similar presentations
Software project Gnome Graphics Olga Sorkine Andrei Scharf Office: Schreiber 002, Web:
Advertisements

©College of Computer and Information Science, Northeastern UniversityApril 22, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 4.
C Programming. printf int printf ( const char * format,... ); printf ("Characters: %c \n", 'a'); printf ("Decimals: %d %f\n", 1977, 3.14); specifierOutputExample.
Bit Depth and Spatial Resolution SIMG-201 Survey of Imaging Science © 2002 CIS/RIT.
CSE 803 Using images in C++ Computing with images Applications & Methods 2D arrays in C++ Programming project 4.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
1 Lecture 2  Input-Process-Output  The Hello-world program  A Feet-to-inches program  Variables, expressions, assignments & initialization  printf()
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.
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)
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.
CS110: Computers and the Internet Color and Image Representation.
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
WEB GRAPHICS. The Pixel Computer displays are comprised of rows and columns of pixels. Pixels are indivisible. Some common screen resolutions are:, 600.
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.
Computers Organization & Assembly Language
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
You gotta be cool. Stream Stream Output Stream Input Unformatted I/O with read, gcount and write Stream Manipulators Stream Format States Stream Error.
Microsoft Word Objective: Understand Basic Word/Word Processing Skills Lesson: Create and Save a New Document LOL: Understand/Apply Create your first Word.
Agenda Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,, Font Attributes: size, color, face Horizontal.
Graphics and Images Graphics and images are both non-textual information, that can be displayed and printed. These images may appear on screen as well.
CS1033 Pixel and Resolution
Microsoft ® Word 2010 Training Create your first Word document I.
CSC 1010 Programming for All Lecture 7 Input, Output & Graphics.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
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,
Characters and Strings
©College of Computer and Information Science, Northeastern UniversityFebruary 21, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture.
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt Ratios & Percents Fractions There.
NXT File System Just like we’re able to store multiple programs and sound files to the NXT, we can store text files that contain information we specify.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
UNITS OF MEASUREMENT 2.01 Understand Digital Raster Graphics.
Text and Images Key Revision Points.
Multidimensional Arrays
Representation of image data
Do-more Technical Training
Lec 3: Data Representation
Topics Introduction Hardware and Software How Computers Store Data
ECE Application Programming
CPS120: Introduction to Computer Science
CPS120: Introduction to Computer Science
Reading Netpbm Images.
Computer Programming Methodology Files and Colors
Chapter 18 I/O in C.
Introduction to C CSE 2031 Fall /3/ :33 AM.
Computer Programming Methodology File Input
Tag Basics.
Microprocessor and Assembly Language
CS320n –Visual Programming
Outline Image formats and basic operations Image representation
Data Representation.
Introduction to HTML II
GrudgeBall Excel Chapter 2.
Ch2: Data Representation
Geb Thomas Adapted from the OpenGL Programming Guide
Prof. Harriet Fell Spring 2007 Lecture 19 – February 22, 2007
Topics Introduction Hardware and Software How Computers Store Data
2.01 Understand Digital Raster Graphics
Prof. Harriet Fell Spring 2007 Lecture 19 – February 22, 2007
Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
Hank Childs, University of Oregon
Binary CSCE 101.
Introduction to C CSE 2031 Fall /15/2019 8:26 AM.
Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007
Java-Assignment #4 (Due, April. 9, 2004)
Presentation transcript:

PPM file format CSE 681

Portable Pixmap File Format One of the simplest formats: “P3” - A "magic number" for identifying the file type. Whitespace (blanks, TABs, CRs, LFs). A width, formatted as ASCII characters in decimal. Whitespace. A height, again in ASCII decimal. The maximum color-component value, again in ASCII decimal. Width * height pixels, each three ASCII decimal values between 0 and the specified maximum value, starting at the top-left corner of the pixmap, proceeding in normal English reading order. The three values for each pixel represent red, green, and blue, respectively; a value of 0 means that color is off, and the maximum value means that color is maxxed out. Characters from a "#" to the next end-of-line are ignored (comments). No line should be longer than 70 characters. CSE 681

Example P3 # feep.ppm 4 4 15 0 0 0 0 0 0 0 0 0 15 0 15 0 0 0 0 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 15 7 0 0 0 15 0 15 0 0 0 0 0 0 0 0 0 CSE 681

Variant: Rawbits The "magic number" is "P6" instead of "P3". The pixel values are stored as plain bytes, instead of ASCII decimal. Whitespace is not allowed in the pixels area, and only a single character of whitespace (typically a newline) is allowed after the maxval. The files are smaller and many times faster to read and write. Note that this raw format can only be used for maxvals less than or equal to 255. If you use the ppm library and try to write a file with a larger maxval, it will automatically fall back on the slower but more general plain format. CSE 681

Some Unix Utilities Converters convert Viewers giftoppm, ppmtogif ppmtopict, picttoppm ppmtotga, tgatoppm Viewers display gqview CSE 681