I need to merge a couple of images so that image2 covers parts of image1 and so on. I found the CImg library but I couldn't find out how to use it for my purposes.
Is there any other library I could use or may I achieve this with CImg?
I need to merge a couple of images so that image2 covers parts of image1 and so on. I found the CImg library but I couldn't find out how to use it for my purposes.
Is there any other library I could use or may I achieve this with CImg?
I created two images like this with ImageMagick:
convert -size 400x300 gradient:blue-yellow PNG24:gradient.png
convert -size 100x100 xc:fuchsia overlay.png
And then ran this CImg
code:
#define cimg_use_png
#define cimg_display 0
#include "CImg.h"
using namespace cimg_library;
int main() {
CImg<unsigned char> gradient("gradient.png");
CImg<unsigned char> overlay("overlay.png");
gradient.draw_image(150,50,overlay);
gradient.save_png("result.png");
}
And got this: