Wrong color saved when using ofImage.save jpeg after using ofImage.grabscreen within v0.10.0

version0.10.0, win10, visualstudio 2017

I tried screen capture.

ofImage image;
image.allocate(1080, 1920, OF_IMAGE_COLOR);
image.grabScreen(0, 0, 1080, 1920);
image.save("screenshot/tmp/last.jpg", OF_IMAGE_QUALITY_LOW);

As a result, the image was saved with R and B replaced with each other.
So I rewrote the code of ofGLRenderer.cpp.

void ofGLRenderer::saveScreen(int x, int y, int w, int h, ofPixels & pixels){
	int sh = getViewportHeight();

		y = sh - y;
		y -= h; // top, bottom issues
	auto pixelFormat = OF_PIXELS_BGRA;

change this.

auto pixelFormat = OF_PIXELS_RGB;

Then, this problem was solved.


you saved my day

Thank you, a life saver. Maybe consider for a Pull Request?

No, but I would be happy if you do it.
Because I don’t have GitHub account yet.

This worked for me as well. Thanks! Has this been posted to some way @skvj @takayuki?