擅长:python、mysql、java
<p>我觉得你很亲近。尝试:</p>
<pre><code>pBits = im.convert("RGBA").tostring("raw", "RGBA")
</code></pre>
<p>为了使RGBA rawmode打包程序可用,首先必须将图像转换为RGBA模式(请参见libimaging中的<a href="https://bitbucket.org/effbot/pil-117/src/7493ffdf4aff/libImaging/Pack.c#cl-459" rel="noreferrer">Pack.c</a>)。您可以检查<code>len(pBits) == im.size[0]*im.size[1]*4</code>,对于gloves200图像,它是200x200x4=160000字节。</p>