<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263841</link>
    <title>MATLAB Central Newsreader - How to write a 24-bit BMP image?</title>
    <description>Feed for thread: How to write a 24-bit BMP image?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 22 Oct 2009 10:12:19 -0400</pubDate>
      <title>How to write a 24-bit BMP image?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263841#688941</link>
      <author>Elad Peer</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I use 'imwrite' and 'imread' methods to read/write a BMP file.&lt;br&gt;
I need the file at 24-bit, but MATLAB uses (at the standard 'bmp' format) the windows 8-bit format.&lt;br&gt;
Do you know how to change this feature into 24 bit?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Elad</description>
    </item>
    <item>
      <pubDate>Thu, 22 Oct 2009 10:37:01 -0400</pubDate>
      <title>Re: How to write a 24-bit BMP image?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263841#688948</link>
      <author>ImageAnalyst</author>
      <description>On Oct 22, 6:12&#160;am, &quot;Elad Peer&quot; &amp;lt;el...@tx.technion.ac.il&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I use 'imwrite' and 'imread' methods to read/write a BMP file.&lt;br&gt;
&amp;gt; I need the file at 24-bit, but MATLAB uses (at the standard 'bmp' format) the windows 8-bit format.&lt;br&gt;
&amp;gt; Do you know how to change this feature into 24 bit?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Elad&lt;br&gt;
&lt;br&gt;
----------------------------------------------------------------------&lt;br&gt;
BMP does not support 24 bit monochrome images.  It supports 24 bit&lt;br&gt;
color images (three 8 bit color planes).  Which are you trying to&lt;br&gt;
achieve?&lt;br&gt;
&lt;br&gt;
I suspect you have a monochrome image (a 2D array, whereas a color&lt;br&gt;
image would be a nxmx3 3D array) and are writing it out as a BMP and&lt;br&gt;
getting a monochrome BMP instead of the color BMP like you want.&lt;br&gt;
&lt;br&gt;
If you want a color image and have only a 2D array instead of a 3D&lt;br&gt;
array, then you can create a color image array with the ind2rgb()&lt;br&gt;
function or the cat(3,...) function.</description>
    </item>
    <item>
      <pubDate>Thu, 22 Oct 2009 12:21:03 -0400</pubDate>
      <title>Re: How to write a 24-bit BMP image?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263841#688975</link>
      <author>Steve Eddins</author>
      <description>Elad Peer wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I use 'imwrite' and 'imread' methods to read/write a BMP file.&lt;br&gt;
&amp;gt; I need the file at 24-bit, but MATLAB uses (at the standard 'bmp' format) the windows 8-bit format.&lt;br&gt;
&amp;gt; Do you know how to change this feature into 24 bit?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Elad&lt;br&gt;
&lt;br&gt;
If you pass an M-by-N-by-3 array to imwrite, it will create a 24-bit BMP &lt;br&gt;
file.&lt;br&gt;
&lt;br&gt;
---&lt;br&gt;
Steve Eddins&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/steve/&quot;&gt;http://blogs.mathworks.com/steve/&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

