Migrating to 1.9¶
psd-tools 1.9 switches to NumPy based compositing.
psd = PSDImage.open(filename) image = psd.compose() layer = psd layer_image = layer.compose()
psd = PSDImage.open(filename) image = psd.composite() layer = psd layer_image = layer.composite()
NumPy array API is introduced:
image = psd.numpy() layer_image = layer.numpy()
Migrating to 1.8¶
There are major API changes in version 1.8.x.
In version 1.8.0 - 1.8.7, the package name was psd_tools2.
File open method is changed from load to
psd = PSDImage.load(filename) with open(filename, 'rb') as f: psd = PSDImage.from_stream(f)
psd = PSDImage.open(filename) with open(filename, 'rb') as f: psd = PSDImage.open(f)
Children of PSDImage or Group is directly accessible by iterator or indexing.
for layer in group.layers: print(layer) first_child = group.layers
for layer in group: print(layer) first_child = group
In version 1.8.x, the order of layers is reversed to reflect that the index should not change when a new layer is added on top.
Primary PIL export method is
image = psd.as_PIL() layer_image = compose(layer) raw_layer_image = layer.as_PIL()
image = psd.compose() layer_image = layer.compose() raw_layer_image = layer.topil()
Low-level data structure¶
Data structures are completely rewritten to support writing functionality.
Drop pymaging support¶
Pymaging support is dropped.