Page 1 of 1
Adding wording to pictures create PDF
Posted: 2015-07-21T10:42:43-07:00
by jjrowan
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.
Re: Adding wording to pictures create PDF
Posted: 2015-07-21T11:05:57-07:00
by snibgo
For many methods of writing text on an image, see
http://www.imagemagick.org/Usage/text/
Re: Adding wording to pictures create PDF
Posted: 2015-07-21T11:12:13-07:00
by fmw42
cat filename.txt | convert picturename.jpg @- outputname.pdf
You did not tell convert how to add the text, i.e. what command to use to process the text such as -annotate.
Assuming you want to add text over the image, try
cat filename.txt | convert picturename.jpg -gravity southwest -annotate +0+0 "@-" outputname.pdf
or better
convert picturename.jpg -gravity southwest -annotate +0+0 "@filename.txt" 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.
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
Posted: 2015-07-21T11:58:31-07:00
by jjrowan
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.
Re: Adding wording to pictures create PDF
Posted: 2015-07-21T15:19:33-07:00
by fmw42
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.