TiffImagePlugin (version 1.3.5)
index
/Library/Python/2.7/site-packages/PIL/TiffImagePlugin.py

# The Python Imaging Library.
# $Id$
#
# TIFF file handling
#
# TIFF is a flexible, if somewhat aged, image file format originally
# defined by Aldus.  Although TIFF supports a wide variety of pixel
# layouts and compression methods, the name doesn't really stand for
# "thousands of incompatible file formats," it just feels that way.
#
# To read TIFF data from a stream, the stream must be seekable.  For
# progressive decoding, make sure to use TIFF files where the tag
# directory is placed first in the file.
#
# History:
# 1995-09-01 fl   Created
# 1996-05-04 fl   Handle JPEGTABLES tag
# 1996-05-18 fl   Fixed COLORMAP support
# 1997-01-05 fl   Fixed PREDICTOR support
# 1997-08-27 fl   Added support for rational tags (from Perry Stoll)
# 1998-01-10 fl   Fixed seek/tell (from Jan Blom)
# 1998-07-15 fl   Use private names for internal variables
# 1999-06-13 fl   Rewritten for PIL 1.0 (1.0)
# 2000-10-11 fl   Additional fixes for Python 2.0 (1.1)
# 2001-04-17 fl   Fixed rewind support (seek to frame 0) (1.2)
# 2001-05-12 fl   Added write support for more tags (from Greg Couch) (1.3)
# 2001-12-18 fl   Added workaround for broken Matrox library
# 2002-01-18 fl   Don't mess up if photometric tag is missing (D. Alan Stewart)
# 2003-05-19 fl   Check FILLORDER tag
# 2003-09-26 fl   Added RGBa support
# 2004-02-24 fl   Added DPI support; fixed rational write support
# 2005-02-07 fl   Added workaround for broken Corel Draw 10 files
# 2006-01-09 fl   Added support for float/double tags (from Russell Nelson)
#
# Copyright (c) 1997-2006 by Secret Labs AB.  All rights reserved.
# Copyright (c) 1995-1997 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#

 
Modules
       
Image
ImageFile
ImagePalette
array
string
sys

 
Classes
       
ImageFile.ImageFile(Image.Image)
TiffImageFile
ImageFileDirectory

 
class ImageFileDirectory
     Methods defined here:
__getitem__(self, tag)
__init__(self, prefix)
__len__(self)
__setitem__(self, tag, value)
get(self, tag, default=None)
getscalar(self, tag, default=None)
has_key(self, tag)
items(self)
keys(self)
load(self, fp)
load_byte(self, data)
load_double(self, data)
load_float(self, data)
load_long(self, data)
load_rational(self, data)
load_short(self, data)
load_string(self, data)
load_undefined(self, data)
reset(self)
save(self, fp)

Data and other attributes defined here:
load_dispatch = {1: (1, <function load_byte>), 2: (1, <function load_string>), 3: (2, <function load_short>), 4: (4, <function load_long>), 5: (8, <function load_rational>), 7: (1, <function load_undefined>), 11: (4, <function load_float>), 12: (8, <function load_double>)}

 
class TiffImageFile(ImageFile.ImageFile)
    
Method resolution order:
TiffImageFile
ImageFile.ImageFile
Image.Image

Methods defined here:
seek(self, frame)
Select a given frame as current image
tell(self)
Return the current frame number

Data and other attributes defined here:
format = 'TIFF'
format_description = 'Adobe TIFF'

Methods inherited from ImageFile.ImageFile:
__init__(self, fp=None, filename=None)
draft(self, mode, size)
Set draft mode
load(self)
Load image data based on tile list
load_end(self)
load_prepare(self)
verify(self)
Check file integrity

Methods inherited from Image.Image:
__getattr__(self, name)
__repr__(self)
convert(self, mode=None, data=None, dither=None, palette=0, colors=256)
Convert to other pixel format
copy(self)
Copy raster data
crop(self, box=None)
Crop region from image
filter(self, filter)
Apply environment filter to image
fromstring(self, data, decoder_name='raw', *args)
Load data to image from binary string
getbands(self)
Get band names
getbbox(self)
Get bounding box of actual data (non-zero pixels) in image
getcolors(self, maxcolors=256)
Get colors from image, up to given limit
getdata(self, band=None)
Get image data as sequence object.
getextrema(self)
Get min/max value
getim(self)
Get PyCObject pointer to internal image memory
getpalette(self)
Get palette contents.
getpixel(self, xy)
Get pixel value
getprojection(self)
Get projection to x and y axes
histogram(self, mask=None, extrema=None)
Take histogram of image
offset(self, xoffset, yoffset=None)
(deprecated) Offset image in horizontal and/or vertical direction
paste(self, im, box=None, mask=None)
Paste other image into region
point(self, lut, mode=None)
Map image through lookup table
putalpha(self, alpha)
Set alpha layer
putdata(self, data, scale=1.0, offset=0.0)
Put data from a sequence object into an image.
putpalette(self, data, rawmode='RGB')
Put palette data into an image.
putpixel(self, xy, value)
Set pixel value
quantize(self, colors=256, method=0, kmeans=0, palette=None)
resize(self, size, resample=0)
Resize image
rotate(self, angle, resample=0, expand=0)
Rotate image.  Angle given as degrees counter-clockwise.
save(self, fp, format=None, **params)
Save image to file or stream
show(self, title=None, command=None)
Display image (for debug purposes only)
split(self)
Split image into bands
thumbnail(self, size, resample=0)
Create thumbnail representation (modifies image in place)
tobitmap(self, name='image')
Return image as an XBM bitmap
tostring(self, encoder_name='raw', *args)
Return image as a binary string
transform(self, size, method, data=None, resample=0, fill=1)
Transform image
transpose(self, method)
Transpose image (flip or rotate in 90 degree steps)

 
Functions
       
ib16(c, o=0)
ib32(c, o=0)
il16(c, o=0)
il32(c, o=0)
ob16(i)
ob32(i)
ol16(i)
ol32(i)

 
Data
        ARTIST = 315
BITSPERSAMPLE = 258
COLORMAP = 320
COMPRESSION = 259
COMPRESSION_INFO = {1: 'raw', 2: 'tiff_ccitt', 3: 'group3', 4: 'group4', 5: 'tiff_lzw', 6: 'tiff_jpeg', 7: 'jpeg', 32771: 'tiff_raw_16', 32773: 'packbits'}
COPYRIGHT = 33432
DATE_TIME = 306
EXIFIFD = 34665
EXTRASAMPLES = 338
FILLORDER = 266
ICCPROFILE = 34675
II = 'II'
IMAGEDESCRIPTION = 270
IMAGELENGTH = 257
IMAGEWIDTH = 256
IPTC_NAA_CHUNK = 33723
JPEGTABLES = 347
MM = 'MM'
OPEN_INFO = {('II', 0, 1, 1, (1,), ()): ('1', '1;I'), ('II', 0, 1, 1, (8,), ()): ('L', 'L;I'), ('II', 0, 1, 2, (1,), ()): ('1', '1;IR'), ('II', 0, 1, 2, (8,), ()): ('L', 'L;IR'), ('II', 1, 1, 1, (1,), ()): ('1', '1'), ('II', 1, 1, 1, (8,), ()): ('L', 'L'), ('II', 1, 1, 1, (8, 8), (2,)): ('LA', 'LA'), ('II', 1, 1, 1, (16,), ()): ('I;16', 'I;16'), ('II', 1, 1, 2, (1,), ()): ('1', '1;R'), ('II', 1, 1, 2, (8,), ()): ('L', 'L;R'), ...}
PHOTOMETRIC_INTERPRETATION = 262
PHOTOSHOP_CHUNK = 34377
PLANAR_CONFIGURATION = 284
PREDICTOR = 317
PREFIXES = ['MM\x00*', 'II*\x00', 'II\xbc\x00']
RESOLUTION_UNIT = 296
ROWSPERSTRIP = 278
SAMPLEFORMAT = 339
SAMPLESPERPIXEL = 277
SAVE_INFO = {'1': ('1', 'II', 1, 1, (1,), None), 'CMYK': ('CMYK', 'II', 5, 1, (8, 8, 8, 8), None), 'F': ('F;32F', 'II', 1, 3, (32,), None), 'F;32BF': ('F;32BF', 'MM', 1, 3, (32,), None), 'I': ('I;32S', 'II', 1, 2, (32,), None), 'I;16': ('I;16', 'II', 1, 1, (16,), None), 'I;16B': ('I;16B', 'MM', 1, 1, (16,), None), 'I;16BS': ('I;16BS', 'MM', 1, 2, (16,), None), 'I;16S': ('I;16S', 'II', 1, 2, (16,), None), 'I;32BS': ('I;32BS', 'MM', 1, 2, (32,), None), ...}
SOFTWARE = 305
STRIPBYTECOUNTS = 279
STRIPOFFSETS = 273
TILEOFFSETS = 324
XMP = 700
X_RESOLUTION = 282
Y_RESOLUTION = 283
__version__ = '1.3.5'
native_prefix = 'II'