I would like to load a BMP file, do some operations on it in memory, and output a new BMP file using C++ on Windows (Win32 native). I am aware of ImageMagick and it\'s C++ b
I tried CImage as above, but I had a C array full of pixel values that I simply wanted to dump as a BMP (or any other format). CImage has no constructor for that, and I did not want to link MFC (for CBitmap) nor try to fathom IWIC.
What was easy was CImg:
#include
using namespace cimg_library;
//...
void SaveMyData(uint8_t *pxarray, int width, int height)
{
CImg img(pxarray, width, height);
img.save_bmp("sav.bmp");
}