Hi @ all,
- I am loading a png file
- copieng the manipulated pixels to a ofTexture
- Than i want to save that image, but therefore i need an ofImage
By the way, is there a good way how to manipulate an ofImage Pixels? i tried the getPixel reference and thought that it changes will affect the original image, but it does nothing.
i am a bit confused at the moment, hope to hear some hints tomorrow morning
I’d copy the pixels to an ofImage rather than an ofTexture. Every ofImage has an ofTexture (unless you tell it not to use one). So you can upload the pixels to the image using setPixels(), then update() to load them to the texture for drawing, and saveImage() for saving to a file.
I cant make setPixels() work:
src/testApp.cpp|116|error: ‘ofImage’ has no member named ‘setPixels’|
I actually try to get 4 smaller picture put together to one big saved image.
I think it’s ofImage::setColor, you have to iterate over all pixels. The info above is probably from an old version of OF
For those googling and looking for a solution how to save an ofTexture to a file (via ofImage):
texture is an
This also works if you want to save the contents of an Fbo to a file. Just switch out the texture reference with the Fbo one: