CS324e - Elements of Graphics and Visualization Compositing.

Slides:



Advertisements
Similar presentations
Mask form Plaster Kraft Corrugated cardboard for backing Awl or something similar to punch holes in the cardboard Embellishments, paint Feathers Beads.
Advertisements

Compositing and Blending Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Graphics Programming. Introduction GOAL: Build the Indexer Client Event-driven vs. Sequential programs Terminology – Top-level windows are called “frame.
More Java Drawing in 2D Animations with Timer. Drawing Review A simple two-dimensional coordinate system exists for each graphics context or drawing surface.
Blending MAE152 Computer Graphics for Engineers and Scientists Fall 03.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Raster Displays Images are composed of arrays of pixels displayed on a raster device. Two main ways to create images: –Scan and digitize an existing image.
1cs426-winter-2008 Notes  More papers to read: T. Duff, "Compositing 3-D rendered images", SIGGRAPH 1985 R. Cook, "Distributed ray tracing", SIGGRAPH.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 6: Image Compositing, Morphing Ravi Ramamoorthi
1 CS 248 – Project 1 Help Session (demo) (demo) Painting RGB and HSV sliders Brush visualization Weighted mask driven painting HSV checkboxes.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 12 Chapter 12: Making the Applications Interesting.
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.
CS 4731: Computer Graphics Lecture 21: Raster Graphics Part 2 Emmanuel Agu.
02/14/02(c) University of Wisconsin 2002, CS 559 Last Time Filtering Image size reduction –Take the pixel you need in the output –Map it to the input –Place.
PowerPoint Drawing Tools Review and New Learning.
DIGITAL GRAPHICS & ANIMATION Complete LESSON 5 CREATING SPECIAL EFFECTS.
Photoshop: Getting to Know Layers Computer Information Technology Section 7-5.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
Java Software Solutions Lewis and Loftus Chapter 7 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphics -- Introduction The.
Computer Graphics Lecture 1 July 11, Computer Graphics What do you think of? The term “computer graphics” is a blanket term used to refer to the.
Graphics and Multimedia Part #2
2D Graphics: Rendering Details
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
Filtering and Color To filter a color image, simply filter each of R,G and B separately Re-scaling and truncating are more difficult to implement: –Adjusting.
3D Game Programming All in One By Kenneth C. Finney.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
Lecture 4 Pixels, Images and Image Files 1. In this Lecture, you will learn the following concepts: Image files (in particular, the BMP file format) How.
Pixels, Images and Image Files 1 By Dr. HANY ELSALAMONY.
Advanced User Interfaces with Java SD’98 - Session 3206 Ted Faison Faison Computing Inc.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 3 2D Graphics: Rendering Details.
3.2. G RAPHICS I Alpha blending within games. An exploration of the use of alpha blending within games.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Computer Graphics Dr. Kourosh Kiani
Java Graphics. Review 3 kinds of elements in components API? Layout managers Events Extend vs. Implement.
1 Chapter 3 2D Graphics: Rendering Details  Color spaces, paints stroke types  Affine transforms including translation, rotation, scaling, shearing,
Android Graphics Library. Color Android colors are represented with four numbers, one each for alpha, red, green, and blue (ARGB). Each component can.
Lesson 6: Drawing, Painting and Puppetry CMM204 – Digital Media Effects.
OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture.
Paint Application in Java Clark Jayson Cacal Aveline Germar Jose Sison Christopher Valera.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
18.1 Light and Color Pg
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Lynwood Dunn ( ) Visual effects pioneer Acme-Dunn optical printer.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
Graphics Graphics Korea University cgvr.korea.ac.kr Image Processing 고려대학교 컴퓨터 그래픽스 연구실.
Fall UI Design and Implementation1 Lecture 6: Output.
UniS CS297 Graphics with Java and OpenGL Blending.
Masks and Channels Digital Imaging. Masks  Let you isolate and protect parts of an image  Based on a selection The area not selected is masked or protected.
WORKING WITH SELECTIONS MASKS and CHANNELS 3D IMAGES LAYER BASICS PHOTO.
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.
Pixels, Colors and Shapes
Adobe software utilization
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
CSC020, Computer Graphics Adjustment Layers 1.
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
Composing Two Elements
Light and Color.
Texture Texture refers to the way something feels.
Making the Applications Interesting
Graphics -- Introduction
Alpha blending within games
© University of Wisconsin, CS559 Spring 2004
blending blending textures reflection fog
(c) 2002 University of Wisconsin, CS 559
Blending CSCI 440 textbook section 7.10
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
CS297 Graphics with Java and OpenGL
Presentation transcript:

