Let's say you want to set the Red channel of an image to be the Green, but with 30 less lightness. Rather than having to write a lot of code to gain pixel-level access to an image, you can just write this (as seen above),
loop:
G = r - 30
You can also use the variables "x" and "y" so set colors based on the position of the pixel. If you wanted to create a gradient,
loop:
R = x + y
G = x - y
B = 0
To shift the hue, use the HSL color space:
loop_hsl:
H = h + 0.2
I've used PythonPixels to implement many effects, including convolution matrices, kaleidoscope, and posterize. Data-oriented operations work very well, too, like finding pixel values, statistics, or making a histogram. Other features include pasting an image from the clipboard and batch-processing a folder of images. The keyword "loop" loops through every pixel, (providing the variables x and y), and if you assign to R, G, or B, the output value at that position will be changed. You can also use the "loop_hsv" and "loop_hsl" keywords.
Try it out -- there are more than 40 built-in effects! Windows Download (3.7Mb, GPL). There is no need to install, just unzip the file and run pythonpixels.exe.
2013 Update: the source code has been uploaded to GitHub here. Requires the packages tkinter, python-imaging (PIL), python-imaging-tkinter (ImageTK).