loose transparency when draw black on transparent background
Posted: 2011-04-15T05:59:36-07:00
When I process a image, consisting of a black painting on transparent background,
resulting image will be completely black -> transparency seems to get lost.
This issue happens at processing following formats: GIF and PNG.
Do you have any idea?
system:
imagemagick/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
libmagick10/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
perlmagick/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
Here are my processing steps: read, resize, write
my $image = new Image::Magick;
$image->Read($upload_path);
my $x=$image->Get('width')||0;
my $y=$image->Get('height')||0;
if ($x>0 && $y>0){
if ($x>$y){
$image->Resize(width=>'600', height=>int(600*$y/$x) );
}else{
$image->Resize(width=>int(600*$x/$y), height=>'600' );
}
}
$image->Write('jpg:'.$image_path);
There are no problems with other source images.
Cheers, Peter
resulting image will be completely black -> transparency seems to get lost.
This issue happens at processing following formats: GIF and PNG.
Do you have any idea?
system:
imagemagick/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
libmagick10/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
perlmagick/hardy uptodate 7:6.3.7.9.dfsg1-2ubuntu1.2
Here are my processing steps: read, resize, write
my $image = new Image::Magick;
$image->Read($upload_path);
my $x=$image->Get('width')||0;
my $y=$image->Get('height')||0;
if ($x>0 && $y>0){
if ($x>$y){
$image->Resize(width=>'600', height=>int(600*$y/$x) );
}else{
$image->Resize(width=>int(600*$x/$y), height=>'600' );
}
}
$image->Write('jpg:'.$image_path);
There are no problems with other source images.
Cheers, Peter