Performance issues / offscreen image

Hi, I have a question about performance issues when creating an offscreen image and then accessing its pixels.

I’m trying to composite several images, some are static and one is created dynamically based on user input.

Here are the two methods I’ve tried:

A. Use ofxFBOTexture to draw into a texture, and getPixel() to access pixels for compositing.

B. Use grabScreen to draw to the window in update(), and then call grabScreen() and getPixels().

Both of these methods work, but performance is slow. In method A, if I call getPixel(), or in method B, if I call grabScreen, the frame rate drops from 30 to 12.

Any suggestions for getting better performance when creating an offscreen image and then accessing its pixels?

Thanks!

i would probably prepare a proper unisgned char * array for the pixels and then I’d load it it into a ofxFBOTexture.

Based on what exactly you’re doing there may be ways to clean/speed up the code more.