Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

ImageMagick - composite

by ultranerds (Friar)
on Dec 08, 2008 at 11:53 UTC ( #728907=perlquestion: print w/replies, xml ) Need Help??
ultranerds has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys/gals,

I'm trying to do a "compasite" on a GIF,

`convert '/home/mystock/public_html/images/gif_image/9/758439-gif_6_badminton.gif' -resize 100x100 /home/mystock/public_html/user_thumbs/jpg/100/167765-100100.gif`

Now, it does the resizing ok - but for some reason, the "background" of the image comes up all black.

Anyone got any suggestions?



Replies are listed 'Best First'.
Re: ImageMagick - composite
by marto (Bishop) on Dec 08, 2008 at 12:02 UTC

      Thanks for the replies guys. Managed to get around it by using:

      convert image.gif image.jpg

      (i.e converting them to JPG, before shrinking and watermaking :))

      Thanks again

Re: ImageMagick - composite
by zentara (Archbishop) on Dec 08, 2008 at 15:27 UTC
    This works putting a blue square on a gif.
    #!/usr/bin/perl use warnings; use strict; use Image::Magick; my $x; my $null=Image::Magick->new; my $img=Image::Magick->new; $null->Set(size=>'20x20'); $x=$null->ReadImage('xc:blue'); warn "$x" if "$x"; $img->Set(size=>'640x470'); $x=$img->ReadImage('1z-squatch.gif'); warn "$x" if "$x"; $img->Composite(image=>$null, compose=>'Atop', gravity=>'Center', ); $img->Write("$0.gif");

    I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: ImageMagick - composite
by Anonymous Monk on Dec 08, 2008 at 11:56 UTC
    contact imagemagick support forum :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://728907]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-02-18 20:45 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (257 votes). Check out past polls.