I want to convert a PNG with a drop shadow on a transparent background to a
GIF on a solid background as advised by
http://www.imagemagick.org/Usage/formats/#bgnd

The ImageMagick command is simplicity itself:

   convert a.png -background LightSteelBlue -flatten a_overlay.gif

However I am struggling to convert this into PerlMagick. My code currently
looks like this:

   use Image::Magick;
   my $gif = new Image::Magick;

   $x = $gif->Read(filename=>'png:test.png');
   warn "$x" if "$x";

   $x = $gif->Flatten(background => 'LightSteelBlue');
   warn "$x" if "$x";

   $x = $gif->Write(filename=>'gif:test.gif');
   warn "$x" if "$x";

This fails with "Usage: Flatten(ref)" on both the following systems:

   * Windows XP / ActiveState 5.8.8 / ImageMagick 6.3.3
   * Debian Linux / Perl 5.8.4 / ImageMagick 6.3.3

The only common thread between these two systems are (1) ImageMagick 6.3.3
and (2) Me. Of course I suspect the latter to be at fault!

I have searched all documentation, Google and specifically imagemagick.org,
but without success. I am at the hair-tearing stage, so any assistance you
are able to provide would be much appreciated.

Thank you.

Chris

Important:

This email is sent on behalf of Trident Garages Ltd (www.tridentgarages.co.uk). 
Its contents are confidential to the intended recipient and may be legally 
privileged. If you are not the intended recipient: (1) you must not disclose, 
copy or distribute its contents to any other person, nor use its contents in 
any way; (2) please contact Trident Garages on +44 (0) 1932 874411 quoting the 
name of the sender and the addressee, then delete it from your system. Please 
accept our apologies for the inconvenience.

Trident has scanned this email for viruses but does not accept any 
responsibility once this email has been transmitted. You should scan 
attachments (if any) for viruses.

No contract may be concluded on behalf of Trident Garages Ltd, nor service of 
process accepted, by email.

Trident Garages Ltd is registered in England no. 764299. Registered office at 
Guildford Road, Ottershaw, Surrey KT16 0NZ
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to