Some people might prefer GD to Image::Magick for its speed and lack of bloat. Also it will install with only one, or all, of the image libraries you choose.
You could do what you want with GD and the GD::string() function...
## extracted and simplified from a bit of working code I have my $fname = "/path/to/your/file.jpg"; my $text = "What you want to say."; open (IMG, "<$fname") or die; my $size = -s $fname; my $data; read IMG, $data, $size; close IMG; die "blah" unless $data; use GD; # my $itype = image_type(getType_bymagic($data)); # die unless $itype eq "Jpeg"; # my $method = "newFrom${itype}Data"; my $method = "newFromJpegData"; my $i = GD::Image->$method($data, 1); my $fg = $i->colorAllocate(102,102,102); $i->string(gdMediumBoldFont,7,7,$text,$fg); return \$i->png;
...however, you would then be left with managing the centering and wrapping of text yourself.
For that reason I would recommend looking into the GD::Text, GD::Text::Align, and GD::Text::Wrap modules.

Good luck.
-xtype

In reply to Re: Image Addition by xtype
in thread Image Addition by ecuguru

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.