ofSaveScreen() outputs file with wrong color


Here’s my code:

void ofApp::draw(){
    ofSetColor(255, 0, 0);
    ofDrawRectangle(100, 100, 100, 100);

And here’s what the output image “test.jpg” looks like

As you can see, the color of the rectangle is not red but blue.

Is this a bug? I tested this on macOS 10.14.4.

Added: This issue also happens with ofSaveViewport().


ofSaveScreen use rgb with alpha so you need to use png format

1 Like