On Sat, Oct 2, 2010 at 12:39 PM, Jouni K. Seppänen <jks@iki.fi> wrote:
Benjamin Root <ben.root@ou.edu> writes:

> And yet, we still allow for saving to jpegs.

Wow, I didn't know. Last time I tried that I got a traceback, and
assumed that it was not supported exactly because jpeg is a nonsensical
format for most graphs.

I just tried again, and got "TypeError: 'int' object is unsubscriptable"
from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
doesn't get much testing.


Yeah, I just double-checked which backend I was using and it turned out to be GTKAgg (I forgot that I changed it at one point for a test).  In TkAgg, I get the same error message you report.
 
> Also, matplotlib is also able to do imshow(), pcolor() and other
> rasterized drawings, so we aren't restricted to just line drawings.

Yes, I guess there are some circumstances in which this would make
sense. Would supporting WebP require new library dependencies?

--
Jouni K. Seppänen
http://www.iki.fi/jks


I am certainly not an expert, but it would appear that we offload a lot of the file-format stuff to PIL anyway.  So, if PIL ever supports WebP, then I would imagine (although I could be wrong) that it would be fairly trivial to add support to WebP at least to whereever we support JPEG.

Ben Root