[Image-SIG] Re: Explaination of encoder in tostring(encoder_name='raw', *args)

Fredrik Lundh fredrik at pythonware.com
Sun Sep 5 12:51:28 CEST 2004


Kent Tenney wrote:

> I have been unable to locate an example
> of what an encoder looks like.

encoders are built-in functions, which can (incrementally) convert
data in an internal image memory to chunks of binary data.

PIL currently supports the following encoders (name, arguments):

    "eps" ()
    "gif" (mode, rawmode, bits, interlace)
    "raw" (mode, rawmode, stride, ystep)
    "xbm" ()
    "zip" (mode, rawmode, optimize, dictionary)
    "jpeg" (mode, rawmode, quality, progressive,
            smooth, optimize, streamtype, xdpi, ydpi)

where "mode" is an image mode, and "rawmode" is the raw data
format: the syntax is:

    <mode>;<bits><flags>

where the flags are I for inverted data, R for reversed bit order,
L for line interleave, B for big endian, N for native, S for signed.
the bits field can be omitted; flags should be given in alphabetical
order.

only certain mode/rawmode combinations are supported; see
libImaging/Pack.c for the complete list.

</F> 





More information about the Image-SIG mailing list