Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!l35g2000vba.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to write a 24-bit BMP image?
Date: Thu, 22 Oct 2009 03:37:01 -0700 (PDT)
Organization: http://groups.google.com
Lines: 24
Message-ID: <52186b88-dd9c-4644-9bab-bc9adb5709a8@l35g2000vba.googlegroups.com>
References: <hbpb63$23g$1@fred.mathworks.com>
NNTP-Posting-Host: 75.186.70.56
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1256207822 26030 127.0.0.1 (22 Oct 2009 10:37:02 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 22 Oct 2009 10:37:02 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l35g2000vba.googlegroups.com; posting-host=75.186.70.56; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; CyberSafe-IWA-Enable; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 
	3.0.04506.648; .NET CLR 3.5.21022; AskTB5.5),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:579258


On Oct 22, 6:12 am, "Elad Peer" <el...@tx.technion.ac.il> wrote:
> Hi,
>
> I use 'imwrite' and 'imread' methods to read/write a BMP file.
> I need the file at 24-bit, but MATLAB uses (at the standard 'bmp' format) the windows 8-bit format.
> Do you know how to change this feature into 24 bit?
>
> Thanks,
>
> Elad

----------------------------------------------------------------------
BMP does not support 24 bit monochrome images.  It supports 24 bit
color images (three 8 bit color planes).  Which are you trying to
achieve?

I suspect you have a monochrome image (a 2D array, whereas a color
image would be a nxmx3 3D array) and are writing it out as a BMP and
getting a monochrome BMP instead of the color BMP like you want.

If you want a color image and have only a 2D array instead of a 3D
array, then you can create a color image array with the ind2rgb()
function or the cat(3,...) function.