Brad Fitzpatrick (brad) wrote in fotobilder,
Brad Fitzpatrick
brad
fotobilder

Transparent IE PNG... Need help

Here's some code to make a transparent PNG. However, it's not transparent in IE, because IE only handles very simple PNG files.

I've fought with this far too long. It should be easy. I even resorted to trying GD.pm for awhile, even though that'd be a new dependency, but GD.pm segfaults because of all the libpng binary incompatibility issues, and I don't want to fight that and mess up my system.

Your challenge, should you choose to accept it... make this work in IE:

use Image::Magick;
my ($w, $h) = (100, 100);

my $img = Image::Magick->new(size=>"${w}x$h");
$img->ReadImage('xc:transparent');
$img->Quantize(colors => 256,
               colorspace => 'Transparent',
               global_colormap => 'True');
$img->Set(magick => 'png');

$img->Draw( 'primitive' => 'rectangle',
            'points' => join(',', 5, 5, 90, 90),
            'stroke' => 'black',
            );
$img->Draw( 'primitive' => 'rectangle',
            'points' => join(',', 6, 6, 89, 89),
            'stroke' => 'white',
            );
$img->Draw( 'primitive' => 'circle',
            'points' => join(',', 44,44,47,47),
            'stroke' => 'red',
            'fill' => 'yellow',
            'antialias' => 'false',
            );

print $img->ImageToBlob();
Subscribe

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic
  • 5 comments