Monday, February 21st, 2011...1:20 pm
Processing a wild fireworks show
The programming language processing, is an open source programming language for people who want to create images and animations. Those with computer experience can quickly create code with captivating visual interest. Artists can write code via a frontend that simplifies many aspects of coding.
For instance, the image below is created with a for-loop by Annie Temmink, a Davidson student who studied processing last term with me in an independent study. Can you imagine how a loop could produce such an image?
Here is the corresponding code:
size(900,400);
PImage pict;//load image
pict=loadImage(“portrait11.jpg”);
for(int i=0;i< 40;i++){
image(pict,i*15,0,pict.width/3,pict.height/3);
}
Below she experiments with the ever-important double loop.

The code that produces such an image is:
size(1000,500);
int n=4;
colorMode(RGB);
PImage pic;//load image
pic=loadImage(“portrait.jpg”);
for(int j=-1;j<2;j++){
for(int i=-1;i< 10;i++){
image(pic,i*pic.width/(n*3),j*pic.height/n,pic.width/n,pic.height/n);
tint(60+i*35,i*15,i+50+i*15,255-i*70);//change tint
}
tint(60+j*35,50+j*15,j+50+j*15,100);//brighten image
}
Processing is very close to Java and as such allows one to work with objects and OOP. A wonderful part of the community of processing coders is the large number of codes that are placed online and can be adapted for personal use. For instance, Daniel Martin, another Davidson student who graduates this May, began coding with processing quickly after Annie gave a talk on it to the Math Department. Soon, he found a fireworks class and made the following application that adapts the code. How do you make an applet? Processing allows you to easily produce a .java file, an applet, or a jar application. Click the black sky below and enjoy the show!
Interested in learning to code? Try processing! Interested in producing amazing images and interactive applications? Try processing! It is easy to learn, has an online community to help you experiment and explore. And, it’s, quite frankly, cool! Enjoy.

90 Comments
Trackbacks/Pingbacks