title: Cannot convert an indexed (logical) image to grayscale
body: <p>I have this image:</p>
  
  <p><img src="https://i.stack.imgur.com/kiUaz.png" alt="enter image description here"></p>
  
  <pre><code>          Filename: '/bmp/ae07_001.bmp'
         FileModDate: '09-Apr-2014 19:21:20'
            FileSize: 7202
              Format: 'bmp'
       FormatVersion: 'Version 3 (Microsoft Windows 3.x)'
               Width: 449
              Height: 119
            BitDepth: 1
           ColorType: 'indexed'
     FormatSignature: 'BM'
  NumColormapEntries: 2
            Colormap: [2x3 double]
             RedMask: []
           GreenMask: []
            BlueMask: []
     ImageDataOffset: 62
    BitmapHeaderSize: 40
           NumPlanes: 1
     CompressionType: 'none'
          BitmapSize: 7140
      HorzResolution: 2925
      VertResolution: 2925
       NumColorsUsed: 2
  NumImportantColors: 2
  </code></pre>
  
  <p>So its an indexed image of logical format. </p>
  
  <p>The problem is that I cannot read it in. For example if I use the simple command</p>
  
  <p><code>img = imread(file);</code></p>
  
  <p>I get this:</p>
  
  <p><img src="https://i.stack.imgur.com/aGZ0H.jpg" alt="enter image description here"></p>
  
  <p>So to read it in properly I use:</p>
  
  <pre><code>[img, map] = imread(file);
  imshow(img, map);
  </code></pre>
  
  <p>Here it shows up fine, as it should, but I do not want to show it, I want to work on it further so I have to convert it to grayscale, which I do using this command:</p>
  
  <p><code>new = ind2gray(img, map);</code></p>
  
  <p>Here I am presented with the warning: </p>
  
  <blockquote>
    <p>Warning: X should be a double, single, uint8, or uint16 array. 
    Convert your image to double using IM2DOUBLE(X,'INDEXED').</p>
  </blockquote>
  
  <p>And if I use <code>imshow(new)</code> it just shows up as a blank box, just a white image without the text.</p>
  
  <p>I tried the recommended <code>im2double(img, 'indexed')</code> and then use <code>ind2gray</code> but again I am presented with a white box, with the data missing.</p>
  
  <p>Why cant I convert this image to grayscale?</p>