Cimg Failed to recognize format of file
Heres what you have to do...
This works for pngs and jpegs so far...
Go to the Cimg.h source file and paste this wherever:
#define cimg_use_png
When your compiling include lib-png
This is a working compiler command.
g++ -O3 -o try main.cpp -lm -lpthread -lX11 -lpng