PIL: Image.draft -- what are the modes that I can use?

abcd codecraig at gmail.com
Wed Oct 18 15:33:29 CEST 2006


I have PIL 1.1.5 on python 2.4.1 and I am attempting to get a smaller
(file size) of an image.

for example:
im = ImageGrab.grab()

im.save("tmp.gif")    ---- about 1.7mb
im.save("tmp.jpeg")  ---- about 290kb

anyways I want to save the image as a GIF, but not have it be so
large....so I thought that the Image.draft method would be what I
wanted....

im.draft(mode, size)

Configures the image file loader so it returns a version of the image
that as closely as possible matches the given mode and size. For
example, you can use this method to convert a colour JPEG to greyscale
while loading it, or to extract a 128x192 version from a PCD file.

.....what 'modes' can I use?  or is there another way to shrink the
size of the image (other than resizing it)?

thanks




More information about the Python-list mailing list