Python package for reading Adobe Photoshop PSD files
Python package for reading Adobe Photoshop PSD files
psd-tools is a Python package for working with Adobe Photoshop PSD files
as described in specification.
Use pip to install the package:
pip install psd-tools
For advanced layer compositing features, install with the composite extra:
pip install 'psd-tools[composite]'
The composite extra provides optional dependencies (aggdraw, scipy, scikit-image)
for advanced rendering features:
Basic compositing works without these dependencies using cached previews or simple pixel-based operations. Note that the composite extra may not be available on all platforms (notably Python 3.14 on Windows).
from psd_tools import PSDImage
psd = PSDImage.open('example.psd')
psd.composite().save('example.png')
for layer in psd:
print(layer)
layer_image = layer.composite()
layer_image.save('%s.png' % layer.name)
Check out the documentation for features and details.
See contributing page.
Note
PSD specification is far from complete. If you cannot find a desired information in the documentation, you should inspect the low-level data structure.
composite: an unknown effect class makes Layer.__repr__ raise, which aborts every composite
composite: a malformed stroke-effect descriptor is tolerated when measured but raises when drawn
composite: a pattern or gradient stroke fill is placed on a box truncated from a fractional stroke width
composite: _draw_path() seeds a pen-only raster as fully covered
Effect-aware output bbox for layer.composite()
chore: adopt the remaining pydocstyle rules (D1, D200, D401)
Tracking: compositor code-quality refactoring
proposal: define the layer-container contract instead of emulating `list`
Stroke effects: replace edge-dilation with a signed-distance band
proposal: give psd_tools.api a typed boundary for descriptor access