1234567891011121314151617181920
// On linux I compiled with libraries: -lX11 -lpthread #include "CImg.h" namespace img = cimg_library; int main() { // read in original image img::CImg<unsigned char> image("abc.bmp"); // abc.bmp is 1000x1000 // downsample to 256x256 image.resize(256, 256, -100, -100, 6); // 6 = Lanczos interpolation // write new image image.save("abc2.bmp"); // display image on screen //img::CImgDisplay main_disp(image, "Image"); //while (!main_disp.is_closed()) main_disp.wait(); return 0; }