Hello,
I'm trying to apply a watermark to an image.
I've got an example image that is 1024x768 and a watermark image that is 584x116.
I'm resizing the watermark to match the example, then using the composite command to merge the two images.
I'm sure there is something simple I'm missing in order to make it work.
Thanks for any help.
I'm trying to apply a watermark to an image.
I've got an example image that is 1024x768 and a watermark image that is 584x116.
I'm resizing the watermark to match the example, then using the composite command to merge the two images.
using (MagickImage image = new MagickImage("example.jpg"))
{
using (MagickImage watermark = new MagickImage("watermark.png"))
{
//resize watermark to fit the proof image
watermark.Resize(image.Width,image.Height);
image.Composite(watermark, Gravity.Center, CompositeOperator.Dissolve, "11");
image.Write("examplewatermarked.png");
}
}
The result is an image with solid black on the top and bottom, while the middle where the watermark is applied is displaying correctly. Looking at the watermark after the resize command, the height is scaled up as expected but it does not match the example image's canvas height (768). Is there any way to make the result not black if the canvas size doesn't match?I'm sure there is something simple I'm missing in order to make it work.
Thanks for any help.