there's a bug in get pixel that will cause a windows illegal operation error. It happens when you try to get a pixel that is off the image, but it is extemely rare... but not rare enough for me to figure it out. This function fixes it for me... but maybe vec would like to look into this?
int getPixel2(int x, int y, int source){
if(x >= 0 && y >= 0 && x <= imageWidth(source) && y <= imageHeight(source) )
return getPixel(x,y,source);
return 0-1;
}