Perl Magick Resize Color Issue
Posted: 2014-01-15T08:13:09-07:00
down vote favorite
I'm writing a script to resize gif images. I've notice that the images I create have a smaller image size, but take up more room on disk. I think I've tracked down the cause of the problem. The original images when examined in photoshop only have 4 colors in their color table (white, gray, grayer, black) while the new images have 256 colors in their color table. I can't find a way to copy the color table from the incoming image, is there some way to control this? Here's my script
Any advice much appreciated.
I'm writing a script to resize gif images. I've notice that the images I create have a smaller image size, but take up more room on disk. I think I've tracked down the cause of the problem. The original images when examined in photoshop only have 4 colors in their color table (white, gray, grayer, black) while the new images have 256 colors in their color table. I can't find a way to copy the color table from the incoming image, is there some way to control this? Here's my script
Code: Select all
use Image::Magick;
my $image = Image::Magick->new;
$image -> Read( 'test.gif' );
$image -> Resize(geometry=>"50%");
$image->Write( 'test-out.gif' );