Skip to content

Instantly share code, notes, and snippets.

@jkosoy
Last active December 14, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkosoy/5048535 to your computer and use it in GitHub Desktop.
Save jkosoy/5048535 to your computer and use it in GitHub Desktop.
ofImage to ofBuffer not working... why?
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofImage foo;
foo.loadImage("walrus.jpg");
ofPixels px;
px.setFromPixels(foo.getPixels(), foo.width, foo.height, foo.getPixelsRef().getImageType());
ofBuffer imageBuffer;
ofSaveImage(px, imageBuffer);
cout << imageBuffer << endl;
}
#pragma once
#include "ofMain.h"
class testApp : public ofBaseApp{
public:
void setup();
};
@madc
Copy link

madc commented Jun 7, 2015

ofSaveImage(foo.getPixelsRef(), imageBuffer, OF_IMAGE_FORMAT_JPEG, OF_IMAGE_QUALITY_BEST);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment