I have a couple of pictures that a friend asked me to add several lines of information on the picture.
I tried using convert and montage neither achieve the desired results.
I googled it and some of the suggestions were to use annotate but that option generates an error.
I've tried
cat filename.txt | convert picturename.jpg @- outputname.pdf
this results in convert: Unable to open file (-) [No such file or directory].
using montage
cat filename.txt | convert picturename.jpg -comment @- outputname.pdf
generates a fuzzy image with unreadable yellow text.
the filename.txt file has parenthesis and double quotes in it.
I'm trying to have the picture and several lines of text describing the picture below left justified.
Help appreciated.
Adding wording to pictures create PDF
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Adding wording to pictures create PDF
For many methods of writing text on an image, see http://www.imagemagick.org/Usage/text/
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Adding wording to pictures create PDF
You did not tell convert how to add the text, i.e. what command to use to process the text such as -annotate.cat filename.txt | convert picturename.jpg @- outputname.pdf
Assuming you want to add text over the image, try
or bettercat filename.txt | convert picturename.jpg -gravity southwest -annotate +0+0 "@-" outputname.pdf
Modify the gravity and +X+Y offsets as desired for placement. Add -undercolor somecolor if you want a color under the text for readability.convert picturename.jpg -gravity southwest -annotate +0+0 "@filename.txt" outputname.pdf
See
http://www.imagemagick.org/Usage/text/
If you want to append text below the image, then you need a different approach. See http://www.imagemagick.org/Usage/annotating/
Or use montage label and -tile 1x1, see http://www.imagemagick.org/Usage/montage/
Please post your text file and image. The text file can be copied and pasted in the Code tags with the button above. Images can be uploaded to dropbox.com and the url put here. The double quotes may be an issue and some one would have to check this out. The quotes may or may not work. They may have to be changed to single quotes.
Also please always provide your version of IM and platform, since syntax may differ between Windows and Unix. Please read the very first post at the top of the Users forum at viewtopic.php?f=1&t=9620
Re: Adding wording to pictures create PDF
I tried you examples and found my problem. I'm trying to use very old version on my Red Hat 6 server.
Version: @(#)ImageMagick 5.4.7 07/01/02 Q:16 http://www.imagemagick.org
Copyright: Copyright (C) 2002 ImageMagick Studio LLC
Moved to my Pidora server running on Raspberry Pi B. 700Mhz ARM processor significantly slower than quad processor RH 6 machine, took three minutes. Text is there but too small to read. Have to read up on how to increase size.
Version: @(#)ImageMagick 5.4.7 07/01/02 Q:16 http://www.imagemagick.org
Copyright: Copyright (C) 2002 ImageMagick Studio LLC
Moved to my Pidora server running on Raspberry Pi B. 700Mhz ARM processor significantly slower than quad processor RH 6 machine, took three minutes. Text is there but too small to read. Have to read up on how to increase size.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Adding wording to pictures create PDF
Yes, IM 5.4.7 is ancient and syntax is different now in IM 6. You should upgrade if you can. See http://www.imagemagick.org/Usage/basics/#why
To increase text size, specify -pointsize and I would recommend you also specify the -font. But you can take the default font, if you want, but it might be different on different systems.
To increase text size, specify -pointsize and I would recommend you also specify the -font. But you can take the default font, if you want, but it might be different on different systems.