Sihal has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Image::Magick ; my @files = grep { /png/ } `ls` ; foreach my $f (@files) { chomp $f ; my $loc = Image::Magick->new; $loc->Read($f); $loc->Set(monochrome => "True") ; $loc->Set(monochrome => "True",matte =>"True") ; my ($w, $h, $size, $format) = $loc->Ping("$f"); $w = 1+int(($w-1)/8); $w *= 8; my $bg = Image::Magick->new; $bg->Set(debug =>"All") ; $bg->Set(size=>$w."x$h"); # $bg->Set(type => "Grayscale") ; $bg->Set(monochrome => "True") ; $bg->ReadImage('xc:white'); $bg->Composite(image=>$loc, gravity=>"Center"); undef $loc; $bg->Set(monochrome => "True",matte =>"True") ; $bg->Write("wbmp:foo.wbmp") ; last; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PerlMagick segfault
by PodMaster (Abbot) on Apr 07, 2003 at 08:48 UTC | |
by Sihal (Pilgrim) on Apr 07, 2003 at 08:57 UTC | |
|
Re: PerlMagick segfault
by Sihal (Pilgrim) on Apr 07, 2003 at 09:39 UTC |