I am using CImg combined with libpng in Visual Studio 2010 to display png images. When I display the image using CImg, it appears to not correctly display the transparency. I am not sue if this is me not fully grasping the concepts of CImg, a mistake I'm making, or a combination of both!
The image on the left shows the image as opened in windows photo viewer - with the background transparent as expected. The image on the right shows the CImg display that is actually displaying a pure white background with some odd brown areas surrounding the character.
CImg is loading the png with the 4th alpha channel (as shown in right image window title). When mousing over the areas in the CImg display it shows the correct transparency values in the small pop up (bottom left of right image). CImg appears to be drawing everything, regardless of the transparency value?
My question is, how do I get Cimg to correctly display a pgn with transparent sections?
My code for this example is as follows:
#define cimg_use_png
#include <CImg.h>
using namespace cimg_library;
int main()
{
CImg<unsigned char> image("image.png");
image.display();
return 0;
}