Wednesday, December 26, 2012

Computer Graphics Programming with Processing

Computer Graphics is a vast field, and there are so many programming languages and tools available for creating graphics that it could make your head spin! So, how to get started?? Well, one of the cool tools available now for creating graphics and animations is the Processing programming language. In this blog I'll give you an overview of the language and show you how easy it is to get started creating your own computer graphics with it.

Processing is a free, open-source programming language and development environment that is used to create computer graphics, animations, and interactions.  Initially it was developed to serve as a learning tool to teach fundamentals of computer programming within a visual context, but it has evolved into a tool for generating high-quality finished professional work. There are numerous reasons why Processing has become popular:
  • It runs on multiple platforms.  Processing can be used on Windows, Mac, and Linux-based computers.
  • You can create graphics in many formats.  Graphics created with Processing can be saved in many standard formats.  Animations and interactions may be exported to run on the Web or as standalone applications.  
  • It is highly extensible. The capabilities of the platform continue to be extended by the Processing community, which has written over seventy libraries to facilitate computer vision, data visualization, music, networking, and electronics.
The Processing platform consists of the programming language, the development tools, and the software libraries.  Let's look at each of these in a little more detail...

Processing Language
The Processing language is built on the Java programming language, but uses a simplified syntax and a visual, graphics-based programming model.   As such you have the full power of Java at your disposal, but use a more intuitive, visual-based approach for development, thereby enabling you to focus on creating graphics, not on the details of the underlying programming language.  A core set of language elements are installed in the development environment and are directly available for creating sketches.

Software Libraries
The Processing platform contains numerous software libraries for creating and editing computer graphics.  Imported Libraries are included with the Processing development environment; whereas the Contributed Libraries must be downloaded separately and installed.  As noted earlier there are now over 70 libraries available for the platform, and the list continues to grow as more people use Processing and contribute back.

Text Editor
The Processing platform includes a text editor that can be used for development.  A Processing program is created in a project called a sketch.  Each sketch is written with the Processing text editor in its own folder.  In the sketch you write the code to create and manipulate graphics, perform animations, etc.  A sketch folder can also contain other folders for media files and code libraries.

Getting Started!
There are plenty of resources available in books and online to help you get started creating graphics with Processing.  The Processing home page contains up-to-date information along with references to get you started; there you'll also find plenty of example programs and resources.  I also included several examples (2D and 3D graphics, and a computer animation) at the Programming for Everyone website that you're free to use and modify as you please.  Processing has been designed to be easy to use and now that you know a little more about it, I encourage you to visit the Processing and begin creating some great computer graphics and animations.  In fact, in an upcoming blog you'll see just how easy it is as we use Processing to create some example computer graphics ourselves!


Programming for Everyone is designed to give the reader an introduction to computer programming. The book is written for a very general audience and focuses on providing you with a detailed understanding of the basic concepts.  It's also great for programmers who want to learn about other programming areas (e.g. logic programming, computer graphics, games, etc.) they may not have experience in.  Whatever your age or background, Programming for Everyone will help you to understand computer programming!