Not only do we have code that does this, but I took home the school laptop from the waterloo regional, so I have it on me. This is debug code that isn't critical, so forgive the lack of error checking and memory-freeing.
Code:
void SavePictures(TrackingThreshold& tGreen, TrackingThreshold& tPink)
{
Image* cameraImage = frcCreateImage(IMAQ_IMAGE_HSL);
GetImage(cameraImage, NULL);
Image* thresImage = frcCreateImage(IMAQ_IMAGE_HSL);
frcColorThreshold(thresImage,cameraImage,IMAQ_HSL,&tGreen.hue,&tGreen.saturation,&tGreen.luminance);
frcWriteImage(thresImage,"green.jpg");
frcColorThreshold(thresImage,cameraImage,IMAQ_HSL,&tPink.hue,&tPink.saturation, &tPink.luminance);
frcWriteImage(thresImage,"pink.jpg");
frcWriteImage(cameraImage,"raw.jpg");
}
This was copied by hand from our code on the laptop, so it probably has some typos. I think the only thing different is that you were not frcCreateImage-ing your image to allocate it.
If you do the thresholding stuff like we did, one note is that you should modify frcColorThreshold so that it sets the "on" color value to something other than 1 (the default in WPILib) so it is easy to see the colors in the thresholded images. We spent quite awhile debugging our thresholding, saying "why are we getting pure-black images" until we realized that they only appeared black, and actually contained data.