Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/migration.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Migrating to 1.11
=================

psd-tools 1.11 introduces stronger type-safety via annotation.

psd-tools 1.11 has a few breaking changes.

Experimental layer creation now disables orphaned layers.
They must be given a valid PSDImage object.

version 1.11.x::

image = Image.new("RGBA", (width, height))
PixelLayer.frompil(psdimage, image)

version 1.10.x::

image = Image.new("RGBA", (width, height))
PixelLayer.frompil(None, image, parent=None)

Migrating to 1.10
=================

Expand Down
14 changes: 10 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ Some of the layer attributes are editable, such as a layer name::

layer.name = 'Updated layer 1'

It is possible to create a new PixelLayer from a PIL object,
psd_tools experimentally supports the creation of a new PixelLayer from a PIL object,
the PIL image will be converted to the color mode of the PSD File given in parameter::
PixelLayer.frompil(pil_image, psd_file, "Layer name", top_offset, left_offset, Compression.RLE)

PixelLayer.frompil(pil_image, psdimage, "Layer name", top_offset, left_offset, Compression.RLE)

To construct a layered PSD file from scratch::

psdimage = PSDImage.new(mode='RGB', size=(640, 480), depth=8)
layer = PixelLayer.frompil(pil_image, psdimage, "Layer 1")
psdimage.save('new_image.psd')

See the function documentation for further parameter explanations.

Expand All @@ -90,8 +97,7 @@ See the function documentation for further parameter explanations.

Create a new group object.::

Group.new("Group name", open_folder=True, parent=parent_group)

Group.new(parent=psdimage, name="Group name", open_folder=True)

:py:class:`~psd_tools.api.layers.TypeLayer` is a layer with texts::

Expand Down
Loading
Loading