Swap color channels

I am looking for a quick and efficient way to swap the color channels in an image.

Currently using this technique but guessing there is a more direct way to do this.

	ofPixelsRef pixels = img2.getPixels();
	for (int y = 0; y < img2.getHeight(); y++) {
		for (int x = 0; x < img2.getWidth(); x++) {
			ofColor color = img2.getColor(x, y);
			pixels.setColor(x, y, ofColor(color.b, color.r,color.g));
		}
	}
	img2.setFromPixels(pixels);

if you are going to swap the channels to display the new image a shader could be good.

Yup, thanks. That’s what I ended up doing.