How do I read / understand the transparent color in a PNG image with imread?
<p>This is my code (using Anaconda with scikit-image):</p>

<pre><code>from skimage.io import imread
image = imread('myimage.png')
</code></pre>

<p>But I'd like to know which one, in the palette, is the transparent color, and be able to treat it like that. This means: When the image is finally loaded, it has shape <code>(W, H, 3)</code> as RGB, despite the info from <code>pnginfo</code> be the following:</p>

<blockquote>
  <p>Bitdepth (Bits/Sample): 8<br>
  Channels (Samples/Pixel): 1<br>
  Pixel depth (Pixel Depth): 8<br>
  Colour Type (Photometric Interpretation): PALETTED COLOUR with alpha (44 colours, 1 transparent)</p>
</blockquote>

<p>I would like one out of three:</p>

<ul>
<li>When loading the image, since I'm getting it as an RGB array, I would like to know which color (in this context I'd need the color as its RGB components) was intended to be transparent.</li>
<li>Get a bit mask (actually a WxH boolean array) telling me which pixels are transparent and which pixels are non-transparent.</li>
<li>Load the image as an RGBA array instead of an RGB array.</li>
</ul>

<p>How can I?</p>

<p>I am using Anaconda, which has stuff like:</p>

<ul>
<li>Pillow</li>
<li>Numpy</li>
<li>SciPy</li>
</ul>