Page 1 of 1

Creating a 24-bit BMP

Posted: 2008-08-01T01:41:07-07:00
by zombie_nation
Hi I am using IM to dynamically create a BMP to be used in another PHP module - PEAR Excel Spreadsheet that can only use BMPs.

I have the following commands:

Code: Select all

$aCmd[] = "convert " . $image . ' -resize 170x60 ' . '/home/' . $_SESSION['account_name'] . "/public_html/images/" . $imagename;
    $aCmd[] = "convert " . $image . ' -resize 170x60 ' . '/home/' . $_SESSION['account_name'] . '/public_html/images/kb_logo_web2.bmp';
And it creates a BMP just fine. The problem is that Excel Spreadsheet states either that the BMP is not 24 true colour or that the width exceeds 65kb. I am not asking for any help with Excel Spreadsheet but would like to get some help in understanding how the BMP is created and how to create a format I can use.

Thanks.
Z.

Re: Creating a 24-bit BMP

Posted: 2008-08-01T10:02:28-07:00
by fmw42
You may have to use Q32 IM compile to save images as 24bits as images in IM are stored to the bit depth of the compile (or less using -depth). But hopefully the IM folks will reply with more details or corrections here.

Re: Creating a 24-bit BMP

Posted: 2008-08-01T12:23:49-07:00
by el_supremo
The BMP coder will, by default, output the most recent form of a bitmap header.
But you can force the coder to produce one of two earlier versions by prefixing the output filename with either "bmp3:" or "bmp2:" - e.g. 'bmp3:/public_html/images/kb_logo_web2.bmp'

Pete