nope, that would be really slow. call loadPixels() on the image itself, and then use image.pixels[] to access its pixels.
then, the quickest way to composite would be to make a PImage "c" the same way you made "b", and use that as the target. then call c.updatePixels() and image(c, 0, 0) to draw it to the screen. or if you aren't using tint() or sizing the image differently than its original, use set(c, 0, 0) for more speed.
also fyi.. loadPixels() and updatePixels() aren't required for PImage right now, but will be in the future, so you should get in the habit of using them.
using size(320, 240, P3D) makes things faster if you're just doing pixel stuff.
and it's recommended that you don't use size(w, h) because it won't be able to read the size when you export it to an applet. do something like this instead:
Code:int total;
int counter = 0;
PImage a, b, c;
color myColors[];
void setup() {
size(320, 240);
a = loadImage("myImage.jpg");
b = new PImage(width, height);
c = new PImage(width, height);
total = width * height;
myColors = new color[total];
}