[magick-users] convert gif to png, and lost transparency

zentara zentara1 at sbcglobal.net
Fri Dec 19 07:40:31 PST 2008


On Fri, 19 Dec 2008 23:09:27 +0800
"Jinsong Zhao" <jinsong.zhao at gmail.com> wrote:

>Hi there,
>
>I hope to convert powerlogo.gif
>(http://www.freebsd.org/gifs/powerlogo.gif) from gif format to png
>format. However, the transparency in gif figure lost.
>
>I just used:
> convert powerlogo.gif powerlogo.png
>
>any suggestions? Thanks
>Jinsong

This works for me in Perl

Also see 

http://www.imagemagick.org/Usage/formats/#gif_trans

#!/usr/bin/perl -w
use strict;
use Image::Magick;

my $image = Image::Magick->new;
my $rc = $image->Read("powerlogo.gif");
warn $rc if $rc;
 
$image->Transparent('color' => 'black');
$image->Write("output.png");
__END__


zentara

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 


More information about the Magick-users mailing list