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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In the “Imaging” section, you delved a little deeper, looking at <strong>Processing</strong>’s color component<br />

functions, which I used to show how to generate a series of pixel-based gradients. I<br />

discussed speed issues when processing hundreds of thous<strong>and</strong>s of pixels, <strong>and</strong> I looked at a<br />

lower-level approach to increasing performance, using bitwise operations. I also discussed<br />

the problem or challenge of managing potential rounding errors when moving between<br />

floats <strong>and</strong> ints, <strong>and</strong> how subtle changes such as these can have dramatic effects.<br />

Using <strong>Processing</strong>’s loadPixels(), updatePixels(), <strong>and</strong> pixels[] functions, I discussed<br />

approaches for writing <strong>and</strong> transforming pixel data. I compared the somewhat confusing<br />

differences between using the display window functions, based on the pixesl[] array, <strong>and</strong><br />

using <strong>Processing</strong>’s PImage data type, with its own properties <strong>and</strong> methods, including<br />

another pixels[] array property.<br />

<strong>Processing</strong>’s blend <strong>and</strong> filter capabilities are extensive, <strong>and</strong> you looked in detail at each, at<br />

times going below the hood <strong>and</strong> even re-creating your own imaging effects, using both<br />

<strong>Processing</strong> functions <strong>and</strong> bitwise operations. Finally, I extended the discussion on OOP<br />

with an inheritance example, generating a simple framework for creating gradients.<br />

In the next chapter, you’ll be revisiting many of the topics covered in the book thus far, as<br />

I introduce motion into the sketches. In addition, you’ll explore interesting <strong>and</strong> fun<br />

approaches to simulating organic motion <strong>and</strong> physics. And you’ll also continue your exploration<br />

of OOP.<br />

COLOR AND IMAGING<br />

479<br />

10

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

Saved successfully!

Ooh no, something went wrong!