04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

462<br />

// blend() Function with Altered Source Image Coordinates<br />

// background image <strong>and</strong> PImage should be 300 x 400 pixels<br />

size(300, 400);<br />

background(loadImage("airport.jpg"));<br />

PImage img = loadImage("towers.jpg");<br />

blend(img, 0, 300, 300, 10, 0, 0, 300, 400, DARKEST);<br />

Figure 10-44. blend() Function with Altered Source Image Coordinates<br />

sketch<br />

// blend() Function with Altered Destination Image Coordinates<br />

// background image <strong>and</strong> PImage should be 300 x 400 pixels<br />

size(300, 400);<br />

background(loadImage("airport.jpg"));<br />

PImage img = loadImage("towers.jpg");<br />

blend(img, 0, 0, 300, 400, 0, 200, 300, 200, DARKEST);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!