Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
This is probably a really nab question, so appologies in advance. I have searched for auto-size threads but they dont seem to be dealing with the same issue.
"width='identify -format %w test.png';convert -background '#0008' -fill white -gravity center -size ${width}x30 annotate text.txt test.png +swap -gravity North -geometry +0-3 -composite fort.jpg"
returns "convert: invalid argument for option `-size': identify @ error/convert.c/ConvertImageCommand/2791."
IF theres a simpler way to achieve this Id obviously just do that, Im just keep to use the auto size feature as Id like to cat a file on pictures in a script at a later point.
What you need to do is use label: or caption: in "best fit" mode to create an overlay image that has text on a transparent background. Then composite that over your background image at the location you want. See
convert logo: \( -size 300x -background none -fill red -font arial label:"This Is Some Text" \) -gravity center -compose over -composite logo_with_text.jpg
convert logo: ( -size 300x -background none -fill red -font arial label:"This Is Some Text" ) -gravity center -compose over -composite logo_with_text.jpg
Please always provide your IM version and platform/OS, since syntax differs.
Thanks a lot for the reply. I re-read the stuff you linked with a view to doing what you suggested. Understanding the stuff about the parenthesis is helpful too, thanks. It took me a while to realise that "logo" in your example was the picture of the wizard dude, as I wasn't sure where it was coming from
convert test.png \( -size 400x60 -background grey -fill red -font arial label:@/home/gorby/text \) -gravity northwest -compose over -composite logo_with_text.jpg
This is working well for me as I can just use sed to alter the text file contents so it fits nicely in the box.
Ive probably failed to understand some stuff, so might ask another question about stuff later if thats ok Thanks for the help.
Im using $ convert.exe Version: ImageMagick 6.9.5-7 Q16 x86_64 2016-12-23 http://www.imagemagick.org in cygwin v 2.880 64