title: PIL putpalette error
body: <p>when I use PIL, I got a error. Read a img and convert to 'P' mode. Then I use <code>img.putpalette(palette)</code>,<code>len(palette)</code> equals 768.And the range of pattle was 0~255.</p>
  
  <pre><code>png = Image.fromarray(labelMap).convert('P')
  png.putpalette(cmap)
  png.save(pngPath, format='PNG')
  </code></pre>
  
  <p>And I got a raise <strong>ValueError: invalid palette size</strong>, So I want know why and how to solve this problem.</p>
  
  <p>edit..</p>
  
  <p>I found a problem, when length of palette smaller than 192, this code works well, and... I don't know why.</p>
  
  <p>Thanks much.</p>