brendan-duncan / image

Dart Image Library for opening, manipulating, and saving various different image file formats.
MIT License
1.18k stars 268 forks source link

watermark anywhere on image #519

Open EdulimaProg opened 1 year ago

EdulimaProg commented 1 year ago

someone help me, i put a watermark anywhere in the image, can you help me?

brendan-duncan commented 1 year ago

If you have your backgroundImage, and watermarkImage, then you can draw the watermark image onto the background image at pixel coordinates x, y with:

compositeImage(backgroundImage, watermarkImage, dstX: x, dstY: y);
crushman1 commented 4 months ago

For anyone who might have experience an issue where compositeImage result is a black and white image: what worked for me was to ensure the base image is jpg. i'm not sure if thats written somewhere but i didn't see it and ended up using up 3 hours...