Ubuntu 12.04: How to Install Processing

Processing can be downloaded and installed from Processing.org. As the supported platforms page in the Processing Wiki indicates, installation on Linux can be complicated.

In the following instructions, I’m going to assume you have a basic acquaintance with the Terminal and command lines, at least enough to get around the operating system. This is a really useful skill to acquire in Linux (and MacOS) and can improve your abilities as a programmer. In any case, if you can open a Terminal, you can probably get through the instructions here and on the pages I link to. You will need admin access to run some of the commands, specifically those that begin with sudo.

First, download Processing. On Ubuntu 12.04, the 64-bit architecture is appropriate. It downloads as a .tgz archive, typically into the Downloads folder in your Home folder. You can extract the archive by double-clicking in Ubuntu’s file system browser or extract it from the command line in a Terminal with tar -xf processing-2.2.1-linux64.tgz. Once you have extracted the folder processing-2.2.1, you’ll need to decide where to locate it. I created a new directory, Developer, in my Home Folder, and moved Processing to it just by dragging and dropping. You could also install Processing in the /opt/ folder, though this requires an admin account and use of the Terminal.

If Processing just ran out of the box, you could double-click and run the processing script in the processing-2.2.1 folder or point a Terminal to the folder and type ./processing and hit return (the latter is the approach I recommend). That is unlikely to work because of incompatibilities with the downloaded version of Java in Processing and the default Java environment on Ubuntu. You can resolve the incompatibilities in two steps: installing a new version of Java and adjusting Processing’s directory structure. After reading the supported platforms page in the Processing Wiki, I decided that it made the most sense to install Oracle Java 7.

Installing Oracle Java 7

Information on issues with Java can be found in Ubuntu Help. Take a moment to read the section on Oracle Java 7. Because of licensing issues, Java has to be downloaded and installed from Oracle. Fortunately, there is a tool to simplify this process at webupd8.org. The documentation is clear and simple, and I leave you to it. Once you’ve installed Java, run the Java environment variables installer, too. FWIW, here is my command history for this process:

35 java -version
36 sudo add-apt-repository ppa:webupd8team/java
37 sudo apt-get update
38 sudo apt-get install oracle-java7-installer
39 java -version
40 sudo apt-get install oracle-java7-set-default
41 update-alternatives --display java

Adjustments to Processing

Once you have Oracle Java 7 installed and set as the default version of Java in Ubuntu, you’ll still need to modify Processing to use the newly installed version instead of its own. First, copy Processing’s fonts to the newly installed version of Java. You’ll have to change the command lines to reflect the directory structure for your particular installation of Processing. Oracle Java 7 directories should be the same.

cd /usr/lib/jvm/java-7-oracle/jre
sudo cp -R '/home/ignotus_mago/Developer/processing-2.2.1/java/lib/fonts' lib

Next, in your Processing directory, rename the java folder.

cd '/home/ignotus_mago/Developer/processing-2.2.1'
mv java java_old

Now create a symbolic link (symlink) to Oracle 7 Java’s java binary:

ln -s /usr/lib/jvm/java-7-oracle/jre java

At this point, you should be able to run Processing from the Terminal with ./processing. It works for me. YMMV, but I suspect that it should work in most cases. Getting all of Processing’s libraries up and running and getting Processing to run in the Eclipse IDE in Ubuntu are topics I expect to tackle later.

GlitchSort for Processing 2.0

I am happy to announce the release of a new version of GlitchSort, 1.0b10, for Processing 2.0. GlitchSort is a versatile glitching application that began as a sorting algorithm demo for my class at SAIC, Code Sourcery. Up until a few weeks ago, Processing 2.0 suffered from a memory leak that prevented GlitchSort from working. Now that the leak is fixed, I have no excuse: here’s the update. See the GlitchSort Page for details.


GlitchSort is a Processing application that uses interrupted pixel-sorting to create glitchy images. Since it has found an audience among glitch artists, I’m setting up this page as a point from which to download a current version and reference materials, as these become available. I’ll also post news or links to news about GlitchSort here.

