CSC1401 Using Decisions in Java - 2. Learning Goals Understand at a conceptual and practical level How to use conditionals with > 2 possibilities How.

Slides:



Advertisements
Similar presentations
CN: The Moon.
Advertisements

Color Wheel A tool to use to understand the uses of color.
Elements of Art: Value and Color Take notes, please. You can take this time to get additional markers/colored pencils.
Conditionals-part31 Conditionals – part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Value Value is an element of design. Value is defined as the lights and darks in an art work. Value can be black, white and ranges of grays or it can be.
Review Images – an array of colors Color – RGBA Loading, modifying, updating pixels pixels[] as a 2D array Simple filters – tinting, grayscale, negative,
Objectives Understand grayscale Investigate a grayscale image
Image Processing. Processing Digital Images digital images are often processed using “digital filters” digital filters are based on mathematical functions.
Choose the right picture
Value Element of Art. The luminosity, or range of lightness and darkness, in a picture.
Original image: 512 pixels by 512 pixels. Probe is the size of 1 pixel. Picture is sampled at every pixel ( samples taken)
Digital Image Processing Homework 4 TA. Yu-Lun Liu VC Lab. Dec.04, 2007.
Pixels, PPI, DPI, and LPI for Scanning, Printing, and Web Publishing
Art Element: ColorColor. These are: Primary colors Primary colors cannot be made by mixing other colors. Primary colors are mixed to make all of the other.
Chapter 3 Value and Spherical Shapes. Objectives Understand value and express a range of values as a value scale of grays. Determine the value of the.
Good Afternoon! 2/12/14 Today we are:  Learning color vocabulary  Learning about color schemes  Coloring pictures with different color schemes.
Color Wheel A tool to use to understand the uses of color.
Replacing colors using if We don’t have to do one-to-one changes or replacements of color We can use if to decide if we want to make a change.  We could.
Photo Editing Terminology. EXPOSURE Exposure controls the lightness in a picture.
“GREAT ART PICKS UP WHERE NATURE ENDS” – MARC CHAGALL.
The Color Wheel Primary Secondary Tertiary.
TONE/SHADE.
Two –Dimensional Arrays Mrs. C. Furman Java Programming November 19, 2008.
Photography I Final Exam Review Best Light of day for photos: the Golden Hours (1 hour after sunrise & 1 hour before sunset)
ManipulatingPictures-Mod6-part61 Manipulating Pictures, Arrays, and Loops: Eliminating color, Inversion, grey scale and adjusting for luminance Barb Ericson.
03-ConditionalsInPictures Barb Ericson Georgia Institute of Technology Feb 2010 Working with ranges in pictures.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
Drawing and Painting Fun (4th) - The effect of light. Monet -
Picture Lab. Manipulating Pictures Discussion and activities with java.awt.Color introduce students to megapixels, pixels, the RGB color model, binary.
Light Art 8 Sewanhaka Central High School District September 2011 by Diane Lennea.
What does the word value mean?. Value What is the value or how much is it worth? How much something costs That is a great value! It is a good deal. What.
Stagecraft – Sylvan Hills High School. ????????????????
Conditionals-Mod8-part41 Conditionals – part 4 Replace background Barb Ericson Georgia Institute of Technology May 2007.
CSC1401 Using Decisions in Java - 1. Recall from Alice We only wanted to shoot a lightning bolt at a philosopher So, we used the If statement.
TOPIC 10 THE IF STATEMENT 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Watercolor Step by step Flowers Watercolor Painting Step by Step Painting Flowers.
Fine Tune / Clone Stamp What is this? When do I do this? How do I use this? Illustrate in Gimp. What do all of the options do?
Shapes How many ways can you make shapes?. Digital Camera Slide- Show Heather St. Clair.
Hue: the property of light by which the color of an object is classified as red, blue, green, or yellow in reference to the spectrum. Saturation: the.
ManipulatingPictures-part31 Manipulating Pictures, Arrays, and Loops part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Choose the right picture Choose the right word. 5.
Painting Forms Focal Artist: Rembrandt van Rijn. Painting Vocab 1.Chiaroscuro - using strong contrasts of light and dark to achieve a sense of volume.
ITEC2110, Digital Media Chapter 3 Digital Image Processing 1 GGC -- ITEC Digital Media.
Com·pos·ite k ə m ˈ päz ə t/ verb Compositing is the combining of visual elements from separate sources into single images, often to create the illusion.
SHADING AND SHADOWS Light Source - Where the light in the picture comes from (the sun, a lamp, a candle). Can be seen by what parts of the objects are.
Movement of Grays On your practice paper create a series of grays from mixing complimentary colors. Take note of the colors you are using and which tones.
Elements of Design: Color
Topic 10 The if statement Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
Georgia Institute of Technology
I Shoes By: Erica Hunter.
Barb Ericson Georgia Institute of Technology August 2005
Pictures and cars.
Discussion #29 – Images II
Georgia Institute of Technology
Barb Ericson Georgia Institute of Technology August 2005
What Shapes Can You See in this Picture?
Workshop for Programming And Systems Management Teachers
Manipulating Pictures, Arrays, and Loops part 4
Georgia Institute of Technology
Manipulating Pictures, Arrays, and Loops
Manipulating Pictures, Arrays, and Loops part 6
Chapter 6 Conditionals - part 4
CSC1401 Viewing a picture as a 2D image - 2
Program Flow.
CS1315: Introduction to Media Computation
Pencils and their Value
AVI2O Drawing Lesson # 2.
Manipulating Pictures, Arrays, and Loops part 6
Write a story about the picture
Presentation transcript:

