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 \
Convert Watermark Bash Script to CLI Command
Re: Convert Watermark Bash Script to CLI Command
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.
I'm using Git Bash on Windows 10.
Code: Select all
export imageheight=$(echo "$(echo "$imagesize" | cut -f2 -d',')*0.06000" | bc)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert Watermark Bash Script to CLI Command
You can do that with IM 7.Those commands work, only I'd prefer a command that automatically sizes the watermark text based on the dimensions of the image
Re: Convert Watermark Bash Script to CLI Command
So this code should do that then?fmw42 wrote:You can do that with IM 7.Those commands work, only I'd prefer a command that automatically sizes the watermark text based on the dimensions of the image
Code: Select all
magick "$file" -set option:dim "%wx%h" \
\( -background '#000000' -fill white -gravity center -size "%[dim]" caption:"$caption" \) \
-gravity south -composite "$file"
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert Watermark Bash Script to CLI Command
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.
Also check your arguments to be sure they are what you think they should be.
Re: Convert Watermark Bash Script to CLI Command
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:
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.
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert Watermark Bash Script to CLI Command
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:
Code: Select all
-set option:dim "%wx%[fx:h*0.1]"
Code: Select all
-size "%[dim]"
snibgo's IM pages: im.snibgo.com
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Convert Watermark Bash Script to CLI Command
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
See Annotating Images for LOTS of different techniques.
http://www.imagemagick.org/Usage/annotating/#annotating
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/