ofTexture to ofImage

For those googling and looking for a solution how to save an ofTexture to a file (via ofImage): ofPixels pixels; texture.readToPixels(pixels); ofImage image; image.setFromPixels(pixels); image.save("file.png"); where texture is an ofTexture instance. This also works if you want to save the co…