UPD: I have finally figured it out. There is no limitation. Let's examine this command:
Code: Select all
convert background.jpg source.jpg mask.jpg -composite result.jpg
We have three images here - background, source and masking image which limit the area affected by the 'compose' method. Magick++ library provides a method called 'mask', which let us add a mask to our Image object. So I tried to add the mask to background Image object and then composed background and source images together using 'composite' method like this:
Code: Select all
// code C++
Magick::Image background("background.jpg");
Magick::Image source("source.jpg");
Magick::Image mask("mask.jpg");
background.mask(mask);
background.composite(source, 0, 0);
background.write("result.jpg");
And it works! Both images from command line and from my program are absolutely the same. But there is another problem. When I try to change a compose method to 'blend', both images differ from each other, and I don't know why it is so. But I'm going to find out. Thanks!