Skip to main content

Read and write layered TIFF ImageSourceData and ImageResources tags

Project description

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) and Adobe Photoshop File Formats Specification (November 2019).

Adobe Photoshop is a registered trademark of Adobe Systems Inc.

Author:

Christoph Gohlke

Organization:

Laboratory for Fluorescence Dynamics, University of California, Irvine

License:

BSD 3-Clause

Version:

2022.1.14

Requirements

This release has been tested with the following requirements and dependencies (other versions may work):

Revisions

2022.1.14

Initial release.

Notes

The API is not stable yet and might change between revisions.

This module has been tested with a limited number of files only.

Consider psd-tools and pytoshop for working with Adobe Photoshop PSD files.

Examples

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psdtags-2022.1.14.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distribution

psdtags-2022.1.14-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page