gm
gm copied to clipboard
How can i specify the watermark image?
Hi there,
Documentation say: gm("img.png").watermark(brightness, saturation)
I wonder how to specify which image should be added as watermark?
Thanks for any help!
As you can see in GraphicsMagic documentation (http://www.graphicsmagick.org/composite.html)
-watermark
is just option for powerful composite
utility.
I recommend to google with keywords "GraphicsMagic" or "Imagemagick" and to try command line first of all:
gm composite -watermark 50x50 image.jpg watermark.png output.jpg
After that using gm
is more simple ;-)
Can you provide an example... its not that easy to understand the relation between GraphicsMagic and gm and there is no single example about composite and gm.
@ptgamr @dimitarkolev I'm not sure if this is till an issue for you guys, but I create watermarked images with this pattern:
gm(source)
.command('composite')
.gravity('SouthEast')
.out('-geometry', '+20+10') // offset
.in('watermark.png')
.stream()
.pipe(dest);
10x I'll try this. On Jun 8, 2015 14:19, "Bence Dányi" [email protected] wrote:
@ptgamr https://github.com/ptgamr @dimitarkolev https://github.com/dimitarkolev I'm not sure if this is till an issue for you guys, but I create watermarked images with this pattern:
gm(source) .command('composite') .gravity('SouthEast') .out('-geometry', '+20+10') // offset .in('watermark.png') .stream() .pipe(dest);
— Reply to this email directly or view it on GitHub https://github.com/aheckmann/gm/issues/276#issuecomment-109955651.
@madbence Thank you it worked! I was trying following way, but didn't know how to specify watermark location.
gm(readStream)
.autoOrient()
.resize(1280, 1024)
.gravity('SouthEast')
.draw('image Over 10,10 0,0 ' + getAppPath() + '/public/img/watermark.png')
.stream('PNG')
.pipe(writeStream);
Hi
Is it possible to specify a buffer (e.g. from a file upload) for the watermark instead of the physical file on a server?
Thanks Damien
gm('./background.jpg')
.autoOrient()
.resize(1000, 1000)
.draw("image Over 100,300 0,0 './logo.png'")
.write('./img/backgroundwithlogo.png', function(err) {
if (!err) console.log('done');
});
this code is worked for me. 100,300 is watermark location. @digz6666