ofImage::saveImage() - saving from png to gif creates grayscale image #631

Open
roxlu opened this Issue Jul 7, 2011 · 2 comments

Projects

None yet

5 participants

@obviousjim

seems that it is intentional if the png has alpha:
https://gist.github.com/1077928

@kylemcdonald

this is still a big bug, definitely fails spectacularly when saving alpha images.

#include "ofMain.h"

class ofApp : public ofBaseApp {
public:
    void setup() {
        ofImage img;
        if(!img.load("http://www.libpng.org/pub/png/img_png/AlphaEdge.png")) {
            ofLog(OF_LOG_ERROR, "Error while loading image");
        }
        img.save("img.png");
        img.save("img.gif");
    }
    void draw() {
    }
};
int main() {
    ofSetupOpenGL(1280, 720, OF_WINDOW);
    ofRunApp(new ofApp());
}

Here is the png:
full

Here is the gif:
full

@kylemcdonald kylemcdonald added this to the 0.9.4 milestone Dec 12, 2014
@arturoc arturoc modified the milestone: 0.10.1, 0.9.4 Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment