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";

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.