gif to bitmap in python
Jason Toy
gee308 at mediaone.net
Thu Aug 31 09:27:12 EDT 2000
That's all to convert gif to bitmap???Cool.. I suppose you can use pil to
convert jpegs too? Can pil make thumbnails?
Greg Landrum wrote:
> In article <8oghku$a9t$1 at nnrp1.deja.com>,
> tiddlerdeja at my-deja.com wrote:
> > Can anyone tell me how, or give an example of howto convert a gif
> image
> > to a bitmap representation of it?
> >
>
> I'm not completely sure what you mean by "bitmap representation", but
> PIL probably does what you want. :-)
>
> To convert to a BMP (windows bitmap), you would do:
> >>> from Pil import Image
> >>> img = Image.open('foo.gif')
> >>> img.save('foo.bmp')
>
> If you would rather get a Numeric array with the values from the image:
> >>> from Pil import Image
> >>> from Numeric import *
> >>> img = Image.open('foo.gif')
> >>> arr = resize(fromstring(img.tostring(),Int8),img.size)
>
> I hope this helps.
> -greg
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
More information about the Python-list
mailing list