CSC1401 Using Decisions in Java - 2

Learning Goals Understand at a conceptual and practical level How to use conditionals with > 2 possibilities How to sepia-tint a picture How to do chroma key?

Sepia-Toned Pictures Have a yellowish tint, used to make things look old and western

Sepia-toned Algorithm First make the picture grayscale. Loop through the pixels in the picture Change the shadows (darkest grays) to be even darker (0 <= red < 60) Make the middle grays a brown color (60 <= red < 190) Make the highlights (lightest grays) a bit yellow (190 <= red) Increase red and green Or decrease blue

Using Multiple If Statements If we are doing different things based on a set of ranges 0 <= x <= 5 5 < x <= < x if (0 <= x && x <= 5) Statement or block if (5 < x && x <= 10) Statement or block if (10 < x) Statement or block

Using “else if” for > 2 Options If we are doing different things based on a set of ranges 0 <= x <= 5 5 < x <= < x You don’t need to check if x > 5 since the first if block would have executed if it was if (0 <= x && x <= 5) Statement or block else if (x <= 10) Statement or block else Statement or block

Conditionals with > 2 Choices if (0 <= x && x <= 5) { } else if (x <= 10) { } else // what is x? { }

Sepia-toned Method public void sepiaTint() { Pixel pixelObj = null; double redValue = 0; double greenValue = 0; double blueValue = 0; // first change the current picture to grayscale this.grayscale();

Sepia-toned Method - Cont // loop through the pixels for (int x = 0; x < this.getWidth(); x++) { for (int y = 0; y < this.getHeight(); y++) { // get the current pixel and color values pixelObj = this.getPixel(x,y); redValue = pixelObj.getRed(); greenValue = pixelObj.getGreen(); blueValue = pixelObj.getBlue();

Sepia-toned Method - Cont // tint the shadows darker if (redValue < 60) { redValue = redValue * 0.9; greenValue = greenValue * 0.9; blueValue = blueValue * 0.9; } // tint the midtones a light brown by reducing the blue else if (redValue < 190) { blueValue = blueValue * 0.8; }

Sepia-toned Method - Cont // tint the highlights a light yellow // by reducing the blue else { blueValue = blueValue * 0.9; } // set the colors pixelObj.setRed((int) redValue); pixelObj.setGreen((int) greenValue); pixelObj.setBlue((int) blueValue); }

Testing sepiaTint String file = FileChooser.getMediaPath(“gorge.jpg”); Picture p = new Picture(file); p.explore(); p.sepiaTint(); p.explore();

Chroma Key – Blue Screen For TV and movie special effects they use a blue or green screen Here just a blue sheet was used Professionally you need an evenly lit, bright, pure blue background With nothing blue in the scene

Chroma Key Exercise Write the method chromakey that takes a new background picture as an input parameter It will loop through all the pixels If the pixel color is blue (red + green < blue) Replace the pixel color with the color from the new background pixel (at the same location)

Testing chromakey Picture markP = new Picture(FileChooser.getMediaPath(“blue- mark.jpg”)); Picture newBack = new Picture(FileChooser.getMediaPath(“moon- surface.jpg”)); markP.chromakey(newBack); markP.show();

Summary Use if, else if, and else for > 2 possibilities Add additional else if’s as needed To sepia-tint a picture Change it to grayscale Make the shadows darker Make the middle grays brown Make the lightest grays yellow

Summary To chromakey Take a picture of a person in front of a blue screen Change the pixel color to the new background color If the blue value is greater than the red + green (for blue screen)

Assignment Read Media Computation Chapter 6, Sections 3-7