Created
July 12, 2011 13:02
-
-
Save anonymous/1077928 to your computer and use it in GitHub Desktop.
ofImage_gif_grayscale problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems to have something to do with this: | |
if (fif == FIF_GIF) { | |
FIBITMAP* convertedBmp; | |
if(pix.getImageType() == OF_IMAGE_COLOR_ALPHA) { | |
// this just converts the image to grayscale so it can save something | |
convertedBmp = FreeImage_ConvertTo8Bits(bmp); | |
} else { | |
// this will create a 256-color palette from the image | |
convertedBmp = FreeImage_ColorQuantize(bmp, FIQ_NNQUANT); | |
} | |
bool success = FreeImage_Save(fif, convertedBmp, fileName.c_str()); | |
if (convertedBmp != NULL){ | |
FreeImage_Unload(convertedBmp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment