TiffFrame¶
- final class tifffile.TiffFrame(parent, /, index, *, offset=None, keyframe=None, dataoffsets=None, databytecounts=None)¶
Lightweight TIFF image file directory (IFD).
The purpose of TiffFrame is to reduce resource usage and speed up reading image data from file compared to TiffPage. Properties other than offset, index, dataoffsets, databytecounts, subifds, and jpegtables are assumed to be identical with a specified TiffPage instance, the keyframe. TiffFrame instances have no tags property. Virtual frames just reference the image data in the file. They may not have an IFD structure in the file.
TiffFrame instances are not thread-safe. All attributes are read-only.
- Parameters:
parent (TiffFile) – TiffFile instance to read frame from. The file handle position must be at an offset to an IFD structure. Only a limited number of tag values are read from file.
index (int | Sequence[int]) – Index of frame in IFD tree.
offset (int) – Position of frame in file.
keyframe (TiffPage | None) – TiffPage instance with same hash as frame.
dataoffsets (tuple[int, ...]) – Data offsets of “virtual frame”.
databytecounts (tuple[int, ...]) – Data bytecounts of “virtual frame”.
- offset: int¶
Position of frame in file.
- dataoffsets: tuple[int, ...]¶
Positions of strips or tiles in file.
- databytecounts: tuple[int, ...]¶
Size of strips or tiles in file.
- subifds: tuple[int, ...] | None¶
Positions of SubIFDs in file.
- jpegtables: bytes | None¶
JPEG quantization and/or Huffman tables.
- asarray(*args, **kwargs)¶
Return image from frame as NumPy array.
- Parameters:
**kwargs (Any) – Arguments passed to
TiffPage.asarray()
.args (Any)
**kwargs
- Return type:
NDArray[Any]
- aszarr(**kwargs)¶
Return image from frame as Zarr store.
- Parameters:
**kwarg – Arguments passed to
ZarrTiffStore
.kwargs (Any)
- Return type:
- property index: int¶
Index of frame in IFD chain.
- property treeindex: tuple[int, ...]¶
Index of frame in IFD tree.
- property is_virtual: bool¶
Frame does not have IFD structure in file.
- property is_subifd: bool¶
Frame is SubIFD of another page.