meetn2veg has asked for the wisdom of the Perl Monks concerning the following question:

I'm having a slight problem with transparencies etc...

I have a Cº logo set as a background image on their site. What I'm trying to do is load a transparent *.gif file, write (annotate: user input) a message to the *.gif file, and eventually display the annotated *.gif over the logo image in order for it to be clickable (put within DIV and HREF it). If I get this sussed, I'll also be looking into morphing it or animating it - so something... (probably just leave it as is!).

I have visited ImageMagick.org and have found it confusing - http://shawn.apocabilly.org/PGP/ (O'Reilley) slightly less confusing as there are examples (which I've been pulling apart with only moderate success!!) and there's little else I've managed to find out.

Hopefully someone out there has the know-how...

Eagerly awaiting,
Richard.

Replies are listed 'Best First'.
Re: Help with Image::magick
by tachyon (Chancellor) on Sep 13, 2003 at 11:17 UTC

    We use GD for generating images. Due to the LZW compression patent issue there is no GIF support (by default), however PNGs are essentially equivalent in that they support the same features as a GIF and are well supported by by browsers. This is straight out of the DOCs.

    NB I have never had cause to do it but I understand you can compile in GIF support into GD. RTFS if you want to know how.

    use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); # make the background transparent and interlaced $im->transparent($white); $im->interlaced('true'); # Put a black frame around the picture $im->rectangle(0,0,99,99,$black); # Draw a blue oval $im->arc(50,50,95,75,0,360,$blue); # And fill it with red $im->fill(50,50,$red); # make sure we are writing to a binary stream binmode STDOUT; # Convert the image to PNG and print it on standard output print $im->png;

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print