> > >Possibly the most common requirement of a caption > >is to place it beneath the image. But this does not > >appear to be easy. The following lines appraoch > >a solution but are not sufficient. > > > >convert A.gif \ > > -gravity South\ > > -background White -splice 0x30 \ > > -pointsize 20 -annotate 0 \ > > 'Fig 33.' \ > > B.gif > > > >The problem with the above is that it does not automatically > >centre the text vertically on the added splice, it places > >the baseline on or a little above the bottom of the splice, > >which may be nowhere near the centre. I have considered > >labels, captions, enclosing options in \(...\) but have not > >found a simple solution.
> From: Fred Weinhaus > > montage -geometry +0+0 -background white -pointsize 20 \ > -label "Fig 33." A.gif B.gif > This does centre the label nicely, but is not ideal: a) I should have mentioned I prefer to use convert as it is more flexible than montage and so the one command can achieve many manipulations without having to resort to temporary files, whilst its syntax is more consistent with the apparent direction of ImageMagick. For example: b) For a pointsize of 14 (which is what I use on many captions), the result of the default antialiasing of the text is `terrible'. Montage does not seem to accept +antialiasing. c) There appears to be no control over the height of the background to the label. d) To add a 1 or 2 pixel border under the image and above the label, but nowhere else, may be a problem with montage: no -splice option, maybe no `line' with -draw option either. > From: Pete Whatever > Try a command like this: > convert A.gif -gravity South -background White -splice 0x30 > -pointsize 20 -draw "text 0,5 'Fig 33.'" B.gif Yes, you can centralise by working out the height of the text (there seems to be a surprising difference in heights of fonts for the same point size - but maybe that is my optical illusion) then placing the text appropriately. However I was looking for automatic centralising of height, such as with `-gravity center'. But the latter centres on the height of the entire image, not the label area. _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
