saveImage JPG color issues / PNG disable alpha?

Hi

I am trying to save a screenshot using :
if (key == ‘s’){
ofSaveScreen(ofToString(ofGetFrameNum())+".jpg");
}

When I save in PNG, it saves the transparency too. Anyone knows if there is a way to disable it ?
When I save in JPG the colors are messed up, but only for the block of code with preset colors (see attached).
(I am working on a macbook pro (2012) running with Mojave 10.14)

I have tried to find a way around using fbo, but it seems a bit too advanced to me. I am losing the colors and transparency of my drawing…

Any hint would be much appreciated :slight_smile:

47

Hi,

I have tried to do the same thing and I changed the allocate in the saveScreen method : ofGLRenderer::saveScreen

//    pixels.allocate(w, h, OF_PIXELS_RGBA);
    pixels.allocate(w, h, OF_PIXELS_RGB);

Hope it helps.

++

Hi Pierre
Thanks, it’s working !