Page 1 of 1

Merging pictures with optional resizing (command line)

Posted: 2018-10-02T11:09:11-07:00
by MBGod
Hello and thank you for your attention.
What i have:
pic1.jpg , pic2.jpg, pic3.jpg height and width vary but is always proportional to 1920*1080, ratio 16:9
Watermark.png always 1920*1080

What i would like is to watermak picA.jpg with picB.png, but before merging both of pictures, resizing piB.png at the same size than picA.jpg
Thank you for your help.

Command
for %f in (*.jpg) do composite -dissolve 70% Watermark.png %f %f

Pictures
https://photos.app.goo.gl/ztJw4U7MJUnP7ehx8

Re: Merging pictures with optional resizing (command line)

Posted: 2018-10-02T11:11:35-07:00
by fmw42
You would need to check the size of picA and then resize picB to that size before doing the watermarking. This can be done easily in one command in IM 7, but is more complex in IM 6.


Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown

Re: Merging pictures with optional resizing (command line)

Posted: 2018-10-03T03:09:18-07:00
by MBGod
@fmw42 Thank you and sorry, post updated

Re: Merging pictures with optional resizing (command line)

Posted: 2018-10-03T09:45:19-07:00
by fmw42
Here is my suggested command for IM 7 on Windows

Code: Select all

magick PairiDaiza1.jpg -set option:dims "%wx%h" ( Watermark.png -resize "%[dims]" ) -compose over -composite result.jpg
See
https://imagemagick.org/Usage/basics/#set
https://imagemagick.org/Usage/basics/#parenthesis
https://imagemagick.org/Usage/compose/#compose