in reply to Re: Win32 converting 32bit bmp images to 24bit
in thread Win32 converting 32bit bmp images to 24bit

That didn't appear to do it. I get an empty file as the output. Just to be clear, I don't think there would be a problem if I had a 24 bit bmp to start with (which is what most applications seem to expect - including image::magick from my tests).

I do get a warning message on executing any imagemagick method "no magic configuration file found (magic.mgk)-No such file or directory- at test2.pl line" for example. But that doesn't seem to interfere with Image::Magick operation (I ran a couple of the demo.pl scripts from the documentation and they gave the warning but worked fine).

Probably more to the point is an error I get when reading in the 32 bit bmp in quesetion: "Warning 325: Not a BMP image file (J:/temp/screencaps/newcap.bmp) at imagemagick_test.pl line 7". This image opens fine in Photoshop and in Mozilla 1.1 - so it is a valid BMP. Just (as I said in the original post) a 32bit BMP. Chesirecat said some not so obvious code was needed to get it to 24bit (which then ought to be a valid bmp as far as ImageMagick is concerned). Which brings me back to the original question, which would seem to require some code outside of Image::Magick calls ...

Test Code: (for ref: line warn after the Read($name))

use strict; use Image::Magick; my $image = Image::Magick->new; my $name = q(J:/temp/screencaps/newcap.bmp); my $x = $image->Read($name); warn "$x" if "$x"; $x = $image->Write(filename=>'J:/temp/screencaps/new.bmp'); warn "$x" if "$x";