Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007

Slides:



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

1 Introduction to Computer Graphics with WebGL Prof. John Gauch CSCE Department Spring 2015 Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley.
College of Computer and Information Science, Northeastern UniversityApril 17, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 9.
©College of Computer and Information Science, Northeastern UniversityApril 22, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 4.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source.
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.
4.01 Cascading Style Sheets
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
College of Computer and Information Science, Northeastern UniversitySeptember 7, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2007.
Java: Chapter 1 Computer Systems Computer Programming II.
Digital Image: Representation & Processing (2/2) Lecture-3
Images Data Representation. Objectives  Understand the terms bitmap & pixel  Understand how bitmap images are stored using binary in a computer system.
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
Web Design I Spring 2009 Kevin Cole Gallaudet University
©College of Computer and Information Science, Northeastern UniversityOctober 19, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2007.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Java is an object oriented programming language In this model of programming all entities are objects that have methods and fields Methods perform tasks.
Creating your own image data files. Simple ASCII file output in Java import java.io.FileOutputStream; import java.io.PrintWriter; … PrintWriter out =
©College of Computer and Information Science, Northeastern UniversityMay 27, CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 4 – September.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
©College of Computer and Information Science, Northeastern UniversityNovember 29, CS 5310 Graduate Computer Graphics Prof. Harriet Fell Spring 2011.
CSC 1010 Programming for All Lecture 7 Input, Output & Graphics.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
©College of Computer and Information Science, Northeastern UniversityFebruary 21, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture.
©College of Computer and Information Science, Northeastern UniversityFebruary 25, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2009.
Texture Mapping What is texture mapping? - a method for adding detail, surface texture (a bitmap or raster image), or color to a computer-generated graphic.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
CS-401 Computer Architecture & Assembly Language Programming Lecture-16 Display Memory.
Representation of image data
4.01 Cascading Style Sheets
Design Concepts: Module A: The Science of Color
Static picture effects for PowerPoint slides
Reading Netpbm Images.
Computer Programming Methodology Files and Colors
Computer Programming Methodology File Input
Tag Basics.
CS5310 Graduate Computer Graphics
Microprocessor and Assembly Language
Static picture effects for PowerPoint slides
CS320n –Visual Programming
Computer Graphics.
Outline Image formats and basic operations Image representation
Solve Linear and Quadratic Systems Algebraically
Prof. Harriet Fell Spring 2007 Lecture 9 – January 29, 2007
Color Values All colors in computer images are a combination of red, green and blue Each component is encoded as a number means the color is.
Ch2: Data Representation
CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random
Prof. Harriet Fell Spring 2007 Lecture 19 – February 22, 2007
#4 Grade 1 ~ Sight Words Pictures series in film strip effect
Prof. Harriet Fell Spring 2007 Lecture 19 – February 22, 2007
Instructions for creating a template in MS Frontpage
WIZCHANNELS.COM Step 1. Stb emulator main menus on 1st startup.
گزارش فعالیت سه ماهه دبستان ابن سینا
COMS 161 Introduction to Computing
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.
Plotting Signals in MATLAB
2D Graphics Lecture 4 Fri, Aug 31, 2007.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Digital Image Processing
Window to Viewport Transformations
Visuals are analog signals...
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
4.01 Cascading Style Sheets
PPM file format CSE 681.
Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Java-Assignment #4 (Due, April. 9, 2004)
Presentation transcript:

Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007 CS U540 Computer Graphics Prof. Harriet Fell Spring 2007 Lecture 4 - January 17, 2007 January 11, 2019

Color www.thestagecrew.com January 11, 2019

Red, Green, and Blue Light January 11, 2019

Adding R, G, and B Values http://en.wikipedia.org/wiki/RGB January 11, 2019

From the Hubble Hubble Site Link January 11, 2019

RGB Color Cube (0, 0, 1) (0, 1, 1) (1, 0, 1) (1, 1, 1) (1, 0, 0) (1, 1, 0) (0, 0, 1) (0, 1, 1) (0, 1, 0) (1, 0, 1) (1, 0, 0) January 11, 2019

RGB Color Cube The Dark Side (0, 0, 0) (1, 1, 0) (0, 0, 1) (1, 0, 1) (1, 0, 0) (0, 1, 1) (0, 1, 0) January 11, 2019

