Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Image Magick convert as Perl

by GrandFather (Saint)
on Sep 14, 2005 at 20:55 UTC ( #492016=note: print w/replies, xml ) Need Help??


in reply to Re: Image Magick convert as Perl
in thread Image Magick convert as Perl

Yes, I was aware of Annotate, but I'd used draw in the command line version and there it worked. Annotate will suffice, but I'm still puzzled that the Draw doesn't work. The documentation does not seem to describe a way of supplying the text to be drawn for Draw and supplying the text as (... text=>"Hello World", ...) generates an error to the effect that "text" is not a valid parameter (I've not got the code here).

My other question is: how do I generate 50% transparent text? Have I to do it by generating the text in another image then compose the two images together, or is there a more direct way of generating partially transparent text on an image?

An even more fundamental question is: How do I generate a "blank" image that I can draw on?


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^3: Image Magick convert as Perl
by davidrw (Prior) on Sep 14, 2005 at 22:37 UTC
    An even more fundamental question is: How do I generate a "blank" image that I can draw on?
    I'll take that one first (reference: perl-magick -- search for "xc" in the Examples section):
    my $image = Image::Magick->new(); $image->Set(size=> "800x600"); $image->ReadImage('xc:white');
    See also this formats page for what IM takes (XC is listed there as well as some built-in images and patterns).

    Annotate will suffice, but I'm still puzzled that the Draw doesn't work.
    me too.. i guess it's just another IM inconsistancy .. (note at least in the http://imagemagick.org/script/perl-magick.php|docs] that Draw doesn't list a 'text' parameter)

    My other question is: how do I generate 50% transparent text?
    umm.. no clue.. But i suspect if there is an answer it might be on this site: ImageMagick v6 Examples -- seems like a very good collection of faq/how-to's...

      Thanks for that. I'd found the ReadImage example, but adapting it didn't get the results I was after - which may be because with Image Magick there always seems to be three different things that aren't clearly documented that you have to get right at the same time. I was confused by "ReadImage" which implies that there should be an image somewhere to read, but looks like it is actually a magical create image.

      I have managed to overlay one image on another using burn in or dodge to get something like transparancy so I ought be able to do it by drawing to a second image then combine that image with the first. I'll post something in snippets when I get it sorted out.


      Perl is Huffman encoded by design.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://492016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-12-08 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?