Read and write layered TIFF ImageSourceData and ImageResources tags
Psdtags is a Python library to read and write the Adobe Photoshop(r) specific
ImageResources (#34377) and ImageSourceData (#37724) TIFF tags, which contain
image resource blocks, layer and mask information found in a typical layered
TIFF file created by Photoshop.
The format is specified in the
Adobe Photoshop TIFF Technical Notes (March 22, 2002)
Adobe Photoshop File Formats Specification (November 2019).
Adobe Photoshop is a registered trademark of Adobe Systems Inc.
|Organization:||Laboratory for Fluorescence Dynamics, University of California, Irvine|
This release has been tested with the following requirements and dependencies
(other versions may work):
- CPython 3.8.10, 3.9.10, 3.10.2 64-bit
- Numpy 1.21.5
- Imagecodecs 2021.11.20 (optional)
- Tifffile 2021.11.2 (optional)
- Matplotlib 3.4.3 (optional)
- Initial release.
The API is not stable yet and might change between revisions.
This module has been tested with a limited number of files only.
Read the ImageSourceData tag value from a layered TIFF file and iterate over
all the channels:
>>> isd = TiffImageSourceData.fromtiff('LayeredTiff.tif') >>> for layer in isd.layers: ... layer.name ... for channel in layer.channels: ... ch = channel.data 'Background' 'Reflect1' 'Reflect2' 'image' 'Layer 1' 'ORight' 'I' 'IShadow' 'O'
To view the layer and mask information in a layered TIFF file from a
command line, run:
python -m psdtags LayeredTiff.tif