Doug Jacobson's RGB Hex Triplet Color Chart January 11, 2019

Making Colors Darker (1, 0, 0) (.5, 0, 0) (0, 0, 0) (0, 1, 0) (0, .5, 0) (0, 0, 0) (0, 0, 1) (0, 0, .5) (0, 0, 0) (1, 1, 0) (0, .5, .5) (0, 0, 0) (1, 0, 1) (.5, 0, .5) (0, 0, 0) (1, 1, 0) (.5, .5, 0) (0, 0, 0) January 11, 2019

Getting Darker, Left to Right for (int b = 255; b >= 0; b--){ c = new Color(b, 0, 0); g.setPaint(c); g.fillRect(800+3*(255-b), 50, 3, 150); c = new Color(0, b, 0); g.setPaint(c); g.fillRect(800+3*(255-b), 200, 3, 150); c = new Color(0, 0, b); g.setPaint(c); g.fillRect(800+3*(255-b), 350, 3, 150); c = new Color(0, b, b); g.setPaint(c); g.fillRect(800+3*(255-b), 500, 3, 150); c = new Color(b, 0, b); g.setPaint(c); g.fillRect(800+3*(255-b), 650, 3, 150); c = new Color(b, b, 0); g.setPaint(c); g.fillRect(800+3*(255-b), 800, 3, 150); } January 11, 2019

Gamma Correction Generally, the displayed intensity is not linear in the input (0  a  1). dispIntensity = (maxIntensity)a To find  Find a that gives you .5 intensity Solve .5 = a  = ln(.5) ln(a) January 11, 2019

Gamma Correction Gamma half black half red (127, 0, 0) January 11, 2019

Making Pale Colors (1, 0, 0) (1, .5, .5) (1, 1, 1) (0, 1, 0) (.5, 1, .5) (1, 1, 1) (0, 0, 1) (.5, .5, 1) (1, 1, 1) (1, 1, 0) (.5, 1, 1) (1, 1, 1) (1, 0, 1) (1, .5, 1) (1, 1, 1) (1, 1, 0) (1, 1, .5) (1, 1, 1) January 11, 2019

Getting Paler, Left to Right for (int w = 0; w < 256; w++){ c = new Color(255, w, w); g.setPaint(c); g.fillRect(3*w, 50, 3, 150); c = new Color(w, 255, w); g.setPaint(c); g.fillRect(3*w, 200, 3, 150); c = new Color(w, w, 255); g.setPaint(c); g.fillRect(3*w, 350, 3, 150); c = new Color(w, 255, 255); g.setPaint(c); g.fillRect(3*w, 500, 3, 150); c = new Color(255,w, 255); g.setPaint(c); g.fillRect(3*w, 650, 3, 150); c = new Color(255, 255, w); g.setPaint(c); g.fillRect(3*w, 800, 3, 150); } January 11, 2019

Portable Pixmap Format (ppm) A "magic number" for identifying the file type. A ppm file's magic number is the two characters "P3". Whitespace (blanks, TABs, CRs, LFs). A width, formatted as ASCII characters in decimal. Whitespace. A height, again in ASCII decimal. The maximum color value again in ASCII decimal. Width * height pixels, each 3 values between 0 and maximum value. start at top-left corner; proceed in normal English reading order three values for each pixel for red, green, and blue, resp. 0 means color is off; maximum value means color is maxxed out characters from "#" to end-of-line are ignored (comments) no line should be longer than 70 characters January 11, 2019

ppm 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 January 11, 2019

private void saveImage() { String outFileName = “my.ppm"; File outFile = new File(outFileName); int clrR, clrG, clrB; try { PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(outFile))); out.println("P3"); out.print(Integer.toString(xmax-xmin+1)); System.out.println(xmax-xmin+1); out.print(" "); out.println(Integer.toString(ymax-ymin+1)); System.out.println(ymax-ymin+1); out.println("255"); for (int y = ymin; y <= ymax; y++){ for (int x = xmin; x <= xmax; x++) { // compute clrR, clrG, clrB out.print(" "); out.print(clrR); out.print(" "); out.print(clrG); out.print(" "); out.println(clrB); } out.close(); } catch (IOException e) { System.out.println(e.toString()); January 11, 2019