CS324e - Elements of Graphics and Visualization Compositing

How to store or combine colors in a drawable primitive (Shape, String, Image) with the colors already present in the destination aka Blending used extensively to combine CGI effects and live footage Java 2D: – Composite interface – setComposite method on Graphics2D object 2

Alpha Compositing Composite class implemented by one class in Java: AlphaComposite rules affect the alpha value (transparency) rules are mathematical and determine color and alpha for source (thing being drawn) and the destination (the graphics area and the things that have already been drawn) 3

Porter Duff Rules 12 rules in AlphaComposite Paper by Thomas Porter and Tom Duff Clear, Dst, dstAtop, DstIn, DstOut, DstOver, Src, SrcAtop, ScrIn, SrcOut, SrcOver, Xor 4

Math Behind One Example Source Over, SrcOver "Composite the source over the destination as if the source were a translucent painting on a piece of glass held over the destination." – mixing of colors 5

Source Over A r = A s + A d * (1 - A s ) C r = C s + C d * (1 - A s ) A is the alpha channel (value) of the pixel C is the color component of the pixel r = result s = source d = destination 6

Src Over Result red oval is source – alpha set to 50% blue rectangle is destination drawn onto a transparent image (any non blue pixels are transparent) 7

Example 2- DstOut "The part of the destination lying outside of the source replaces the destination. Opposite of DstIn, but with an alpha value of 50 percent, both operations look the same" A r = A d * (1 - A s ) C r = C d * (1 - A s ) notice, no red only effect from alpha of source 8

Example Program red oval is source blue rectangle is destination drawn onto a transparent image (any non blue pixels are transparent) Java adds parameter to Porter-Duff rules, alpha value of source prior to blending with destination – In examples alpha values 50% opacity 9

Clear Color and alpha of destination cleared 10

Dst Destination untouched (not so useful) 11

DstAtop Part of destination inside of source is composited with source and replaces destination. Destination appears to be drawn on top of source. 12

DstIn The part of the destination inside the source replaces the destination 13

DstOut The part of the destination outside the source replaces the destination 14

DstOver The destination is composited with the source and the result replaces the destination. 15

Src Source copied into destination. (no blending due to alpha) 16

SrcAtop Source inside the destination is composed with the destination. Source outside destination discarded. 17

SrcIn Source inside destination replaces destination. Source outside destination discarded. 18

SrcOut Source outside destination replaces destination. Part of source inside is discarded 19

SrcOver Source is composed / blended with destination. (Standard behaviors of graphics object) 20

Xor Source outside destination combined with part of destination that is outside source. – similar to CAG 21

Effects with AlphaComposites Four most useful rules: – Clear, Src, SrcOver, SrcIn Clear: – erase an arbitrary shape. 22

Programmer Defined Composites Examples from Filthy Rich Clients Recall, two images, a source and a destination Composites similar to image filtering – Recall BufferedImageOp FRC textbook: BlendComposites Implements the Composite interface Lots of support code 23

BlendComposites Lots of support code, but different Composites from different rules (blending) for combining source and destination image Example images 24 src dest

BlendComposites - ADD 25 Array values are RGBA

BlendComposites - GLOW 26

Putting AlphaComposites and Gradients to Use Create a reflection of an image using gradients and alpha composite Draw an image Draw the same image below it, reflected Create a paint that varies alpha from half to 0 Use Alpha Composite to combine alpha paint and upside down image 27

Image 28

Reflection 29

Gradient (alpha mask) 30

Final result using AlphaComposite DstIn 31