title: Can't use Image.putalpha() on a png file from PIL lib. OSError: cannot write mode PA as PNG
body: <p>Decided to try PIL lib in jupyter notebook. I have an image of blue color (nothing else) in png format.</p>
  <p>Wanted to make it half-transparent. So I did:</p>
  <pre><code>from PIL import Image
  blue = Image.open(&quot;blue_color.png&quot;)
  </code></pre>
  <p>When I open the image through jupyter, everything is fine. But then I apply .putalpha() method:</p>
  <pre><code>blue.putalpha(128)
  </code></pre>
  <p>And get this:</p>
  <pre><code>KeyError                                  Traceback (most recent call last)
  ~\Anaconda3\lib\site-packages\PIL\PngImagePlugin.py in _save(im, fp, filename, chunk)
      799     try:
  --&gt; 800         rawmode, mode = _OUTMODES[mode]
      801     except KeyError:
  
  KeyError: 'PA'
  
  During handling of the above exception, another exception occurred:
  
  OSError                                   Traceback (most recent call last)
  ~\Anaconda3\lib\site-packages\IPython\core\formatters.py in __call__(self, obj)
      343             method = get_real_method(obj, self.print_method)
      344             if method is not None:
  --&gt; 345                 return method()
      346             return None
      347         else:
  
  ~\Anaconda3\lib\site-packages\PIL\Image.py in _repr_png_(self)
      698         &quot;&quot;&quot;
      699         b = io.BytesIO()
  --&gt; 700         self.save(b, &quot;PNG&quot;)
      701         return b.getvalue()
      702 
  
  ~\Anaconda3\lib\site-packages\PIL\Image.py in save(self, fp, format, **params)
     2082 
     2083         try:
  -&gt; 2084             save_handler(self, fp, filename)
     2085         finally:
     2086             # do what we can to clean up
  
  ~\Anaconda3\lib\site-packages\PIL\PngImagePlugin.py in _save(im, fp, filename, chunk)
      800         rawmode, mode = _OUTMODES[mode]
      801     except KeyError:
  --&gt; 802         raise IOError(&quot;cannot write mode %s as PNG&quot; % mode)
      803 
      804     #
  
  OSError: cannot write mode PA as PNG
  </code></pre>
  <p>Made the same actions with another file of color, but it was in jpg format. And everything was fine!</p>
  <p>Is it a file format problem? Could anyone tell me how to fix this?</p>
  <p>Thanks in advance!</p>