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

Fredrik Lundh fredrik at pythonware.com
Wed Oct 18 09:42:13 EDT 2006


"abcd" wrote:

>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....

GIF is horribly unsuitable for screenshots on modern machines.  have you
considered using PNG ?

or even better, Flash?

here's a tool that lets you use VNC to capture the screen, and then convert
the result to a flash animation:

    http://www.unixuser.org/~euske/vnc2swf/

> 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.

note the use of the words "loader" and "loading".  draft is used to speed things
up when loading images, not compress things when storing them.

</F> 






More information about the Python-list mailing list