in reply to Re: Image::Magick Depth
in thread Image::Magick Depth

Unfortunately the Depth attribute is immutable. All references I've found suggest some kind of SetDepth function which does the changing. I just can't seem to find what it is.

Replies are listed 'Best First'.
Re^3: Image::Magick Depth
by Guildencrantz (Sexton) on Sep 03, 2008 at 05:18 UTC
    DUH! Okay, I should have seen this before, but there's a Set() function:
    $thumbnail->Set(depth => 8);
    So, to ensure that my code performs as expected on both systems:
    #!/usr/bin/perl use Image::Magick; my $thumbnail = Image::Magick->new; $thumbnail->Read("full.bmp"); $thumbnail->Set(depth => 8); $thumbnail->Write("full.png"); $thumbnail->Resize(width=>'200', height=>'150'); $thumbnail->Write("tn_200x150.png"); $thumbnail->Resize(width=>'100', height=>'75'); $thumbnail->Write("tn_100x75.png"); undef $thumbnail; exec "file /home/mhenkel/*.png";