Page 2 of 2
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-13T09:54:32-07:00
by fmw42
Are you on Windows or a Unix type system. See my subsequent post above to the one you quoted. You are not using the commands that I recommended right above your last post here.
Also do not put spaces after the line ending \
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-14T10:00:51-07:00
by buchert
Those commands work, only I'd prefer a command that automatically sizes the watermark text based on the dimensions of the image. In my bash script there's a setting *0.06000". I don't see that incorporated into these commands.
Code: Select all
export imageheight=$(echo "$(echo "$imagesize" | cut -f2 -d',')*0.06000" | bc)
I'm using Git Bash on Windows 10.
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-14T13:13:44-07:00
by fmw42
Those commands work, only I'd prefer a command that automatically sizes the watermark text based on the dimensions of the image
You can do that with IM 7.
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-14T16:39:04-07:00
by buchert
fmw42 wrote:Those commands work, only I'd prefer a command that automatically sizes the watermark text based on the dimensions of the image
You can do that with IM 7.
So this code should do that then?
Code: Select all
magick "$file" -set option:dim "%wx%h" \
\( -background '#000000' -fill white -gravity center -size "%[dim]" caption:"$caption" \) \
-gravity south -composite "$file"
It just hangs when I run it.
I'm using ImageMagick 7.0.3-7 Q16 on 64-bit Windows 10 with Git Bash.
magick -version
Version: ImageMagick 7.0.3-7 Q16 x64 2016-11-15
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License:
http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-14T17:46:37-07:00
by fmw42
You keep going back to the wrong command line. See
viewtopic.php?f=1&t=31002&p=140872#p140872
Also check your arguments to be sure they are what you think they should be.
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-22T05:45:37-07:00
by buchert
Is it possible to add a border to the bottom of an image that is 10% the height of the image, and then overlay text on that border that automatically sizes to the height of the border?
As of now I've changed -background to none and have to manually create the border and then run this command:
Code: Select all
magick 0000.jpg -set option:dim "%w" \
\( -background none -font Times-New-Roman -fill white -gravity center -size "%[dim]x250" label:"Testing" \) \
-gravity south -composite 0_0.jpg
But for every image the dimensions change, so through trial and error I have to modify "%[dim]x250" to the correct size so that the text extends to the height (or doesn't surpass) of the border.
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-22T08:20:36-07:00
by snibgo
You set dim to just the width, but you could set it to both width and height (with "x") between them. The height could be an fx expression.
Then use:
Re: Convert Watermark Bash Script to CLI Command
Posted: 2016-12-22T16:27:52-07:00
by anthony
Did you want to overlay of top of the image, or append to the side of the image?
See Annotating Images for LOTS of different techniques.
http://www.imagemagick.org/Usage/annotating/#annotating