problems with mogrify or convert -label
problems with mogrify or convert -label
I am very new to this, so please have compassion -- I have, what I thought, was a simple problem. I have a folder full of jpgs that all need the same fixed label. So I figured this command should do the trick:
mogrify -label "Before" -geometry +0+0 -pointsize 200 -background Red -fill White "C:\pic\BEFORE\*.jpg"
but nothing happens - it works like a charm with the montage command, but of course I can only do one picture in the folder. I tried the convert command as well - nothing.
What am I overlooking here?
thanks
mogrify -label "Before" -geometry +0+0 -pointsize 200 -background Red -fill White "C:\pic\BEFORE\*.jpg"
but nothing happens - it works like a charm with the montage command, but of course I can only do one picture in the folder. I tried the convert command as well - nothing.
What am I overlooking here?
thanks
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: problems with mogrify or convert -label
I'm using "ImageMagick 7.0.0-0 Q16 x64 2016-03-26" on Windows 7 64. If I understnad what you're trying to do, you might try constructing your command more like this...samiam00 wrote:What am I overlooking here?
Code: Select all
mogrify -gravity south -fill white -pointsize 24 -annotate +0+20 "Before" "C:\pic\BEFORE\*.jpg"
Re: problems with mogrify or convert -label
That works, though I am looking for something that looks more like the label outcome - a solid red bar below the picture with the label in it - not with the label over the actual picture. Is there a way to achieve that with your method?
Thanks
Thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: problems with mogrify or convert -label
add padding below the image using -splice before the annotate. See http://www.imagemagick.org/Usage/crop/#splice
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: problems with mogrify or convert -label
You'll have to find the combination of pointsize, the height of the splice, and the geometry of the annotate that does what you want it to, but this would add a strip of red to the bottom of the images, then annotate the word "Before" in white centered a few pixels up from the bottom of all the images.samiam00 wrote:That works, though I am looking for something that looks more like the label outcome - a solid red bar below the picture with the label in it - not with the label over the actual picture. Is there a way to achieve that with your method?
Code: Select all
mogrify -background red -fill white -pointsize 24 -gravity south -splice 0x32 -annotate +0+4 "Before" "C:\pic\BEFORE\*.jpg"
Re: problems with mogrify or convert -label
That works - thanks - is there a way to make the font size and the splice a percentage, since all images have vastly different sizes and they all should have a similar 'proportion'. I figured out how to do a percentage on a frame - can that be done for all sizes?
Re: problems with mogrify or convert -label
and just for my understanding - does the -label command simply not work with mogrify or convert? It shows it as option in the tutorial.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: problems with mogrify or convert -label
This would get a bit more complicated since you'd have to obtain the dimensions from each image and use those to calculate the splice height and pointsize. You might need to do them in a loop using your command shell's "for" command. The syntax would depend on your OS. There are also various ways to extract and use information from the images depending on which version of IM you're using.samiam00 wrote:That works - thanks - is there a way to make the font size and the splice a percentage, since all images have vastly different sizes and they all should have a similar 'proportion'. I figured out how to do a percentage on a frame - can that be done for all sizes?
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: problems with mogrify or convert -label
The "-label" operator doesn't add text upon the image. It embeds a label tag into the image datastream. There are several methods to apply text onto an image, most of which can be found at this link.samiam00 wrote:and just for my understanding - does the -label command simply not work with mogrify or convert? It shows it as option in the tutorial.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: problems with mogrify or convert -label
See the documentation at http://www.imagemagick.org/script/comma ... .php#labelsamiam00 wrote:and just for my understanding -
snibgo's IM pages: im.snibgo.com
Re: problems with mogrify or convert -label
OK - thanks - I guess i was mislead by the fact then that -label with the montage command produces exactly the result I was looking for:GeeMack wrote:The "-label" operator doesn't add text upon the image. It embeds a label tag into the image datastream. There are several methods to apply text onto an image, most of which can be found at this link.samiam00 wrote:and just for my understanding - does the -label command simply not work with mogrify or convert? It shows it as option in the tutorial.
montage -label "After" "C:\TIApic\7TOS\*.jpg" -geometry +0+0 -pointsize 200 -background Gold 7TOS.jpg
Re: problems with mogrify or convert -label
Thanks - i did look at all the documentation, before asking. I am not a programmer and could not quite piece things together. Without examples, I am lost....snibgo wrote:See the documentation at http://www.imagemagick.org/script/comma ... .php#labelsamiam00 wrote:and just for my understanding -