Hi,
I'm capturing web images (aviation weather forecasts) with a Perl script and
reducing them in size and quality for display on mobile devices.
I've got this code snippet that takes a blob and writes it out in its
original gif or converts to jpeg. When I try to add some -quality or
-compression attributes to the Write() method, nothing gets written back.
Without the quality=>'75' or compression=>'JPEG' it works and returns either
a gif or a jpeg according to $translate.
How can I compress the JPEG images from Perl?
And could I also compress the gif to say WEB216? Or any gif format that
keeps the file size down? Again from Perl.
I'm probably doing something goofy - any ideas please on how I may compress
these images on the hoof?
if ($type eq "gif"){
$image=Image::Magick->new(magick=>'gif');
$image->BlobToImage($blob[0]);
if ($size){
$image->Scale($size);
$image->Sharpen(0.0x1.0);
}
binmode STDOUT;
if ($translate){
$image->Write('jpg:-', quality=>'75') # <- fails here.
}
else{
$image->Write('gif:-');
}
}
All hints gratefully accepted!
Angela
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users