Migrating from version 1.7 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 now
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()