If you ever need to do more image processing than you can with a single fragment program pass, you'll need to render to a texture. The best way to do that on OS X is using a pbuffer, here's some example code for creating and using them.
I've included the code inline below, or you can get a zip of the code from PBufferUtils.zip here
]]>