GlitchSort 1.0b10, for Processing 2.0, is available as of June 7, 2013: GlitchSort_v01b10.zip. Processing 2.0 fixes the image memory leak that plagued previous releases. Note that GlitchSort for Processing 2.0 requires ControlP5 2.0.4, which is not bundled with the Processing application (it is bundled with the standalone applications).

There are bundled applications for Windows32, Windows64, MacOSX, Linux32 and Linux64: YMMV as far as running these. If you have Java installed, they should run, but I have only tested them on MacOS.

The bundled documentation is for version 0.1b8, but I describe new features below and in the source code.  Here is a higher resolution version of the manual (33M PDF) with much better image quality. The print version (60M PDF) offers the highest resolution, for printing. Online reference manual can be viewed here (1.6M PDF). Download or view the optimized high resolution version (33M PDF) here. Very high resolution print version (61.5M PDF) here.

GlitchSort2 Manual Cover

GlitchSort2 Manual Cover

Version 1.0b10 adds commands that use capital letters (shift key + key). These change the behavior of the save, revert, open and turn 90° commands. See the changes.txt file or comments in the code for details. 1.0b10 also allows you to set a percentage of zigzag sorting.

GlitchSort 1.0b9, the last version for Processing 1.5.1, is available here: GlitchSort_v01b9.

Version 1.0b9 revised the zigzag sorting by providing check boxes to set zigzag sorting to random angles, aligned angles,  or angles permuted in blocks of four. It also adds the scaledLowPass method, a low pass filter on each RGB channel with a different FFT block size (64, 32, 16) for each channel. The component order depends on current Component Sorting Order setting, when the RGB channels are used. If you are using HSB channels, a random RGB order will be selected.  Currently this command is only triggered by the ‘)’ (right parenthesis) key command. It works best when pixel dimension are multiples of 64. After it executes, you can immediately use the statistical FFT command (‘k’) to sharpen the image. Amazingly, most of the detail that was lost with the low pass filtering will be restored by the default statistical FFT setting (set by the command to operate on 16 x 16 pixel blocks). The command takes time to execute because it’s really a long series of commands bundled together. It was an experiment that proved very rich in the variety of images it could create. Here’s an example.

Version 1.0b8a fixed the denoise command to handle edge and corner pixels correctly, and changed the ‘_’ (underscore) hack to repeat the last command four times, with a 90 degree rotation between executions, when last command is in “gl<>9kjdGLKJD”.

Version 1.0b7, a substantial update, supported Fast Fourier Transforms on images. It also saves JPEGs using current Java libraries, instead of the deprecated com.sun.image.codec.jpeg. Version 1.0b8 fixes a bug in the audify command, and adds a “denoise” filter and spatial shifting of color channels: that was enough to justify the new version number. I discussed GlitchSort version 1.0b7 pre-release on December 7, at a Share Session at GLi.TC/H.

Version 01b5, released on August 23, 2012, was the first public release named  “GlitchSort” instead of “GlitchSort2.” Version 01b5 provided a new sorting tool that operates on zigzag-scanned blocks of pixels using any of the available algorithms, and a color quantizing tool.

Version 1.0b4, released on August 1, 2012, offered four different sorting algorithms, each of which has a different behavior that can be used to affect images in different ways. It added the “munge” feature that does glitchy compositing, and the “degrade” command that uses JPEG compression to degrade an image.

My own images created with GlitchSort can be found at http://www.flickr.com/photos/ignotus/sets/72157629445337238/.

Video TurtleBoids Demo

Video TurtleBoids Demo Applet

Video TurtleBoids Demo Applet

The Video TurtleBoids Demo Applet is a Processing applet that captures video, derives optical flow vectors from it, and then uses the vectors to change the velocity of a flock of “boids” that can also draw lines (i.e., behave like Logo turtles). You will need the IgnoCodeLib library (the .jar file is included in the Code directory) and the ControlP5 library (not included, available for download at http://www.sojamo.de/libraries/controlP5/)

Based on Flocking, by Daniel Shiffman, in The Nature of Code, a demonstration of Craig Reynolds’ steering behaviors (see also http://www.red3d.com/cwr/). Also adapts code from Optical Flow by Hidetoshi Shimodaira from http://www.openprocessing.org/sketch/10435.

Download the VideoBoidsDemo. It will not run in a browser, and it does require a video input to function.