Hello,
I am running on Windows 10 and ultimately on a 2008R2 server for automation. The version I downloaded and installed is 7.0.7-28-Q16-x64.
I will have 30-50 images per week that will need a watermark added to the lower right corner. All images are a 640x480 .JPG. Final output must be 640x480 for our software to work with the image. The watermark is a scalable .PNG at 1200x1200.
Photos will be placed in a network directory location that will be accessible to a Windows Task scheduler item.
I need to have ImageMagick take each source photo, add the watermark to the lower right corner and then OVERWRITE the original with the same file name.
Is this possible and if so, how?
Batch Process Adding Watermark
-
- Posts: 3
- Joined: 2018-04-26T10:01:57-07:00
- Authentication code: 1152
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Batch Process Adding Watermark
You can use mogrify to process a whole folder of images with the same watermark image. I do not know of any "scalable" raster formats such as PNG. What do you mean by scalable. Imagemagick can resize that image, but it will be resampled. It is not like having a vector image such as PDF or EPS or AI that scales with density. Please post an example image or two and your watermark and we can test for you. Or see mogrify at https://www.imagemagick.org/Usage/basics/#mogrify and especially https://www.imagemagick.org/Usage/basic ... fy_compose
-
- Posts: 3
- Joined: 2018-04-26T10:01:57-07:00
- Authentication code: 1152
Re: Batch Process Adding Watermark
My apologies for not getting the terminology correct. I would be happy to attach the watermark we want added to the photos but cannot find how to do it.
I looked over the link you sent me and it appears the mogrify command, based on the basic description will meet the "overwrite" requirement. However, I can't find (or I'm getting lost in my mind) the command to join the images together, resizing the watermark to a smaller, more appropriate size.
Your help is greatly appreciated.
I looked over the link you sent me and it appears the mogrify command, based on the basic description will meet the "overwrite" requirement. However, I can't find (or I'm getting lost in my mind) the command to join the images together, resizing the watermark to a smaller, more appropriate size.
Your help is greatly appreciated.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Batch Process Adding Watermark
Instead of "mogrify" I'd probably approach this using "magick", which will also happily overwrite the original image, and it makes resizing your logo pretty easy. I'd run it in a Windows BAT script using a "for" loop to process all the input images. A script like this shows how it can be done...jimtpowers wrote: ↑2018-04-26T11:12:51-07:00I looked over the link you sent me and it appears the mogrify command, based on the basic description will meet the "overwrite" requirement. However, I can't find (or I'm getting lost in my mind) the command to join the images together, resizing the watermark to a smaller, more appropriate size.
Code: Select all
@echo off
for %%z in ( *.jpg ) do (
magick "%%z" logo.png ^
-resize %%[fx:t?u.w*0.1:s.w]x%%[fx:t?u.h*0.1:s.h] ^
-gravity southeast -geometry +30+30 -composite "%%z"
)
If your input images and your logo have the same extension, like if they're all .png files, you'll probably need to put your logo or your inputs, or both, in separate folders and read them in using the path(s) to those folders.
-
- Posts: 3
- Joined: 2018-04-26T10:01:57-07:00
- Authentication code: 1152
Re: Batch Process Adding Watermark
GeeMack, that did the trick. Thank you very much!
Re: Batch Process Adding Watermark
Sorry to necro thread this, but this is the exact thing I was looking for. Can the logo file be located anywhere on the computer/server and pointed to, to add it as a watermark to an image? Or does it need to be located in the root folder where the images that need to be watermarked are located?
(newbie to imagemagick here)
(newbie to imagemagick here)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Batch Process Adding Watermark
Prefix the name with the directory (or drive and directory) in the normal way for your computer.
snibgo's IM pages: im.snibgo.com