SRC(1)

NAME
src - src Documentation

psd-tools is a Python package for working with Adobe Photoshop PSD files as described in specification <https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/>.

INSTALLATION

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]

This installs optional dependencies (aggdraw, scipy, scikit-image) required for:

    •   Vector shape and stroke rendering

    •   Gradient and pattern fills

    •   Layer effects rendering

Basic compositing operations work without these dependencies by using cached previews or simple NumPy-based operations.

Note:
        In order to extract images from 32bit PSD files PIL/Pillow must be built with LITTLECMS or LITTLECMS2 support (apt-get install liblcms2-2 or brew install little-cms2)

GETTING STARTED

            from psd_tools import PSDImage

            psd = PSDImage.open('example.psd')
            psd.composite().save('example.png')

            for layer in psd:
                print(layer)
                image = layer.composite()

Check out the Usage <> documentation for more examples.

FEATURES

Supported:

    •   Read and write of the low-level PSD/PSB file structure

    •   Raw layer image export in NumPy and PIL format

Limited support:

    •   Composition of basic pixel-based layers

    •   Composition of fill layer effects

    •   Vector masks

    •   Editing of some layer attributes such as layer name

    •   Basic editing of pixel layers and groups, such as adding or removing a layer

    •   Blending modes except for dissolve

    •   Drawing of bezier curves

Not supported:

    •   Editing of various layers such as type layers, shape layers, smart objects, etc.

    •   Editing of texts in type layers

    •   Composition of adjustment layers

    •   Composition of many layer effects

    •   Font rendering

  Usage

  Command line

The package provides command line tools to handle a PSD document:

            psd-tools export <input_file> <output_file> [options]
            psd-tools show <input_file> [options]
            psd-tools debug <input_file> [options]
            psd-tools -h | --help
            psd-tools --version

Example:

            psd-tools show example.psd  # Show the file content
            psd-tools export example.psd example.png  # Export as PNG
            psd-tools export example.psd[0] example-0.png  # Export layer as PNG

  Working with PSD document

psd_tools.api <#module-psd_tools.api> package provides the user-friendly API to work with PSD files. PSDImage <#psd_tools.PSDImage> represents a PSD file.

Open an image:

            from psd_tools import PSDImage
            psdimage = PSDImage.open('my_image.psd')

Most of the data structure in the psd-tools suppports pretty printing in IPython environment.

            In [1]: PSDImage.open('example.psd')
            Out[1]:
            PSDImage(mode=RGB size=101x55 depth=8 channels=3)
              [0] PixelLayer('Background' size=101x55)
              [1] PixelLayer('Layer 1' size=85x46)

Internal layers are accessible by iterator or indexing:

            for layer in psdimage:
                print(layer)
                if layer.is_group():
                    for child in layer:
                        print(child)

            child = psdimage[0][0]

Note:
        The iteration order is from background to foreground, which is reversed from version prior to 1.7.x. Use reversed(psd) to iterate from foreground to background.

The opened PSD file can be saved:

            psdimage.save('output.psd')

If the PSD File's layer structure was updated, saving it will update the ImageData section. However, the rendered image is likely different from the Photoshop's rendering due to the limited rendering support in psd_tools.

  Working with Layers

There are various layer kinds in Photoshop.

The most basic layer type is PixelLayer <#psd_tools.api.layers.PixelLayer>:

            print(layer.name)
            layer.kind == 'pixel'

Some of the layer attributes are editable, such as a layer name:

            layer.name = 'Updated layer 1'

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:

            psdimage.create_pixel_layer(pil_image, name="Layer name")

To construct a layered PSD file from scratch:

            psdimage = PSDImage.new(mode='RGB', size=(640, 480), depth=8)
            layer = psdimage.create_pixel_layer(pil_image, name="Layer 1", top=0, left=0, opacity=255)
            group = psdimage.create_group(name="Group 1")
            group.append(layer)
            psdimage.save('new_image.psd')

See the function documentation for further parameter explanations.

Group <#psd_tools.api.layers.Group> has internal layers:

            for layer in group:
                print(layer)

            first_layer = group[0]

Create a new group object.:

            group = psdimage.create_group(name="Group name")
            group.append(layer)

TypeLayer <#psd_tools.api.layers.TypeLayer> is a layer with texts:

            print(layer.text)

Typographic details such as fonts, character styles, and paragraph styles are available via the typesetting <#psd_tools.api.layers.TypeLayer.typesetting> property. See typesetting for full API reference:

            for paragraph in layer.typesetting:
                print(paragraph.style.justification)
                for run in paragraph:
                    print(run.text, run.style.font_name, run.style.font_size)

ShapeLayer <#psd_tools.api.layers.ShapeLayer> draws a vector shape, and the shape information is stored in vector_mask and origination property. Other layers can also have shape information as a mask:

            print(layer.vector_mask)
            for shape in layer.origination:
                print(shape)

SmartObjectLayer <#psd_tools.api.layers.SmartObjectLayer> embeds or links an external file for non-destructive editing. The file content is accessible via smart_object property:

            import io
            so = layer.smart_object
            if so.detected_filetype in ('jpg', 'png'):
                # Use open(external_dir=...) when processing untrusted PSD files.
                with so.open() as f:
                    image = Image.open(io.BytesIO(f.read()))

SolidColorFill <#psd_tools.api.adjustments.SolidColorFill>, PatternFill <#psd_tools.api.adjustments.PatternFill>, and GradientFill <#psd_tools.api.adjustments.GradientFill> are fill layers that paint the entire region if there is no associated mask. Sub-classes of AdjustmentLayer represents layer adjustment applied to the composed image. See Adjustment layers <#adjustment-layers>.

  Modifying the layer structure

The layer structure of a PSD object can be modified through methods emulating a python list.

The internal model of the psd layer structure will be automatically updated. Moving a layer from a PSD to another will also automatically convert the PixelLayer to the target psd's color mode.

The follwing are valid for both PSDImage and Group objects.

Set an item:

            group[0] = layer

Add a layer or layers to a group:

            group.append(layer)
            group.extend(layers)

Insert a layer to a specific index in the group:

            group.insert(3, layer)

Remove a layer from the a group:

            group.remove(layer)

Pop a layer from the group:

            layer = group.pop()

Emptying a layer group:

            group.clear()

Get the index of a layer in the group:

            index = group.index(layer)

Count the occurrences of a layer in a group:

            count = group.count(layer)

Move a given list of layers in a newly created Group. If no parent group is given in parameter, the new group will replace the first layer of the list in the PSD structure:

            group = psdimage.create_group(layer_list=[layer1, layer2, ...], name="New Group")

Some operations are available for all Layer objects.

Delete a layer from its layer structure:

            group.remove(layer)

Layers can be moved from a group to another:

            target_group.append(layer)

Layers can be moved within the group to change their order:

            layer.move_up() # Will send the layer upward in the group
            layer.move_down() # Will send the layer downward in the group

  Exporting data to PIL

Export the entire document as PIL.Image:

            image = psd.composite()
            image.save('exported.png')

Export a single layer including masks and clipping layers:

            image = layer.composite()

Export layer and mask separately without composition:

            image = layer.topil()
            mask = layer.mask.topil()

To composite specific layers, such as layers except for texts, use layer_filter option:

            image = psd.composite(
                layer_filter=lambda layer: layer.is_visible() and layer.kind != 'type')

Note:
        Advanced compositing features require optional dependencies. Install with:

                    pip install psd-tools[composite]

        These dependencies (aggdraw, scipy, scikit-image) are needed for:

            •   Vector shapes and strokes

            •   Gradient and pattern fills

            •   Layer effects

        Basic compositing works without them by using cached previews or simple pixel-based operations. If a feature requires missing dependencies, an ImportError with installation instructions will be raised.

        Note that most layer effects are not supported. Adjustment layers have limited support (BrightnessContrast, Levels, Curves, Exposure, Invert, Posterize, Threshold). The compositing result may look different from Photoshop.

  Exporting data to NumPy

PSDImage or layers can be exported to NumPy array by numpy() method:

            image = psd.numpy()
            layer_image = layer.numpy()

  Migration Guide

  v1.12

psd-tools 1.12 makes composite dependencies optional to support more platforms and Python versions.

  Breaking Change: Optional Composite Dependencies

The main breaking change in version 1.12 is that advanced compositing features now require optional dependencies that must be explicitly installed.

What changed:

    •   Dependencies aggdraw, scipy, and scikit-image are now optional

    •   Basic compositing with NumPy continues to work without these dependencies

    •   Advanced features (vector masks, gradients, patterns, effects) require the composite extra

Migration steps:

If you use advanced compositing features, install with the composite extra:

            pip install 'psd-tools[composite]'

Or install the dependencies separately:

            pip install psd-tools aggdraw scipy scikit-image

What works without composite dependencies:

    •   Reading and writing PSD files

    •   Accessing layer information (names, dimensions, etc.)

    •   Extracting raw pixel data with NumPy

    •   Basic pixel layer compositing

    •   Using cached layer previews

What requires composite dependencies:

    •   Vector shape and stroke rendering

    •   Gradient fills

    •   Pattern fills

    •   Layer effects rendering (drop shadows, strokes, etc.)

Error handling:

If you try to use advanced features without the dependencies installed, you'll see a clear error:

            ImportError: Advanced compositing features require optional dependencies.
            Install with: pip install 'psd-tools[composite]'

Why this change:

This change enables psd-tools to run on platforms where some composite dependencies are unavailable, particularly Python 3.14 on Windows where aggdraw is not yet available.

  Module Structure Changes

Version 1.12 includes some internal refactoring that generally doesn't affect public APIs:

    •   The PSD class moved from psd_tools.psd to psd_tools.psd.document (still importable from psd_tools.psd)

    •   Utils module split into registry and bin_utils (internal change)

    •   Composite module reorganized for better type safety (internal change)

These changes maintain backward compatibility for public imports.

  Type Annotations

Version 1.12 adds comprehensive type annotations throughout the codebase. If you use type checkers like mypy, you may discover type errors in your code that were previously undetected. This is a good thing - the annotations help catch bugs earlier!

  v1.11

psd-tools 1.11 introduces stronger type-safety via annotation and new public APIs for layer creation. Now the following approach is possible to create a new layered document:

            from PIL import Image
            from psd_tools import PSDImage

            image = Image.new("RGBA", (width, height))
            psdimage = PSDImage.new(mode='RGB', size=(640, 480), depth=8)
            layer = psdimage.create_pixel_layer(image, name="Layer 1", top=0, left=0, opacity=255)
            psdimage.save('new_image.psd')

Version 1.11 introduces some breaking changes.

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

version 1.11.x:

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

version 1.10.x:

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

The same layer cannot be shared between multiple container objects.

version 1.11.x:

            layer = psdimage.create_pixel_layer(group, image)
            psdimage.append(layer)  # This won't duplicate the layer.

  v1.10

psd-tools 1.10 has a few breaking changes.

Basic layer structure editing is supported in 1.10. You can add or remove a pixel layer, or change the grouping of layers.

psd-tools 1.10 drops compose module. Use composite instead.

version 1.10.x:

            image = psd.composite()
            layer_image = layer.composite()

  v1.9

psd-tools 1.9 switches to NumPy based compositing.

version 1.8.x:

            psd = PSDImage.open(filename)
            image = psd.compose()
            layer = psd[0]
            layer_image = layer.compose()

version 1.9.x:

            psd = PSDImage.open(filename)
            image = psd.composite()
            layer = psd[0]
            layer_image = layer.composite()

NumPy array API is introduced:

            image = psd.numpy()
            layer_image = layer.numpy()

  v1.8

There are major API changes in version 1.8.x.

Note:
        In version 1.8.0 - 1.8.7, the package name was psd_tools2.

  PSDImage

File open method is changed from load to open() <#psd_tools.PSDImage.open>.

version 1.7.x:

            psd = PSDImage.load(filename)
            with open(filename, 'rb') as f:
                psd = PSDImage.from_stream(f)

version 1.8.x:

            psd = PSDImage.open(filename)
            with open(filename, 'rb') as f:
                psd = PSDImage.open(f)

  Layers

Children of PSDImage or Group is directly accessible by iterator or indexing.

version 1.7.x:

            for layer in group.layers:
                print(layer)

            first_child = group.layers[0]

version 1.8.x:

            for layer in group:
                print(layer)

            first_child = group[0]

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.

  PIL export

Primary PIL export method is compose().

version 1.7.x:

            image = psd.as_PIL()

            layer_image = compose(layer)
            raw_layer_image = layer.as_PIL()

version 1.8.x:

            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. See psd_tools.psd <#module-psd_tools.psd> subpackage.

version 1.7.x:

            psd.decoded_data

version 1.8.x:

            psd._record

  Drop pymaging support

Pymaging support is dropped.

  Changelog

  1.17.4 (2026-06-24)

    •   [security] Guard against oversized memory allocation from failed channel decompression (CWE-789, related to GHSA-8q6g-vjhf-jp8m)

    •   [api] Add max_alloc_bytes parameter to PSDImage.open() for an opt-in per-document allocation budget cap

  1.17.3 (2026-06-22)

    •   [security] Guard against uncontrolled memory allocation via crafted PSD canvas dimensions (GHSA-8q6g-vjhf-jp8m, #676)

    •   [fix] Fix VirtualMemoryArray dimension computation for patterns (#672)

    •   [fix] Fix smart object blank filetype field handling (#663)

    •   [chore] Bump ruff to 0.15.18, pytest to 9.1.1, actions/checkout to v7

  1.17.2 (2026-06-04)

    •   [fix] Disable Limited API for Windows Cython extension (#661)

    •   [chore] Bump ruff from 0.15.14 to 0.15.15 (#659)

  1.17.1 (2026-05-27)

    •   [security] Fix path traversal in SmartObject.save() and open() (GHSA-2rmg-vrx8-9j2f, #657)

    •   [chore] Bump ruff to 0.15.14, mypy to 2.1.0

  1.17.0 (2026-05-11)

    •   [composite] Add Hue/Saturation adjustment layer composite algorithm (#646)

    •   [fix] Fix float32 safety in Hue/Saturation composite algorithm (#646)

    •   [refactor] Use IO[bytes] instead of BinaryIO throughout the codebase (#647)

    •   [fix] Fix mypy 2.0 strict-bytes errors in rle.py

    •   [ci] Migrate pre-commit hooks to uv-local runners; expand ruff and mypy scope (#650)

    •   [chore] Bump mypy to 2.0.0, ruff to 0.15.12, pre-commit to 4.6.0

  1.16.0 (2026-04-24)

    •   [composite] Add adjustment layer compositing support and fix pass-through compositing logic (#628)

    •   [fix] Fix fallback logic and density computation for user masks

    •   [refactor] Refactor composite subpackage for type safety and stability (#640)

    •   [docs] Update README and usage docs to reflect adjustment layer compositing support

    •   [chore] Bump ruff to 0.15.11, mypy to 1.20.1

  1.15.0.post1 (2026-04-14)

    •   [ci] Fix release packaging: version.py was not bumped in the v1.15.0 release PR, causing wheels to be built with the wrong version

  1.15.0 (2026-04-14)

    •   [api] Add layer_sized option to Mask.topil() for correct rendering of inverted masks (#622, fixes #389)

    •   [fix] Graceful fallback for zero-length channel data (#621, fixes #398)

    •   [fix] Make artboard background color color-mode aware (#620, fixes #395)

    •   [fix] Normalize color space in composite paint to fix mixed-colorspace stroke error (#618, fixes #397)

    •   [fix] Compute VectorMask.bbox from full Bézier curve extent, not just anchors (#613)

    •   [refactor] Extract color conversion math into psd_tools.color_convert module (#630)

    •   [docs] Fix misleading ImageResource signature docstring (#624, fixes #375)

    •   [ci] Add Python 3.14 free-threaded (cp314t) wheel support (#633)

    •   [ci] Automate release tagging via pull_request closed event (#611)

    •   [ci] Add stale issue/PR workflow (#615)

    •   [chore] Bump pytest to 9.0.3, ruff to 0.15.10, actions/checkout to v6 (#625, #626, #627)

  1.14.3 (2026-04-10)

    •   [security] Upgrade Pygments to 2.20.0 to resolve ReDoS vulnerability (#609)

    •   [fix] Don't add USER_LAYER_MASK when PSD mode already carries transparency (#608)

    •   [chore] Bump Pillow from 12.1.1 to 12.2.0, mypy to 1.20.0, ruff to 0.15.9

  1.14.2 (2026-03-19)

    •   [fix] Detect transparency from negative layer_count in preview path (#595)

  1.14.1 (2026-03-17)

    •   [fix] Preserve alpha channel when compositing from layers (#593, fixes #592)

    •   [chore] Bump ruff from 0.15.4 to 0.15.6, pypa/cibuildwheel from 3.3.1 to 3.4.0

  1.14.0 (2026-03-03)

    •   [api] Add PSDImage.background_color property for reading and writing document background color (#586)

    •   [api] Add high-level typesetting API for TypeLayer text manipulation (#579)

    •   [fix] Update contributing link from master to main branch (#580)

    •   [chore] Bump sphinx-rtd-theme from 3.0.2 to 3.1.0, ruff from 0.15.2 to 0.15.4

    •   [ci] Bump actions/upload-artifact from 6 to 7, actions/download-artifact from 7 to 8

  1.13.1 (2026-02-27)

    •   [psd] Fix TransferFunction curve values parsed as unsigned instead of signed shorts (#577)

    •   [psd] Handle truncated MaskParameters data gracefully (#574, fixes #573)

    •   [refactor] Drop Python <3.11 typing compatibility guards (#575)

    •   [docs] Improve mask module documentation and index layout (#576)

  1.13.0 (2026-02-26)

    •   [api] Add Layer.sheet_color property for reading and writing Photoshop layer color labels (#546)

    •   [api] Add Layer.create_mask(), remove_mask(), and update_mask() for pixel mask CRUD operations (#568)

    •   [api] Auto-create layer masks from alpha channel in PixelLayer.frompil() (#568)

    •   [api] Add Mask.disabled setter for toggling layer mask visibility (#568)

  1.12.2 (2026-02-24)

    •   [api] Fix bbox to exclude clipping layers by default; add include_clipping parameter to Group.extract_bbox() (#566, fixes #547)

    •   [api] Fix UTF-16 surrogate pair handling for emoji in text layers (#551)

    •   [security] Fix compression security issues (GHSA-24p2-j2jr-386w) (#549)

    •   [ci] Fix least-privilege permissions in CI workflows (#550)

    •   [ci] Add pre-commit hooks for linting, formatting, and type checking (#552)

    •   [ci] Add Dependabot configuration for automated dependency updates (#555)

    •   [dev] Extend mypy and ruff coverage to the tests directory (#554)

    •   [docs] Clean up developer setup documentation (#553)

    •   [chore] Bump Pillow from 11.3.0 to 12.1.1 (#563)

    •   [chore] Bump attrs, ipykernel, mypy, pytest, and various GitHub Actions

  1.12.1 (2025-12-05)

    •   [api] Fix preview image mode when saving PSD files (#542)

    •   [packaging] Upgrade aggdraw to >=1.4.1 for Python 3.14 Windows support (#543)

  1.12.0 (2025-11-17)

    •   [packaging] Make composite dependencies optional via psd-tools[composite] extra (#525)

    •   [api] Lazy-load advanced composite features (vector masks, gradients, effects) to avoid importing optional dependencies unless needed

    •   [api] Basic numpy-based compositing works without scipy, scikit-image, or aggdraw

    •   [api] Composite functionality raises ImportError with installation instructions only when advanced features are used

    •   [api] Handle missing composite dependencies gracefully in PSDImage.save() (#532)

    •   [packaging] Move aggdraw, scipy, and scikit-image to optional dependencies

    •   [packaging] Keep numpy as core dependency for raw pixel data access

    •   [refactor] Move PSD class to dedicated document module (#530)

    •   [refactor] Reorganize composite module structure and add type safety (#524)

    •   [refactor] Split utils module into registry and bin_utils (#537)

    •   [refactor] Create shared API utils module (#538)

    •   [refactor] Improve type annotations and standardize imports (#539)

    •   [api] Add comprehensive type annotations to psd_tools package (#536)

    •   [tests] Add comprehensive type annotations to test suite (#534, #535)

    •   [tests] Add CI testing without composite dependencies (#533)

    •   [docs] Enhance package and module docstrings with comprehensive documentation (#531)

    •   [docs] Update installation instructions for optional composite support (#527)

    •   [docs] Convert README to Markdown (#527)

    •   [ci] Fix CI status badge in README (#523)

    •   [ci] Fix ReadTheDocs build by adding Self import fallback

    •   [ci] Fix Python 3.10 mypy compatibility (#526)

    •   [chore] Remove unused deprecated decorator (#529)

    •   [chore] Remove redundant MANIFEST.in file (#528)

Breaking change: Users who rely on advanced composite features (vector masks, gradient fills, pattern fills, stroke effects) must now install with pip install 'psd-tools[composite]' or install the optional dependencies separately. Basic pixel layer compositing continues to work with just numpy. This change enables support for Python 3.14 on Windows and other platforms where composite dependencies may not be available.

  1.11.1 (2025-11-17)

    •   [ci] Disable Python 3.14 on Windows due to aggdraw unavailability (#521)

  1.11.0 (2025-11-09)

    •   [api] Add public APIs for layer and group creation (#517)

    •   [api] Type safety improvements (#516)

    •   [api] Refactor psd_tools.api import dependencies (#515)

    •   [api] Fix group blend mode returning None (#514)

    •   [dev] Add Claude Code support (#511)

    •   [api] Add type annotation to more APIs (#509, #510, #512)

    •   [api] Add fill_opacity and reference_point attributes (#507, #508)

    •   [psd] Improve pretty print of Subpath (#506)

  1.10.13 (2025-10-02)

    •   [docs] Fix incorrect method name in the usage (#504)

    •   [api] Fix updated status flag (#503)

    •   [api] Add tree traversal API (#502)

    •   [psd] Fix crash when reading malformed Levels record (#501)

  1.10.12 (2025-09-25)

    •   [api] Drop docopt dependency (#498)

    •   [api] Remove unused imports (#497)

    •   [api] Fix stacked clip layer handling (#496)

  1.10.11 (2025-09-24)

    •   [tests] Drop python2 compatibility code (#494)

    •   [api] Fix clip layer handling (#493)

    •   [psd] Workaround CAI tagged block reconstruction (#492)

  1.10.10 (2025-09-18)

    •   [api] Fix clipping with stroke composite (#489)

    •   [ci] Fix documentation build (#486, #487)

    •   [ci] Introduce ABI3 wheels (#483, #485)

    •   [api] Fix PyCMSError in composite (#484)

    •   [api] Fix ImageMath deprecation warning (#482)

  1.10.9 (2025-08-07)

    •   [psd] Allow linked layer version 8 (#476)

  1.10.8 (2025-06-06)

    •   [ci] Update CI configuration (#471)

    •   [psd] Workaround levels adjustment layer parsing (#470)

    •   [psd] Support CAI, GenI, OCIO tagged blocks (#469)

  1.10.7 (2025-02-25)

    •   [psd] Fix missing gradient method (#465)

  1.10.6 (2025-02-18)

    •   [security] Update pillow dependency (#462)

  1.10.5 (2025-02-18)

    •   [security] Update pillow dependency (#461)

  1.10.4 (2024-11-25)

    •   [api] Allow Path objects for PSDImage open (#452)

  1.10.3 (2024-11-20)

    •   [psd] Fix data corruption by irregular OSType (#449)

    •   [api] Add type annotation to the high-level APIs (#448)

  1.10.2 (2024-10-23)

    •   [api] Add channel info via DisplayInfo (#443)

    •   [api] Support layer locking (#442)

  1.10.1 (2024-10-10)

    •   [api] Fix artboard creation (#438)

    •   [api] Fix layer conversion issue (#435)

  1.10.0 (2024-09-26)

    •   [api] Support basic layer structure editing (#428)

    •   [api] Drop deprecated compose module (#432)

  1.9.34 (2024-07-01)

    •   [api] Support text type property (#419)

    •   [psd] Improve RLE decoding error handling (#417)

  1.9.33 (2024-06-14)

    •   [psd] Raise IO error instead of assertion (#413)

    •   [api] Add a new property to SmartObject: transform_box (#412)

    •   [ci] Migrate code formatter to ruff (#408)

  1.9.32 (2024-05-01)

    •   [psd] Fix incorrect group divider handling (#399)

  1.9.31 (2024-02-26)

    •   [psd] Reworked packbits/rle algorithms (#392)

  1.9.30 (2024-01-06)

    •   [ci] Fix missing pyx file in sdist (#386)

  1.9.29 (2024-01-04)

    •   [ci] Update CI configuration (#383)

    •   [dev] Migrate the builder to pyproject.toml

    •   [dev] Update linter and formatter to pysen

    •   [dev] Deprecate tox

    •   [psd] Add new color sheet (#380)

    •   [psd] Fix transparency check (#370)

  1.9.28 (2023-07-04)

    •   [psd] Add alternate 8ELE signiture for 8BIM tagged block (#367)

  1.9.27 (2023-06-27)

    •   [composite] Fix regression by #361 (#364)

  1.9.26 (2023-06-21)

    •   [composite] Read HSB colors in RGB and CMYK color modes (#361)

    •   [ci] Update CI configuration (#362)

  1.9.25 (2023-06-19)

    •   [composite] Fix hue, sat, and vivid light (#359)

  1.9.24 (2023-01-17)

    •   [psd] Support float RGB values (#350)

    •   [psd] Workaround stroke class ID (#346)

    •   [ci] Update CI configuration (#347)

    •   [composite] Fix group clipping (#336)

  1.9.23 (2022-09-26)

    •   [api] Add bbox invalidation when toggling layer visibility (#334)

  1.9.22 (2022-09-09)

    •   [psd] Add support for v3 gradient map adjustment layer (#330)

  1.9.21 (2022-06-18)

    •   [api] Fix incorrect has_effects behavior (#322)

    •   [composite] Improve blending numerical stability (#321)

    •   [composite] Improve non-RGB modes and transparency (#319, @Etienne-Gautier)

    •   [psd] Workaround assertion error in broken file (#320)

  1.9.20 (2022-05-16)

    •   [ci] Update CI configuration (#313 #314)

    •   [composite] Fix composite errors (#312)

    •   [psd] Suppress vowv tagged blocks (#306)

  1.9.19 (2022-04-15)

    •   [composite] Fix rasterized shape composite (#301 #302)

  1.9.18 (2021-08-20)

    •   [api] Fix missing effect attributes (#284)

    •   [package] Support additional platforms (i686, aarch64, universal2, win32)

    •   [package] Drop py36 support

  1.9.17 (2021-01-15)

    •   [api] Fix incorrect fill layer parse (fix #254)

  1.9.16 (2020-09-24)

    •   [package] Drop py27 and py35 support

    •   [psd] Workaround Enum bug (fix #241)

    •   [composite] Fix transparency issue (fix #242)

    •   [composite] Fix mask disable flag (fix #243)

    •   [api] Add workaround for creating PSB (fix #246)

    •   [api] Fix incorrect adjustment parse (fix #247)

  1.9.15 (2020-07-17)

    •   [composite] Fix ignored clip layers for groups.

    •   [composite] Fix out-of-viewport stroke effect.

  1.9.14 (2020-07-10)

    •   [api] Bugfix for PSDImage composite layer_filter option.

    •   [api] Bugfix for transparency and alpha distinction.

    •   [psd] Rename COMPOSITOR_INFO.

    •   [composite] Fix stroke effect target shape.

  1.9.13 (2020-05-25)

    •   [api] Bugfix for PSDImage init internal.

  1.9.12 (2020-05-20)

    •   [psd] Bugfix for CurvesExtraMarker read.

  1.9.11 (2020-05-01)

    •   [composite] Fix layer check.

  1.9.10 (2020-04-21)

    •   [psd] Fix engine data parser.

  1.9.9 (2020-03-30)

    •   [composite] Fix stroke effect argument.

  1.9.8 (2020-03-18)

    •   [composite] Fix incorrect fill opacity handling in compositing.

    •   [composite] Fix incorrect alpha for patterns.

  1.9.7 (2020-03-17)

    •   [composite] Fix path operation for merged components.

    •   [composite] Fix vector mask compositing condition.

  1.9.6 (2020-03-16)

    •   [composite] Fix incorrect alpha channel handling in composite.

  1.9.5 (2020-03-11)

    •   [api] Add ignore_preview option to PSDImage.composite.

    •   [composite] Improve stroke effect composition for vector masks.

    •   [composite] Avoid crash when there is an erroneous subpath.

    •   [composite] Workaround possible divide-by-zero warn in stroke composition.

    •   [composite] Fix incorrect pattern transparency handling.

    •   [composite] Fix ignored effects in direct group composition.

    •   [composite] Fix incorrect opacity handling for clip layers.

  1.9.4 (2020-03-11)

    •   [compression] Security fix, affected versions are 1.8.37 - 1.9.3.

  1.9.3 (2020-03-10)

    •   [composite] Fix memory corruption crash for pattern data in PSB files.

    •   [psd] Add image data pretty printing.

  1.9.2 (2020-03-03)

    •   [psd] Add missing resource ID.

    •   [psd] Fix pretty printing regression.

    •   [psd] Fix big tag key for linked layers.

    •   [psd] Support frgb tag.

    •   [psd] Support sgrp metadata key.

    •   [psd] Support patt tag.

    •   [psd] Workaround unknown engine data.

  1.9.1 (2020-02-28)

    •   [psd] Minor bugfix.

  1.9.0 (2020-02-26)

    •   [composite] Implement NumPy-based compositing functionality.

    •   [composite] Support blending modes other than dissolve.

    •   [composite] Support blending in RGB, CMYK, Grayscale.

    •   [api] Introduce NumPy array export method.

    •   [api] Drop deprecated methods from v1.7.x such as as_PIL.

    •   [api] Deprecate compose method.

    •   [compression] Rename packbits to rle.

    •   [compression] Improve RLE decode efficiency.

    •   [tests] Additional compositing tests.

  1.8.38 (2020-02-12)

    •   [composer] fix crash when gradient fill is in stroke.

  1.8.37 (2020-02-07)

    •   [compression] Remove packbits dependency and introduce cython implementation.

    •   [deploy] Move CI provider from Travis-CI to Github Actions.

    •   [deploy] Start distributing binary wheels.

  1.8.36 (2019-12-26)

    •   [psd] add safeguard for malformed global layer mask info parser.

  1.8.35 (2019-12-26)

    •   [api] remove duplicate has_mask() definition.

    •   [composer] fix empty effects check.

  1.8.34 (2019-11-28)

    •   [api] fix compose() arguments.

    •   [psd] fix attrs version dependency.

  1.8.33 (2019-11-28)

    •   [api] add include_invisible option to Group.extract_bbox.

    •   [psd] fix deprecated attrs api.

  1.8.32 (2019-11-28)

    •   [psd] fix 16/32 bit file parsing bug introduced in 1.8.17.

  1.8.31 (2019-11-27)

    •   [psd] bugfix reading psb.

    •   [psd] bugfix reading slices resource.

    •   [security] update dependency to pillow >= 6.2.0.

  1.8.30 (2019-09-24)

    •   [psd] workaround for reading less-than-4-byte int in malformed psd files.

  1.8.29 (2019-09-10)

    •   [composer] fix vector mask bbox in composition.

  1.8.28 (2019-09-09)

    •   [api] fix Effects.__repr__() when data is empty.

  1.8.27 (2019-08-29)

    •   [api] accept encoding param in PSDImage.open and PSDImage.save.

    •   [deploy] bugfix travis deployment condition.

  1.8.26 (2019-08-28)

    •   [composer] support group mask.

  1.8.25 (2019-08-07)

    •   [api] change return type of PSDImage.color_mode to enum.

    •   [api] support reading of bitmap color mode.

    •   [api] support channel option in topil() method.

  1.8.24 (2019-07-25)

    •   [composer] experimental support of commutative blending modes.

  1.8.23 (2019-06-24)

    •   [composer] fix clipping on alpha-less image;

    •   [composer] fix stroke effect for flat plane;

    •   [composer] workaround for insufficient knots;

    •   [composer] fix for custom color space.

  1.8.22 (2019-06-19)

    •   fix pass-through composing bug;

    •   fix alpha blending in effect;

    •   fix vector mask composition;

    •   experimental support for shape stroke;

    •   experimental support for stroke effect.

  1.8.21 (2019-06-18)

    •   change effect property return type from str to enum;

    •   improve gradient quality;

    •   support fill opacity and layer opacity;

    •   add tmln key in metadata setting.

  1.8.20 (2019-06-13)

    •   support gradient styles.

  1.8.19 (2019-06-11)

    •   fix broken psd_tools.composer.vector module in 1.8.17;

    •   experimental support for color noise gradient;

    •   bugfix for clip masks;

    •   bugfix for CMYK composing.

  1.8.17 (2019-06-05)

    •   move psd_tools.api.composer module to psd_tools.composer package;

    •   support 19 blending modes in composer;

    •   support fill opacity;

    •   fix image size when composing with masks;

    •   rename TaggedBlockID to Tag;

    •   rename ImageResourceID to Resource;

    •   add bytes mixin to Enum constants;

    •   replace Enum keys with raw values in psd_tools.psd.base.Dict classes.

  1.8.16 (2019-05-24)

    •   fix broken group compose in 1.8.15;

    •   fix missing pattern / gradient composition in vector stroke content.

  1.8.15 (2019-05-23)

    •   coding style fix;

    •   fix compose() bbox option.

  1.8.14 (2019-04-12)

    •   add dependency to aggdraw;

    •   support bezier curves in vector masks;

    •   support path operations;

    •   fix compose(force=True) behavior;

    •   fix default background color in composer;

    •   improve pattern overlay parameters support;

    •   fix gradient map generation for a single stop.

  1.8.13 (2019-04-05)

    •   fix engine_data unknown tag format;

    •   fix compose for extra alpha channels;

    •   workaround for pillow 6.0.0 bug.

  1.8.12 (2019-03-25)

    •   add apply_icc option in pil io.

  1.8.11 (2019-03-14)

    •   introduce terminology module;

    •   reduce memory use in read;

    •   add main testing.

  1.8.10 (2019-02-27)

    •   fix PSB extn key size bug.

  1.8.9 (2019-02-21)

    •   documentation updates;

    •   introduce Artboard class.

  1.8.8 (2019-02-20)

    •   revert package name to psd_tools;

    •   prepare merging to the main repo.

  1.8.7 (2019-02-15)

    •   minor bugfix.

  1.8.6 (2019-02-14)

    •   change _psd pointer in PSDImage;

    •   add version property;

    •   support fill effects in composer.

  1.8.5 (2019-02-05)

    •   change tagged block/image resource singleton accessor in user API;

    •   add documentation on iterator order;

    •   fix export setting 1 big key config;

    •   fix computer info big key config.

  1.8.3 (2019-02-01)

    •   add channel size checking in topil;

    •   add mlst metadata decoding;

    •   fix key collision issue in descriptor;

    •   performance improvement for packbit encoding/decoding;

    •   drop cython dependency in travis config;

    •   implement thumbnail, is_group, and parent methods in PSDImage.

  1.8.0 (2019-01-24)

    •   major API changes;

    •   package name changed to psd_tools2;

    •   completely rewritten decoding subpackage psd_tools2.psd;

    •   improved composer functionality;

    •   file write support;

    •   drop cython compression module and makes the package pure-python;

    •   drop pymaging support.

  1.7.30 (2019-01-15)

    •   composer alpha blending fix;

    •   documentation fix.

  1.7.28 (2019-01-09)

    •   support cinf tagged block.

  1.7.27 (2018-12-06)

    •   add missing extra image resource block signatures.

  1.7.26 (2018-12-03)

    •   move psd_tools tests under tests/psd_tools.

  1.7.25 (2018-11-27)

    •   fix alpha channel visibility of composed image.

  1.7.24 (2018-11-21)

    •   fix unit rectangle drawing size.

  1.7.23 (2018-11-20)

    •   fix ignored visibility in bbox calculation.

  1.7.22 (2018-10-12)

    •   drop py34 support;

    •   fix tobytes deprecation warning.

  1.7.21 (2018-10-10)

    •   fix gradient descriptor bug.

  1.7.20 (2018-10-09)

    •   fix coloroverlay bug;

    •   fix gradient angle bug;

    •   fix curves decoder bug.

  1.7.19 (2018-10-02)

    •   fix descriptor decoder.

  1.7.18 (2018-09-26)

    •   add shape rendering in compose();

    •   add grayscale support.

  1.7.17 (2018-09-21)

    •   fix has_pixel() condition.

  1.7.16 (2018-08-29)

    •   fix fill opacity in compose();

    •   workaround for broken PrintFlags.

  1.7.15 (2018-08-28)

    •   fix color overlay issue in compose().

  1.7.14 (2018-08-24)

    •   fix verbose arg for python 3.7 compatibility.

  1.7.13 (2018-08-10)

    •   fix has_pixel() for partial channels;

    •   support color overlay in compose().

  1.7.12 (2018-06-25)

    •   fix mask rendering in compose (Thanks @andrey-hider and @nkato).

  1.7.11 (2018-06-11)

    •   unicode bugfixes.

  1.7.10 (2018-06-06)

    •   fix descriptor decoding errors;

    •   minor bugfixes.

  1.7.9 (2018-06-05)

    •   fix UnicodeError in exif;

    •   workaround for irregular descriptor name;

    •   add undocumented extn tagged block decoding;

    •   move duplicated icc module to subpackage;

    •   support PIL rendering with extra alpha channels.

  1.7.8 (2018-05-29)

    •   update documentation;

    •   fix PEP8 compliance;

    •   rename merge_layers to compose.

  1.7.7 (2018-05-02)

    •   fix white background issue in as_PIL().

  1.7.6 (2018-04-27)

    •   add quality testing;

    •   fix disabled mask.

  1.7.5 (2018-04-25)

    •   fix has_mask() condition;

    •   add mask composition in merge_layers();

    •   fix mask display.

  1.7.4 (2018-03-06)

    •   fix infinity loop in print_tree().

  1.7.3 (2018-02-27)

    •   add vector origination API;

    •   fix shape and vector mask identification;

    •   change enum name conversion;

    •   update docs.

  1.7.2 (2018-02-14)

    •   add adjustments API;

    •   add mask API;

    •   bugfix for tagged_blocks decoders.

  1.7.1 (2018-02-08)

    •   add mask user API;

    •   add layer coordinate user API;

    •   add vector mask and vector stroke API;

    •   cleanup user API;

    •   add automatic descriptor conversion.

  1.7.0 (2018-01-25)

    •   cleanup user API organization;

    •   remove json encoder api;

    •   make cli a package main.

  1.6.7 (2018-01-17)

    •   workaround for anaconda 2.7 pillow;

    •   bbox existence checkf.

  1.6.6 (2018-01-10)

    •   experimental clipping support in merge_layer();

    •   revert as_PIL() in AdjustmentLayer.

  1.6.5 (2017-12-22)

    •   Small fix for erroneous unicode path name

  1.6.4 (2017-12-20)

    •   Add all_layers() method;

    •   Add _image_resource_blocks property;

    •   Add thumbnail() method.

  1.6.3 (2017-09-27)

    •   documentation updates;

    •   github repository renamed to psd-tools2;

    •   AdjustmentLayer fix.

  1.6.2 (2017-09-13)

    •   layer class structure reorganization;

    •   add Effects API;

    •   add TypeLayer API methods.

  1.6 (2017-09-08)

    •   PSDImage user API update;

    •   user API adds distinct layer types;

    •   Sphinx documentation.

  1.5 (2017-07-13)

    •   implemented many decodings of image resources and tagged blocks;

    •   implemented EngineData text information;

    •   user API for getting mask and patterns;

    •   user API to calculate bbox for shape layers;

  1.4 (2017-01-02)

    •   Fixed reading of layer mask data (thanks Evgeny Kopylov);

    •   Python 2.6 support is dropped;

    •   Python 3.6 support is added (thanks Leendert Brouwer);

    •   extension is rebuilt with Cython 0.25.2.

  1.3 (2016-01-25)

    •   fixed references decoding (thanks Josh Drake);

    •   fixed PIL support for CMYK files (thanks Michael Wu);

    •   optional C extension is rebuilt with Cython 0.23.4;

    •   Python 3.2 support is dropped; the package still works in Python 3.2, but the compatibility is no longer checked by tests, and so it can break in future.

    •   declare Python 3.5 as supported.

  1.2 (2015-01-27)

    •   implemented extraction of embedded files (embedded smart objects) - thanks Volker Braun;

    •   optional C extension is rebuilt with Cython 0.21.2.

    •   hg mirror on bitbucket is dropped, sorry!

  1.1 (2014-11-17)

    •   improved METADATA_SETTING decoding (thanks Evgeny Kopylov);

    •   layer comps decoding (thanks Evgeny Kopylov);

    •   improved smart objects decoding (thanks Joey Gentry);

    •   user API for getting layer transforms and placed layer size (thanks Joey Gentry);

    •   IPython import is deferred to speedup psd-tools.py command-line utility;

    •   _RootGroup.__repr__ is fixed;

    •   warning message building is more robust;

    •   optional C extension is rebuilt with Cython 0.21.1.

  1.0 (2014-07-24)

    •   Fixed reading of images with layer masks (thanks Evgeny Kopylov);

    •   improved mask data decoding (thanks Evgeny Kopylov);

    •   fixed synchronization in case of 8B64 signatures (thanks Evgeny Kopylov);

    •   fixed reading of layers with zero length (thanks Evgeny Kopylov);

    •   fixed Descriptor parsing (thanks Evgeny Kopylov);

    •   some of the descriptor structures and tagged block constants are renamed (thanks Evgeny Kopylov);

    •   PATH_SELECTION_STATE decoding (thanks Evgeny Kopylov);

    •   the library is switched to setuptools; docopt is now installed automatically.

  0.10 (2014-06-15)

    •   Layer effects parsing (thanks Evgeny Kopylov);

    •   trailing null bytes are stripped from descriptor strings (thanks Evgeny Kopylov);

    •   "Reference" and "List" descriptor parsing is fixed (thanks Evgeny Kopylov);

    •   scalar descriptor values (doubles, floats, booleans) are now returned as scalars, not as lists of size 1 (thanks Evgeny Kopylov);

    •   fixed reading of EngineData past declared length (thanks Carlton P. Taylor);

    •   "background color" Image Resource parsing (thanks Evgeny Kopylov);

    •   psd_tools.decoder.actions.Enum.enum field is renamed to psd_tools.decoder.actions.Enum.value (thanks Evgeny Kopylov);

    •   code simplification - constants are now bytestrings as they should be (thanks Evgeny Kopylov);

    •   Python 3.4 is supported.

  0.9.1 (2014-03-26)

    •   Improved merging of transparent layers (thanks Vladimir Timofeev);

    •   fixed layer merging and bounding box calculations for empty layers (thanks Vladimir Timofeev);

    •   C extension is rebuilt with Cython 0.20.1.

  0.9 (2013-12-03)

    •   psd-tools.py command-line interface is changed, 'debug' command is added;

    •   pretty-printing of internal structures;

    •   pymaging support is fixed;

    •   allow 'MeSa' to be a signature for image resource blocks (thanks Alexey Buzanov);

    •   psd_tools.debug.debug_view utility function is fixed;

    •   Photoshop CC constants are added;

    •   Photoshop CC vector origination data is decoded;

    •   binary data is preserved if descriptor parsing fails;

    •   more verbose logging for PSD reader;

    •   channel data reader became more robust - now it doesn't read past declared channel length;

    •   psd-tools.py --version command is fixed;

    •   lsdk tagged blocks parsing: this fixes some issues with layer grouping (thanks Ivan Maradzhyiski for the bug report and the patch);

    •   CMYK images support is added (thanks Alexey Buzanov, Guillermo Rauch and <https://github.com/a-e-m> for the help);

    •   Grayscale images support is added (thanks <https://github.com/a-e-m>);

    •   LittleCMS is now optional (but it is still required to get proper colors).

  0.8.4 (2013-06-12)

    •   Point and Millimeter types are added to UnitFloatType (thanks Doug Ellwanger).

  0.8.3 (2013-06-01)

    •   Some issues with descriptor parsing are fixed (thanks Luke Petre).

  0.8.2 (2013-04-12)

    •   Python 2.x: reading data from file-like objects is fixed (thanks Pavel Zinovkin).

  0.8.1 (2013-03-02)

    •   Fixed parsing of layer groups without explicit OPEN_FOLDER mark;

    •   Cython extension is rebuilt with Cython 0.18.

  0.8 (2013-02-26)

    •   Descriptor parsing (thanks Oliver Zheng);

    •   text (as string) is extracted from text layers (thanks Oliver Zheng);

    •   improved support for optional building of Cython extension.

  0.7.1 (2012-12-27)

    •   Typo is fixed: LayerRecord.cilpping should be LayerRecord.clipping. Thanks Oliver Zheng.

  0.7 (2012-11-08)

    •   Highly experimental: basic layer merging is implemented (e.g. it is now possible to export layer group to a PIL image);

    •   Layer.visible no longer takes group visibility in account;

    •   Layer.visible_global is the old Layer.visible;

    •   psd_tools.user_api.combined_bbox made public;

    •   Layer.width and Layer.height are removed (use layer.bbox.width and layer.bbox.height instead);

    •   pil_support.composite_image_to_PIL is renamed to pil_support.extract_composite_image and pil_support.layer_to_PIL is renamed to pil_support.extract_layer_image in order to have the same API for pil_support and pymaging_support.

  0.6 (2012-11-06)

    •   psd.composite_image() is renamed to psd.as_PIL();

    •   Pymaging support: psd.as_pymaging() and layer.as_pymaging() methods.

  0.5 (2012-11-05)

    •   Support for zip and zip-with-prediction compression methods is added;

    •   support for 16/32bit layers is added;

    •   optional Cython extension for faster zip-with-prediction decompression;

    •   other speed improvements.

  0.2 (2012-11-04)

    •   Initial support for 16bit and 32bit PSD files: psd-tools v0.2 can read composite (merged) images for such files and extract information (names, dimensions, hierarchy, etc.) about layers and groups of 16/32bit PSD; extracting image data for distinct layers in 16/32bit PSD files is not suported yet;

    •   better Layer.__repr__;

    •   bbox property for Group.

  0.1.4 (2012-11-01)

Packaging is fixed in this release.

  0.1.3 (2012-11-01)

    •   Better support for 32bit images (still incomplete);

    •   reader is able to handle "global" tagged layer info blocks that was previously discarded.

  0.1.2 (2012-10-30)

    •   warn about 32bit images;

    •   transparency support for composite images.

  0.1.1 (2012-10-29)

Initial release (v0.1 had packaging issues).

  Contributing

Development happens at github: bug tracker <https://github.com/psd-tools/psd-tools/issues>. Feel free to submit bug reports <https://github.com/psd-tools/psd-tools/issues/new> or pull requests. Attaching an erroneous PSD file makes the debugging process faster. Such PSD file might be added to the test suite.

The license is MIT.

  Package design

The package consists of four major subpackages:

    1.

        psd_tools.psd <#module-psd_tools.psd>: subpackage that reads/writes low-level binary
            structure of the PSD/PSB file. The core data structures are built around attrs <https://www.attrs.org/en/stable/index.html#> classes that all implement read and write methods. Each data object tries to resemble the structure described in the specification <https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/>. Although documented, the specification <https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/> is far from complete and some are even inaccurate. When psd-tools finds unknown data structure, the package keeps such data as bytes in the parsed result.

    2.

        psd_tools.api <#module-psd_tools.api>: User-facing API that implements various
            easy-to-use methods that manipulate low-level psd_tools.psd <#module-psd_tools.psd> data structures. This is the primary interface for most users.

    3.

        psd_tools.composite <#module-psd_tools.composite>: Rendering engine for layer compositing and
            blending. This subpackage implements blend modes, layer effects (drop shadows, strokes, etc.), and vector shape rasterization. It uses NumPy arrays for efficient pixel manipulation and includes optional dependencies (scipy, scikit-image, aggdraw) that must be installed via the composite extra.

    4.

        psd_tools.compression <#module-psd_tools.compression>: Image compression codecs for raw data,
            RLE (Run-Length Encoding), and ZIP compression. The RLE codec includes a Cython-optimized implementation (_rle.pyx) that falls back to pure Python if not compiled, providing significant performance improvements for large files.

In the future, it might be good to implement the Photoshop API <https://developer.adobe.com/photoshop/uxp/2022/ps_reference/> on top of the existing psd-tools API.

  Testing

In order to run tests, make sure PIL/Pillow is built with LittleCMS or LittleCMS2 support. For example, on Ubuntu, install the following packages:

            apt-get install liblcms2-dev libjpeg-dev libfreetype6-dev zlib1g-dev

Then install psd-tools with development dependencies:

            uv sync --group dev --extra composite

Finally, run tests:

            uv run pytest

  Documentation

Install documentation dependencies:

            uv sync --group docs

Once installed, use Makefile:

            make docs

  Release Process

Releases are automated via GitHub Actions. Only maintainers with appropriate repository permissions can trigger releases. The following repository secrets must be configured:

    •   RELEASE_WORKFLOW_TOKEN: a fine-grained PAT with contents: write, required so that the tag pushed by auto-tag.yml triggers the downstream release.yml workflow (the default GITHUB_TOKEN cannot do this).

    •   PYPI_USERNAME / PYPI_PASSWORD: PyPI credentials for publishing.

    1.  Decide the version number following PEP 440 <https://peps.python.org/pep-0440/> based on the changes since the last release. The auto-tag workflow recognises these forms:

        •   v1.2.3 — standard release

        •   v1.2.3a1, v1.2.3b1, v1.2.3rc1 — pre-releases (alpha, beta, release candidate)

        •   v1.2.3.post1 — post-release

    2.  Update the changelog: Review git log since the last tag and summarize changes in docs/changelog.rst under the new version heading.

    3.  Create a release PR: Create a branch named release/<version>, where <version> is one of the supported version forms listed above (e.g. release/v1.15.0, release/v1.15.0rc1, or release/v1.15.0.post1), commit the changelog update (and any version bumps), and open a PR against main. Merge it once approved. The branch name is how the auto-tag workflow identifies the version to tag.

    4.  Automated tagging and publishing: Merging the release PR triggers the auto-tag workflow, which tags the exact merge commit that landed on main (using merge_commit_sha) and pushes the tag. This in turn triggers the release workflow, which:

        •   Builds wheels for all supported platforms (Linux, Windows, macOS including ARM)

        •   Generates release notes from git commits since the previous tag

        •   Creates a GitHub release with the auto-generated changelog

        •   Publishes the package to PyPI

    5.  Verify the release:

        •   Check the Actions tab <https://github.com/psd-tools/psd-tools/actions> for workflow status

        •   Verify the release on GitHub <https://github.com/psd-tools/psd-tools/releases>

        •   Confirm the package is available on PyPI <https://pypi.org/project/psd-tools/>

  Acknowledgments

Great thanks to all the contributors <https://github.com/psd-tools/psd-tools/graphs/contributors>.

  psd_tools

See Usage <> for examples.

  PSDImage

    class psd_tools.PSDImage(data: PSD <#psd_tools.psd.PSD>)
        Photoshop PSD/PSB document.

        The low-level data structure is accessible at PSDImage._record.

        Example:

                from psd_tools import PSDImage

                psdimage = PSDImage.open('example.psd')
                image = psdimage.composite()

                for layer in psdimage:
                    layer_image = layer.composite()

        append(layer: Layer <#psd_tools.api.layers.Layer>) -> None
            Add a layer to the end (top) of the group.

            This operation rewrites the internal references of the layer. Adding the same layer will not create a duplicate.

            Parameters
                layer -- The layer to add.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        property background_color: float | tuple[float, ...] | None
            Background color for the merged composite image. Writable.

            When set, save() composites layers against an opaque backdrop of this color instead of a transparent one. This is useful for creating RGB-mode PSD files where transparent areas should appear as a specific color (e.g., white) in the merged composite.

            Values are in [0.0, 1.0] range, matching the composite() color parameter:

            •   RGB / Grayscale: 1.0 = white, 0.0 = black

            •   CMYK: (0.0, 0.0, 0.0, 0.0) = white (no ink)

        Use a scalar for uniform color or a tuple for per-channel values. Set to None for transparent backdrop (legacy behavior).

        Documents created via new() have this set automatically from the color parameter.

            Returns
                float, tuple[float, ...], or None

        Example:

                    psd = PSDImage.new('RGB', (640, 480), color=1.0)
                    psd.save('output.psd')  # White background, 3 channels (no alpha)

        property bbox: tuple[int, int, int, int]
            Minimal bounding box that contains all the visible layers.

            Use viewbox <#psd_tools.api.psd_image.PSDImage.viewbox> to get viewport bounding box. When the psd is empty, bbox is equal to the canvas bounding box.

            Returns
                (left, top, right, bottom) tuple.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property channels: int
            Number of color channels.

            Returns
                int

        clear() -> None
            Clears the group.

            This operation rewrites the internal references of the layers.

            Returns
                None

        property color_mode: ColorMode <#psd_tools.constants.ColorMode>
            Document color mode, such as 'RGB' or 'GRAYSCALE'. See ColorMode <#psd_tools.constants.ColorMode>.

            Returns
                ColorMode <#psd_tools.constants.ColorMode>

        property compatibility_mode: CompatibilityMode <#psd_tools.constants.CompatibilityMode>
            Set the compositing and layer organization compatibility mode. Writable.

            This property checks whether the PSD file is compatible with specific authoring tools, such as Photoshop or CLIP Studio Paint. Different authoring tools may have different ways of handling layers, such as the use of clipping masks for groups. Default is Photoshop compatibility mode.

            Returns
                CompatibilityMode <#psd_tools.constants.CompatibilityMode>

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray | None = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, ignore_preview: bool = False, apply_icc: bool = True) -> Image
            Composite the PSD image.

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the viewbox of the PSD.

                •   ignore_preview -- Boolean flag to whether skip compositing when a pre-composited preview is available.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.

        count(layer: Layer <#psd_tools.api.layers.Layer>) -> int
            Counts the number of occurrences of a layer in the group.

            Parameters
                layer -- The layer to count.

        create_group(layer_list: Iterable[Layer <#psd_tools.api.layers.Layer>] | None = None, name: str = 'Group', opacity: int = 255, blend_mode: BlendMode <#psd_tools.constants.BlendMode> = BlendMode.PASS_THROUGH, open_folder: bool = True) -> Group <#psd_tools.api.layers.Group>
            Create a new group layer and add it to the PSDImage.

            Example:

                    group = psdimage.create_group(name='New Group')
                    group.append(psdimage.create_pixel_layer(image, name='Layer in Group'))

            Parameters

                •   layer_list -- Optional list of layers to add to the group.

                •   name -- Name of the new group.

                •   opacity -- Opacity of the new layer (0-255).

                •   blend_mode -- Blend mode of the new layer, default is BlendMode.PASS_THROUGH.

                •   open_folder -- Whether the group is an open folder in the Photoshop UI.

            Returns
                The created Group <#psd_tools.api.layers.Group> object.

        create_pixel_layer(image: Image, name: str = 'Layer', top: int = 0, left: int = 0, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE, opacity: int = 255, blend_mode: BlendMode <#psd_tools.constants.BlendMode> = BlendMode.NORMAL) -> PixelLayer <#psd_tools.api.layers.PixelLayer>
            Create a new pixel layer and add it to the PSDImage.

            Example:

                    psdimage = PSDImage.new("RGB", (640, 480))
                    layer = psdimage.create_pixel_layer(image, name='Layer 1')

            Parameters

                •   name -- Name of the new layer.

                •   image -- PIL Image object.

                •   top -- Top coordinate of the new layer.

                •   left -- Left coordinate of the new layer.

                •   compression -- Compression method for the layer image data.

                •   opacity -- Opacity of the new layer (0-255).

                •   blend_mode -- Blend mode of the new layer, default is BlendMode.NORMAL.

            Returns
                The created PixelLayer <#psd_tools.api.layers.PixelLayer> object.

        property depth: int
            Pixel depth bits.

            Returns
                int

        descendants(include_clip: bool = True) -> Iterator[Layer <#psd_tools.api.layers.Layer>]
            Return a generator to iterate over all descendant layers.

            Parameters
                include_clip -- Whether to include clipping layers. Default is True.

        Example:

                    # Iterate over all layers
                    for layer in psd.descendants():
                        print(layer)

                    # Iterate over all layers in reverse order
                    for layer in reversed(list(psd.descendants())):
                        print(layer)

        extend(layers: Iterable[Layer <#psd_tools.api.layers.Layer>]) -> None
            Add a list of layers to the end (top) of the group.

            This operation rewrites the internal references of the layers. Adding the same layer will not create a duplicate.

            Parameters
                layers -- The layers to add.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        find(name: str) -> Layer <#psd_tools.api.layers.Layer> | None
            Returns the first layer found for the given layer name

            Parameters
                name

        findall(name: str) -> Iterator[Layer <#psd_tools.api.layers.Layer>]
            Return a generator to iterate over all layers with the given name.

            Parameters
                name

        classmethod frompil(image: Image, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE, color: int | float | Sequence[int | float] | None = None) -> Self
            Create a new layer-less PSD document from PIL Image.

            Parameters

                •   image -- PIL Image object.

                •   compression -- ImageData compression option. See Compression <#psd_tools.constants.Compression>.

                •   color -- Background color for the compositing backdrop when saving. Accepts the same types as new() color. When set, save() will composite layers against an opaque backdrop of this color.

            Returns
                A PSDImage <#psd_tools.api.psd_image.PSDImage> object.

        has_preview() -> bool
            Returns if the document has real merged data. When True, topil() returns pre-composed data.

        has_thumbnail() -> bool
            True if the PSDImage has a thumbnail resource.

        property height: int
            Document height.

            Returns
                int

        property image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>
            Document image resources. ImageResources <#psd_tools.psd.image_resources.ImageResources> is a dict-like structure that keeps various document settings.

            See psd_tools.constants.Resource <#psd_tools.constants.Resource> for available keys.

            Returns
                ImageResources <#psd_tools.psd.image_resources.ImageResources>

        Example:

                    from psd_tools.constants import Resource
                    version_info = psd.image_resources.get_data(Resource.VERSION_INFO)
                    slices = psd.image_resources.get_data(Resource.SLICES)

        Image resources contain an ICC profile. The following shows how to export a PNG file with embedded ICC profile:

                    from psd_tools.constants import Resource
                    icc_profile = psd.image_resources.get_data(Resource.ICC_PROFILE)
                    image = psd.compose(apply_icc=False)
                    image.save('output.png', icc_profile=icc_profile)

        index(layer: Layer <#psd_tools.api.layers.Layer>) -> int
            Returns the index of the specified layer in the group.

            Parameters
                layer -- The layer to find.

        insert(index: int, layer: Layer <#psd_tools.api.layers.Layer>) -> None
            Insert the given layer at the specified index.

            This operation rewrites the internal references of the layer.

            Parameters

                •   index -- The index to insert the layer at.

                •   layer -- The layer to insert.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        is_group() -> bool
            Return True if this is a group.

        is_updated() -> bool
            Returns whether the layer tree has been updated.

            Returns
                bool

        is_visible() -> bool
            Returns visibility of the element.

        property kind: str
            Kind.

            Returns
                'psdimage'

        property left: int
            Left coordinate.

            Returns
                0

        property name: str
            Element name.

            Returns
                'Root'

        classmethod new(mode: str, size: tuple[int, int], color: int | float | Sequence[int | float] = 0, depth: Literal[8, 16, 32] = 8, **kwargs: Any) -> Self
            Create a new PSD document.

            Parameters

                •   mode -- The color mode to use for the new image.

                •   size -- A tuple containing (width, height) in pixels.

                •   color -- What color to use for the image. Default is black. Accepts a single integer (0-255 for 8-bit) or float in the [0.0, 1.0] range, or a sequence of per-channel values using the same ranges (e.g., 3 values for "RGB", 4 for "CMYK"). Mixed int/float sequences are allowed. The color is used both as the initial image data fill and as the background_color compositing backdrop when saving.

                •   depth -- Bit depth (8, 16, or 32).

            Returns
                A PSDImage <#psd_tools.api.psd_image.PSDImage> object.

        numpy(channel: Literal['color', 'shape', 'alpha', 'mask'] | None = None) -> ndarray
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray

        property offset: tuple[int, int]
            (left, top) tuple.

            Returns
                tuple

        classmethod open(fp: IO[bytes] | str | bytes | PathLike, max_alloc_bytes: int | None = None, **kwargs: Any) -> Self
            Open a PSD document.

            Parameters

                •   fp -- filename or file-like object.

                •   max_alloc_bytes -- optional per-document cap (bytes) on the buffer that composite() <#module-psd_tools.composite>/numpy()/topil() allocate from the declared geometry; rendering raises ValueError if the estimate exceeds it. Defaults to the $PSD_TOOLS_MAX_ALLOC_BYTES env var (or psd_tools.api.utils.MAX_ALLOC_BYTES) when None.

                •   encoding -- charset encoding of the pascal string within the file, default 'macroman'. Some psd files need explicit encoding option.

            Returns
                A PSDImage <#psd_tools.api.psd_image.PSDImage> object.

        property parent: None
            Parent of this layer.

        property pil_mode: str
            PIL mode of the document.

        pop(index: int = -1) -> Layer <#psd_tools.api.layers.Layer>
            Removes the specified layer from the list and returns it.

            This operation rewrites the internal references of the layer.

            Parameters
                index -- The index of the layer to remove. Default is -1 (the last layer).

            Raises
                IndexError -- If the index is out of range.

            Returns
                The removed layer.

        remove(layer: Layer <#psd_tools.api.layers.Layer>) -> Self
            Removes the specified layer from the group.

            This operation rewrites the internal references of the layer.

            Parameters
                layer -- The layer to remove.

            Raises
                ValueError -- If the layer is not found in the group.

            Returns
                self

        property right: int
            Right coordinate.

            Returns
                int

        save(fp: IO[bytes] | str | bytes | PathLike, mode: str = 'wb', **kwargs: Any) -> None
            Save the PSD file. Updates the ImageData section if the layer structure has been updated.

            Parameters

                •   fp -- filename or file-like object.

                •   encoding -- charset encoding of the pascal string within the file, default 'macroman'.

                •   mode -- file open mode, default 'wb'.

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> | None
            Document tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> or None.

        Example:

                    from psd_tools.constants import Tag
                    patterns = psd.tagged_blocks.get_data(Tag.PATTERNS1)

        thumbnail() -> Image | None
            Returns a thumbnail image in PIL.Image. When the file does not contain an embedded thumbnail image, returns None.

        property top: int
            Top coordinate.

            Returns
                0

        topil(channel: int | ChannelID <#psd_tools.constants.ChannelID> | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image, or None if the composed image is not available.

        property version: int
            Document version. PSD file is 1, and PSB file is 2.

            Returns
                int

        property viewbox: tuple[int, int, int, int]
            Return bounding box of the viewport.

            Returns
                (left, top, right, bottom) tuple.

        property visible: bool
            Visibility.

            Returns
                True

        property width: int
            Document width.

            Returns
                int

  psd_tools.api

High-level API for working with PSD/PSB files.

This subpackage provides the user-facing API for psd-tools, offering Pythonic interfaces for manipulating Photoshop documents. It wraps the low-level psd_tools.psd <#module-psd_tools.psd> binary structures with convenient methods and properties.

The main entry point is PSDImage, which provides document-level operations. Individual layers are represented by various layer classes in psd_tools.api.layers <#module-psd_tools.api.layers>.

Key modules:

    •   psd_tools.api.psd_image: Main PSDImage class for document operations

    •   psd_tools.api.layers <#module-psd_tools.api.layers>: Layer type hierarchy (Layer, GroupMixin, etc.)

    •   psd_tools.api.adjustments <#module-psd_tools.api.adjustments>: Adjustment layer types

    •   psd_tools.api.mask <#module-psd_tools.api.mask>: Layer mask operations

    •   psd_tools.api.shape <#module-psd_tools.api.shape>: Vector shape and stroke operations

    •   psd_tools.api.effects <#module-psd_tools.api.effects>: Layer effects (shadows, glows, etc.)

    •   psd_tools.api.pil_io: PIL/Pillow image I/O utilities

    •   psd_tools.api.numpy_io: NumPy array I/O utilities

Example usage:

            from psd_tools import PSDImage

            # Open a PSD file
            psd = PSDImage.open('document.psd')

            # Access layers
            for layer in psd:
                print(f"{layer.name}: {layer.kind}")

            # Modify a layer
            layer = psd[0]
            layer.name = "New Name"
            layer.opacity = 128

            # Save changes
            psd.save('modified.psd')

The API layer automatically reconstructs the layer tree from the flat list of layer records in the PSD file, establishing proper parent-child relationships for groups.

This module provides the high-level API for working with PSD files. It wraps the low-level psd_tools.psd <#module-psd_tools.psd> structures with convenient Pythonic interfaces.

  PSDImage

    class psd_tools.api.psd_image.PSDImage(data: PSD <#psd_tools.psd.PSD>)
        Photoshop PSD/PSB document.

        The low-level data structure is accessible at PSDImage._record.

        Example:

                from psd_tools import PSDImage

                psdimage = PSDImage.open('example.psd')
                image = psdimage.composite()

                for layer in psdimage:
                    layer_image = layer.composite()

        append(layer: Layer <#psd_tools.api.layers.Layer>) -> None
            Add a layer to the end (top) of the group.

            This operation rewrites the internal references of the layer. Adding the same layer will not create a duplicate.

            Parameters
                layer -- The layer to add.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        property background_color: float | tuple[float, ...] | None
            Background color for the merged composite image. Writable.

            When set, save() composites layers against an opaque backdrop of this color instead of a transparent one. This is useful for creating RGB-mode PSD files where transparent areas should appear as a specific color (e.g., white) in the merged composite.

            Values are in [0.0, 1.0] range, matching the composite() color parameter:

            •   RGB / Grayscale: 1.0 = white, 0.0 = black

            •   CMYK: (0.0, 0.0, 0.0, 0.0) = white (no ink)

        Use a scalar for uniform color or a tuple for per-channel values. Set to None for transparent backdrop (legacy behavior).

        Documents created via new() have this set automatically from the color parameter.

            Returns
                float, tuple[float, ...], or None

        Example:

                    psd = PSDImage.new('RGB', (640, 480), color=1.0)
                    psd.save('output.psd')  # White background, 3 channels (no alpha)

        property bbox: tuple[int, int, int, int]
            Minimal bounding box that contains all the visible layers.

            Use viewbox to get viewport bounding box. When the psd is empty, bbox is equal to the canvas bounding box.

            Returns
                (left, top, right, bottom) tuple.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property channels: int
            Number of color channels.

            Returns
                int

        clear() -> None
            Clears the group.

            This operation rewrites the internal references of the layers.

            Returns
                None

        property color_mode: ColorMode <#psd_tools.constants.ColorMode>
            Document color mode, such as 'RGB' or 'GRAYSCALE'. See ColorMode <#psd_tools.constants.ColorMode>.

            Returns
                ColorMode <#psd_tools.constants.ColorMode>

        property compatibility_mode: CompatibilityMode <#psd_tools.constants.CompatibilityMode>
            Set the compositing and layer organization compatibility mode. Writable.

            This property checks whether the PSD file is compatible with specific authoring tools, such as Photoshop or CLIP Studio Paint. Different authoring tools may have different ways of handling layers, such as the use of clipping masks for groups. Default is Photoshop compatibility mode.

            Returns
                CompatibilityMode <#psd_tools.constants.CompatibilityMode>

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray | None = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, ignore_preview: bool = False, apply_icc: bool = True) -> Image
            Composite the PSD image.

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the viewbox of the PSD.

                •   ignore_preview -- Boolean flag to whether skip compositing when a pre-composited preview is available.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.

        count(layer: Layer <#psd_tools.api.layers.Layer>) -> int
            Counts the number of occurrences of a layer in the group.

            Parameters
                layer -- The layer to count.

        create_group(layer_list: Iterable[Layer <#psd_tools.api.layers.Layer>] | None = None, name: str = 'Group', opacity: int = 255, blend_mode: BlendMode <#psd_tools.constants.BlendMode> = BlendMode.PASS_THROUGH, open_folder: bool = True) -> Group <#psd_tools.api.layers.Group>
            Create a new group layer and add it to the PSDImage.

            Example:

                    group = psdimage.create_group(name='New Group')
                    group.append(psdimage.create_pixel_layer(image, name='Layer in Group'))

            Parameters

                •   layer_list -- Optional list of layers to add to the group.

                •   name -- Name of the new group.

                •   opacity -- Opacity of the new layer (0-255).

                •   blend_mode -- Blend mode of the new layer, default is BlendMode.PASS_THROUGH.

                •   open_folder -- Whether the group is an open folder in the Photoshop UI.

            Returns
                The created Group <#psd_tools.api.layers.Group> object.

        create_pixel_layer(image: Image, name: str = 'Layer', top: int = 0, left: int = 0, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE, opacity: int = 255, blend_mode: BlendMode <#psd_tools.constants.BlendMode> = BlendMode.NORMAL) -> PixelLayer <#psd_tools.api.layers.PixelLayer>
            Create a new pixel layer and add it to the PSDImage.

            Example:

                    psdimage = PSDImage.new("RGB", (640, 480))
                    layer = psdimage.create_pixel_layer(image, name='Layer 1')

            Parameters

                •   name -- Name of the new layer.

                •   image -- PIL Image object.

                •   top -- Top coordinate of the new layer.

                •   left -- Left coordinate of the new layer.

                •   compression -- Compression method for the layer image data.

                •   opacity -- Opacity of the new layer (0-255).

                •   blend_mode -- Blend mode of the new layer, default is BlendMode.NORMAL.

            Returns
                The created PixelLayer <#psd_tools.api.layers.PixelLayer> object.

        property depth: int
            Pixel depth bits.

            Returns
                int

        descendants(include_clip: bool = True) -> Iterator[Layer <#psd_tools.api.layers.Layer>]
            Return a generator to iterate over all descendant layers.

            Parameters
                include_clip -- Whether to include clipping layers. Default is True.

        Example:

                    # Iterate over all layers
                    for layer in psd.descendants():
                        print(layer)

                    # Iterate over all layers in reverse order
                    for layer in reversed(list(psd.descendants())):
                        print(layer)

        extend(layers: Iterable[Layer <#psd_tools.api.layers.Layer>]) -> None
            Add a list of layers to the end (top) of the group.

            This operation rewrites the internal references of the layers. Adding the same layer will not create a duplicate.

            Parameters
                layers -- The layers to add.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        find(name: str) -> Layer <#psd_tools.api.layers.Layer> | None
            Returns the first layer found for the given layer name

            Parameters
                name

        findall(name: str) -> Iterator[Layer <#psd_tools.api.layers.Layer>]
            Return a generator to iterate over all layers with the given name.

            Parameters
                name

        classmethod frompil(image: Image, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE, color: int | float | Sequence[int | float] | None = None) -> Self
            Create a new layer-less PSD document from PIL Image.

            Parameters

                •   image -- PIL Image object.

                •   compression -- ImageData compression option. See Compression <#psd_tools.constants.Compression>.

                •   color -- Background color for the compositing backdrop when saving. Accepts the same types as new() color. When set, save() will composite layers against an opaque backdrop of this color.

            Returns
                A PSDImage object.

        has_preview() -> bool
            Returns if the document has real merged data. When True, topil() returns pre-composed data.

        has_thumbnail() -> bool
            True if the PSDImage has a thumbnail resource.

        property height: int
            Document height.

            Returns
                int

        property image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>
            Document image resources. ImageResources <#psd_tools.psd.image_resources.ImageResources> is a dict-like structure that keeps various document settings.

            See psd_tools.constants.Resource <#psd_tools.constants.Resource> for available keys.

            Returns
                ImageResources <#psd_tools.psd.image_resources.ImageResources>

        Example:

                    from psd_tools.constants import Resource
                    version_info = psd.image_resources.get_data(Resource.VERSION_INFO)
                    slices = psd.image_resources.get_data(Resource.SLICES)

        Image resources contain an ICC profile. The following shows how to export a PNG file with embedded ICC profile:

                    from psd_tools.constants import Resource
                    icc_profile = psd.image_resources.get_data(Resource.ICC_PROFILE)
                    image = psd.compose(apply_icc=False)
                    image.save('output.png', icc_profile=icc_profile)

        index(layer: Layer <#psd_tools.api.layers.Layer>) -> int
            Returns the index of the specified layer in the group.

            Parameters
                layer -- The layer to find.

        insert(index: int, layer: Layer <#psd_tools.api.layers.Layer>) -> None
            Insert the given layer at the specified index.

            This operation rewrites the internal references of the layer.

            Parameters

                •   index -- The index to insert the layer at.

                •   layer -- The layer to insert.

            Raises

                •   TypeError -- If the provided object is not a Layer instance.

                •   ValueError -- If attempting to add a group to itself.

        is_group() -> bool
            Return True if this is a group.

        is_updated() -> bool
            Returns whether the layer tree has been updated.

            Returns
                bool

        is_visible() -> bool
            Returns visibility of the element.

        property kind: str
            Kind.

            Returns
                'psdimage'

        property left: int
            Left coordinate.

            Returns
                0

        property name: str
            Element name.

            Returns
                'Root'

        classmethod new(mode: str, size: tuple[int, int], color: int | float | Sequence[int | float] = 0, depth: Literal[8, 16, 32] = 8, **kwargs: Any) -> Self
            Create a new PSD document.

            Parameters

                •   mode -- The color mode to use for the new image.

                •   size -- A tuple containing (width, height) in pixels.

                •   color -- What color to use for the image. Default is black. Accepts a single integer (0-255 for 8-bit) or float in the [0.0, 1.0] range, or a sequence of per-channel values using the same ranges (e.g., 3 values for "RGB", 4 for "CMYK"). Mixed int/float sequences are allowed. The color is used both as the initial image data fill and as the background_color compositing backdrop when saving.

                •   depth -- Bit depth (8, 16, or 32).

            Returns
                A PSDImage object.

        numpy(channel: Literal['color', 'shape', 'alpha', 'mask'] | None = None) -> ndarray
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray

        property offset: tuple[int, int]
            (left, top) tuple.

            Returns
                tuple

        classmethod open(fp: IO[bytes] | str | bytes | PathLike, max_alloc_bytes: int | None = None, **kwargs: Any) -> Self
            Open a PSD document.

            Parameters

                •   fp -- filename or file-like object.

                •   max_alloc_bytes -- optional per-document cap (bytes) on the buffer that composite()/numpy()/topil() allocate from the declared geometry; rendering raises ValueError if the estimate exceeds it. Defaults to the $PSD_TOOLS_MAX_ALLOC_BYTES env var (or psd_tools.api.utils.MAX_ALLOC_BYTES) when None.

                •   encoding -- charset encoding of the pascal string within the file, default 'macroman'. Some psd files need explicit encoding option.

            Returns
                A PSDImage object.

        property parent: None
            Parent of this layer.

        property pil_mode: str
            PIL mode of the document.

        pop(index: int = -1) -> Layer <#psd_tools.api.layers.Layer>
            Removes the specified layer from the list and returns it.

            This operation rewrites the internal references of the layer.

            Parameters
                index -- The index of the layer to remove. Default is -1 (the last layer).

            Raises
                IndexError -- If the index is out of range.

            Returns
                The removed layer.

        remove(layer: Layer <#psd_tools.api.layers.Layer>) -> Self
            Removes the specified layer from the group.

            This operation rewrites the internal references of the layer.

            Parameters
                layer -- The layer to remove.

            Raises
                ValueError -- If the layer is not found in the group.

            Returns
                self

        property right: int
            Right coordinate.

            Returns
                int

        save(fp: IO[bytes] | str | bytes | PathLike, mode: str = 'wb', **kwargs: Any) -> None
            Save the PSD file. Updates the ImageData section if the layer structure has been updated.

            Parameters

                •   fp -- filename or file-like object.

                •   encoding -- charset encoding of the pascal string within the file, default 'macroman'.

                •   mode -- file open mode, default 'wb'.

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> | None
            Document tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> or None.

        Example:

                    from psd_tools.constants import Tag
                    patterns = psd.tagged_blocks.get_data(Tag.PATTERNS1)

        thumbnail() -> Image | None
            Returns a thumbnail image in PIL.Image. When the file does not contain an embedded thumbnail image, returns None.

        property top: int
            Top coordinate.

            Returns
                0

        topil(channel: int | ChannelID <#psd_tools.constants.ChannelID> | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image, or None if the composed image is not available.

        property version: int
            Document version. PSD file is 1, and PSB file is 2.

            Returns
                int

        property viewbox: tuple[int, int, int, int]
            Return bounding box of the viewport.

            Returns
                (left, top, right, bottom) tuple.

        property visible: bool
            Visibility.

            Returns
                True

        property width: int
            Document width.

            Returns
                int

For detailed layer types documentation, see psd_tools.api.layers <>.

  psd_tools.api.adjustments

Adjustment and fill layers.

Example:

            if layer.kind == 'brightnesscontrast':
                print(layer.brightness)

            if layer.kind == 'gradientfill':
                print(layer.gradient_kind)

  Fill layers

Fill layers are similar to ShapeLayer <#psd_tools.api.layers.ShapeLayer> except that the layer might not have an associated vector mask. The layer therefore expands the entire canvas of the PSD document.

Fill layers all inherit from FillLayer.

Example:

            if isinstance(layer, psd_tools.layers.FillLayer):
                image = layer.compose()

  SolidColorFill

    class psd_tools.api.adjustments.SolidColorFill(*args: Any)
        Solid color fill.

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property blend_mode: BlendMode <#psd_tools.constants.BlendMode>
            Blend mode of this layer. Writable.

            Example:

                    from psd_tools.constants import BlendMode
                    if layer.blend_mode == BlendMode.NORMAL:
                        layer.blend_mode = BlendMode.SCREEN

            Returns
                BlendMode <#psd_tools.constants.BlendMode>.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property clip_layers: list[Self]
            Clip layers associated with this layer.

            Returns
                list of layers

        property clipping: bool
            Clipping flag for this layer. Writable.

            Returns
                bool

        property clipping_layer: bool
            Deprecated. Use clipping property instead.

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer and masks (mask, vector mask, and clipping layers).

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the layer's bbox.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.Image or None.

        create_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Create a pixel mask on this layer from a PIL Image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- Source Image for the mask.

                •   top -- Top offset of the mask. Defaults to the layer's top.

                •   left -- Left offset of the mask. Defaults to the layer's left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The new Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer already has a mask.

        property data: DescriptorBlock
            Color in Descriptor(RGB).

        delete_layer() -> Self
            Deprecated: Use layer.parent.remove(layer) instead.

        property effects: Effects <#psd_tools.api.effects.Effects>
            Layer effects.

            Returns
                Effects <#psd_tools.api.effects.Effects>

        property fill_opacity: int
            Fill opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        has_clip_layers(visible: bool = False) -> bool
            Returns True if the layer has associated clipping.

            Parameters
                visible -- If True, check for visible clipping layers.

            Returns
                bool

        has_effects(enabled: bool = True, name: str | None = None) -> bool
            Returns True if the layer has effects.

            Parameters

                •   enabled -- If True, check for enabled effects.

                •   name -- If given, check for specific effect type.

            Returns
                bool

        has_mask() -> bool
            Returns True if the layer has a mask.

            Returns
                bool

        has_origination() -> bool
            Returns True if the layer has live shape properties.

            Returns
                bool

        has_pixels() -> bool
            Returns True if the layer has associated pixels. When this is True, topil method returns PIL.Image.Image.

            Returns
                bool

        has_stroke() -> bool
            Returns True if the shape has a stroke.

        has_vector_mask() -> bool
            Returns True if the layer has a vector mask.

            Returns
                bool

        property height: int
            Height of the layer.

            Returns
                int

        is_group() -> bool
            Return True if the layer is a group.

            Returns
                bool

        is_visible() -> bool
            Layer visibility. Takes group visibility in account.

            Returns
                bool

        property kind: str
            Kind of this layer, such as group, pixel, shape, type, smartobject, or psdimage. Class name without layer suffix.

            Returns
                str

        property layer_id: int
            Layer ID.

            Returns
                int layer id. if the layer is not assigned an id, -1.

        property left: int
            Left coordinate. Writable.

            Returns
                int

        lock(lock_flags: int = ProtectedFlags.COMPLETE) -> None
            Locks a layer accordind to the combination of flags.

            Parameters
                lockflags -- An integer representing the locking state

        Example using the constants of ProtectedFlags and bitwise or operation to lock both pixels and positions:

                    layer.lock(ProtectedFlags.COMPOSITE | ProtectedFlags.POSITION)

        property mask: Mask <#psd_tools.api.mask.Mask> | None
            Returns mask associated with this layer.

            Returns
                Mask <#psd_tools.api.mask.Mask> or None

        move_down(offset: int = 1) -> Self
            Moves the layer down a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer down (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        move_to_group(group: GroupMixin) -> Self
            Deprecated: Use group.append(layer) instead.

            Parameters
                group -- The group the current layer will be moved into.

        move_up(offset: int = 1) -> Self
            Moves the layer up a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer up (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        property name: str
            Layer name. Writable.

            Returns
                str

        next_sibling(visible: bool = False) -> Self | None
            Next sibling of this layer.

        numpy(channel: str | None = None, real_mask: bool = True) -> ndarray | None
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray or None if there is no pixel.

        property offset: tuple[int, int]
            (left, top) tuple. Writable.

            Returns
                tuple

        property opacity: int
            Opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        property origination: list[Origination]
            Property for a list of live shapes or a line.

            Some of the vector masks have associated live shape properties, that are Photoshop feature to handle primitive shapes such as a rectangle, an ellipse, or a line. Vector masks without live shape properties are plain path objects.

            See psd_tools.api.shape <#module-psd_tools.api.shape>.

            Returns
                List of Invalidated <#psd_tools.api.shape.Invalidated>, Rectangle <#psd_tools.api.shape.Rectangle>, RoundedRectangle <#psd_tools.api.shape.RoundedRectangle>, Ellipse <#psd_tools.api.shape.Ellipse>, or Line <#psd_tools.api.shape.Line>.

        property parent: GroupMixinProtocol | None
            Parent of this layer.

        previous_sibling(visible: bool = False) -> Self | None
            Previous sibling of this layer.

        property reference_point: tuple[float, float]
            Reference point of this layer as (x, y) tuple in the canvas coordinates. Writable.

            Reference point is used for transformations such as rotation and scaling.

            Returns
                (x, y) tuple

        remove_mask() -> None
            Remove the pixel mask from this layer.

            Raises
                ValueError -- If the layer does not have a mask.

        property right: int
            Right coordinate.

            Returns
                int

        property sheet_color: SheetColorType
            Color label of this layer in the Photoshop layers panel. Writable.

            Returns
                SheetColorType

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property stroke: Stroke <#psd_tools.api.shape.Stroke> | None
            Property for strokes.

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>
            Layer tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

        Example:

                    from psd_tools.constants import Tag
                    metadata = layer.tagged_blocks.get_data(Tag.METADATA_SETTING)

        property top: int
            Top coordinate. Writable.

            Returns
                int

        topil(channel: int | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image of the layer.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image.Image, or None if the layer has no pixels.

        Example:

                    from psd_tools.constants import ChannelID

                    image = layer.topil()
                    red = layer.topil(ChannelID.CHANNEL_0)
                    alpha = layer.topil(ChannelID.TRANSPARENCY_MASK)

        Note:
                Not all of the PSD image modes are supported in PIL.Image.Image. For example, 'CMYK' mode cannot include alpha channel in PIL. In this case, topil drops alpha channel.

        update_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Update the pixel mask of this layer with a new image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- New source Image for the mask.

                •   top -- New top offset of the mask. Defaults to current mask top.

                •   left -- New left offset of the mask. Defaults to current mask left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The updated Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer does not have a mask.

        property vector_mask: VectorMask <#psd_tools.api.shape.VectorMask> | None
            Returns vector mask associated with this layer.

            Returns
                VectorMask <#psd_tools.api.shape.VectorMask> or None

        property visible: bool
            Layer visibility. Doesn't take group visibility in account. Writable.

            Returns
                bool

        property width: int
            Width of the layer.

            Returns
                int

  PatternFill

    class psd_tools.api.adjustments.PatternFill(*args: Any)
        Pattern fill.

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property blend_mode: BlendMode <#psd_tools.constants.BlendMode>
            Blend mode of this layer. Writable.

            Example:

                    from psd_tools.constants import BlendMode
                    if layer.blend_mode == BlendMode.NORMAL:
                        layer.blend_mode = BlendMode.SCREEN

            Returns
                BlendMode <#psd_tools.constants.BlendMode>.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property clip_layers: list[Self]
            Clip layers associated with this layer.

            Returns
                list of layers

        property clipping: bool
            Clipping flag for this layer. Writable.

            Returns
                bool

        property clipping_layer: bool
            Deprecated. Use clipping property instead.

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer and masks (mask, vector mask, and clipping layers).

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the layer's bbox.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.Image or None.

        create_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Create a pixel mask on this layer from a PIL Image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- Source Image for the mask.

                •   top -- Top offset of the mask. Defaults to the layer's top.

                •   left -- Left offset of the mask. Defaults to the layer's left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The new Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer already has a mask.

        property data: DescriptorBlock
            Pattern in Descriptor(PATTERN).

        delete_layer() -> Self
            Deprecated: Use layer.parent.remove(layer) instead.

        property effects: Effects <#psd_tools.api.effects.Effects>
            Layer effects.

            Returns
                Effects <#psd_tools.api.effects.Effects>

        property fill_opacity: int
            Fill opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        has_clip_layers(visible: bool = False) -> bool
            Returns True if the layer has associated clipping.

            Parameters
                visible -- If True, check for visible clipping layers.

            Returns
                bool

        has_effects(enabled: bool = True, name: str | None = None) -> bool
            Returns True if the layer has effects.

            Parameters

                •   enabled -- If True, check for enabled effects.

                •   name -- If given, check for specific effect type.

            Returns
                bool

        has_mask() -> bool
            Returns True if the layer has a mask.

            Returns
                bool

        has_origination() -> bool
            Returns True if the layer has live shape properties.

            Returns
                bool

        has_pixels() -> bool
            Returns True if the layer has associated pixels. When this is True, topil method returns PIL.Image.Image.

            Returns
                bool

        has_stroke() -> bool
            Returns True if the shape has a stroke.

        has_vector_mask() -> bool
            Returns True if the layer has a vector mask.

            Returns
                bool

        property height: int
            Height of the layer.

            Returns
                int

        is_group() -> bool
            Return True if the layer is a group.

            Returns
                bool

        is_visible() -> bool
            Layer visibility. Takes group visibility in account.

            Returns
                bool

        property kind: str
            Kind of this layer, such as group, pixel, shape, type, smartobject, or psdimage. Class name without layer suffix.

            Returns
                str

        property layer_id: int
            Layer ID.

            Returns
                int layer id. if the layer is not assigned an id, -1.

        property left: int
            Left coordinate. Writable.

            Returns
                int

        lock(lock_flags: int = ProtectedFlags.COMPLETE) -> None
            Locks a layer accordind to the combination of flags.

            Parameters
                lockflags -- An integer representing the locking state

        Example using the constants of ProtectedFlags and bitwise or operation to lock both pixels and positions:

                    layer.lock(ProtectedFlags.COMPOSITE | ProtectedFlags.POSITION)

        property mask: Mask <#psd_tools.api.mask.Mask> | None
            Returns mask associated with this layer.

            Returns
                Mask <#psd_tools.api.mask.Mask> or None

        move_down(offset: int = 1) -> Self
            Moves the layer down a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer down (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        move_to_group(group: GroupMixin) -> Self
            Deprecated: Use group.append(layer) instead.

            Parameters
                group -- The group the current layer will be moved into.

        move_up(offset: int = 1) -> Self
            Moves the layer up a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer up (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        property name: str
            Layer name. Writable.

            Returns
                str

        next_sibling(visible: bool = False) -> Self | None
            Next sibling of this layer.

        numpy(channel: str | None = None, real_mask: bool = True) -> ndarray | None
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray or None if there is no pixel.

        property offset: tuple[int, int]
            (left, top) tuple. Writable.

            Returns
                tuple

        property opacity: int
            Opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        property origination: list[Origination]
            Property for a list of live shapes or a line.

            Some of the vector masks have associated live shape properties, that are Photoshop feature to handle primitive shapes such as a rectangle, an ellipse, or a line. Vector masks without live shape properties are plain path objects.

            See psd_tools.api.shape <#module-psd_tools.api.shape>.

            Returns
                List of Invalidated <#psd_tools.api.shape.Invalidated>, Rectangle <#psd_tools.api.shape.Rectangle>, RoundedRectangle <#psd_tools.api.shape.RoundedRectangle>, Ellipse <#psd_tools.api.shape.Ellipse>, or Line <#psd_tools.api.shape.Line>.

        property parent: GroupMixinProtocol | None
            Parent of this layer.

        previous_sibling(visible: bool = False) -> Self | None
            Previous sibling of this layer.

        property reference_point: tuple[float, float]
            Reference point of this layer as (x, y) tuple in the canvas coordinates. Writable.

            Reference point is used for transformations such as rotation and scaling.

            Returns
                (x, y) tuple

        remove_mask() -> None
            Remove the pixel mask from this layer.

            Raises
                ValueError -- If the layer does not have a mask.

        property right: int
            Right coordinate.

            Returns
                int

        property sheet_color: SheetColorType
            Color label of this layer in the Photoshop layers panel. Writable.

            Returns
                SheetColorType

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property stroke: Stroke <#psd_tools.api.shape.Stroke> | None
            Property for strokes.

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>
            Layer tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

        Example:

                    from psd_tools.constants import Tag
                    metadata = layer.tagged_blocks.get_data(Tag.METADATA_SETTING)

        property top: int
            Top coordinate. Writable.

            Returns
                int

        topil(channel: int | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image of the layer.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image.Image, or None if the layer has no pixels.

        Example:

                    from psd_tools.constants import ChannelID

                    image = layer.topil()
                    red = layer.topil(ChannelID.CHANNEL_0)
                    alpha = layer.topil(ChannelID.TRANSPARENCY_MASK)

        Note:
                Not all of the PSD image modes are supported in PIL.Image.Image. For example, 'CMYK' mode cannot include alpha channel in PIL. In this case, topil drops alpha channel.

        update_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Update the pixel mask of this layer with a new image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- New source Image for the mask.

                •   top -- New top offset of the mask. Defaults to current mask top.

                •   left -- New left offset of the mask. Defaults to current mask left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The updated Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer does not have a mask.

        property vector_mask: VectorMask <#psd_tools.api.shape.VectorMask> | None
            Returns vector mask associated with this layer.

            Returns
                VectorMask <#psd_tools.api.shape.VectorMask> or None

        property visible: bool
            Layer visibility. Doesn't take group visibility in account. Writable.

            Returns
                bool

        property width: int
            Width of the layer.

            Returns
                int

  GradientFill

    class psd_tools.api.adjustments.GradientFill(*args: Any)
        Gradient fill.

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property blend_mode: BlendMode <#psd_tools.constants.BlendMode>
            Blend mode of this layer. Writable.

            Example:

                    from psd_tools.constants import BlendMode
                    if layer.blend_mode == BlendMode.NORMAL:
                        layer.blend_mode = BlendMode.SCREEN

            Returns
                BlendMode <#psd_tools.constants.BlendMode>.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property clip_layers: list[Self]
            Clip layers associated with this layer.

            Returns
                list of layers

        property clipping: bool
            Clipping flag for this layer. Writable.

            Returns
                bool

        property clipping_layer: bool
            Deprecated. Use clipping property instead.

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer and masks (mask, vector mask, and clipping layers).

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the layer's bbox.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.Image or None.

        create_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Create a pixel mask on this layer from a PIL Image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- Source Image for the mask.

                •   top -- Top offset of the mask. Defaults to the layer's top.

                •   left -- Left offset of the mask. Defaults to the layer's left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The new Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer already has a mask.

        property data: DescriptorBlock
            Gradient in Descriptor(GRADIENT).

        delete_layer() -> Self
            Deprecated: Use layer.parent.remove(layer) instead.

        property effects: Effects <#psd_tools.api.effects.Effects>
            Layer effects.

            Returns
                Effects <#psd_tools.api.effects.Effects>

        property fill_opacity: int
            Fill opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        property gradient_kind: str
            Kind of the gradient, one of the following:

            •   Linear

            •   Radial

            •   Angle

            •   Reflected

            •   Diamond

        has_clip_layers(visible: bool = False) -> bool
            Returns True if the layer has associated clipping.

            Parameters
                visible -- If True, check for visible clipping layers.

            Returns
                bool

        has_effects(enabled: bool = True, name: str | None = None) -> bool
            Returns True if the layer has effects.

            Parameters

                •   enabled -- If True, check for enabled effects.

                •   name -- If given, check for specific effect type.

            Returns
                bool

        has_mask() -> bool
            Returns True if the layer has a mask.

            Returns
                bool

        has_origination() -> bool
            Returns True if the layer has live shape properties.

            Returns
                bool

        has_pixels() -> bool
            Returns True if the layer has associated pixels. When this is True, topil method returns PIL.Image.Image.

            Returns
                bool

        has_stroke() -> bool
            Returns True if the shape has a stroke.

        has_vector_mask() -> bool
            Returns True if the layer has a vector mask.

            Returns
                bool

        property height: int
            Height of the layer.

            Returns
                int

        is_group() -> bool
            Return True if the layer is a group.

            Returns
                bool

        is_visible() -> bool
            Layer visibility. Takes group visibility in account.

            Returns
                bool

        property kind: str
            Kind of this layer, such as group, pixel, shape, type, smartobject, or psdimage. Class name without layer suffix.

            Returns
                str

        property layer_id: int
            Layer ID.

            Returns
                int layer id. if the layer is not assigned an id, -1.

        property left: int
            Left coordinate. Writable.

            Returns
                int

        lock(lock_flags: int = ProtectedFlags.COMPLETE) -> None
            Locks a layer accordind to the combination of flags.

            Parameters
                lockflags -- An integer representing the locking state

        Example using the constants of ProtectedFlags and bitwise or operation to lock both pixels and positions:

                    layer.lock(ProtectedFlags.COMPOSITE | ProtectedFlags.POSITION)

        property mask: Mask <#psd_tools.api.mask.Mask> | None
            Returns mask associated with this layer.

            Returns
                Mask <#psd_tools.api.mask.Mask> or None

        move_down(offset: int = 1) -> Self
            Moves the layer down a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer down (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        move_to_group(group: GroupMixin) -> Self
            Deprecated: Use group.append(layer) instead.

            Parameters
                group -- The group the current layer will be moved into.

        move_up(offset: int = 1) -> Self
            Moves the layer up a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer up (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        property name: str
            Layer name. Writable.

            Returns
                str

        next_sibling(visible: bool = False) -> Self | None
            Next sibling of this layer.

        numpy(channel: str | None = None, real_mask: bool = True) -> ndarray | None
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray or None if there is no pixel.

        property offset: tuple[int, int]
            (left, top) tuple. Writable.

            Returns
                tuple

        property opacity: int
            Opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        property origination: list[Origination]
            Property for a list of live shapes or a line.

            Some of the vector masks have associated live shape properties, that are Photoshop feature to handle primitive shapes such as a rectangle, an ellipse, or a line. Vector masks without live shape properties are plain path objects.

            See psd_tools.api.shape <#module-psd_tools.api.shape>.

            Returns
                List of Invalidated <#psd_tools.api.shape.Invalidated>, Rectangle <#psd_tools.api.shape.Rectangle>, RoundedRectangle <#psd_tools.api.shape.RoundedRectangle>, Ellipse <#psd_tools.api.shape.Ellipse>, or Line <#psd_tools.api.shape.Line>.

        property parent: GroupMixinProtocol | None
            Parent of this layer.

        previous_sibling(visible: bool = False) -> Self | None
            Previous sibling of this layer.

        property reference_point: tuple[float, float]
            Reference point of this layer as (x, y) tuple in the canvas coordinates. Writable.

            Reference point is used for transformations such as rotation and scaling.

            Returns
                (x, y) tuple

        remove_mask() -> None
            Remove the pixel mask from this layer.

            Raises
                ValueError -- If the layer does not have a mask.

        property right: int
            Right coordinate.

            Returns
                int

        property sheet_color: SheetColorType
            Color label of this layer in the Photoshop layers panel. Writable.

            Returns
                SheetColorType

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property stroke: Stroke <#psd_tools.api.shape.Stroke> | None
            Property for strokes.

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>
            Layer tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

        Example:

                    from psd_tools.constants import Tag
                    metadata = layer.tagged_blocks.get_data(Tag.METADATA_SETTING)

        property top: int
            Top coordinate. Writable.

            Returns
                int

        topil(channel: int | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image of the layer.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image.Image, or None if the layer has no pixels.

        Example:

                    from psd_tools.constants import ChannelID

                    image = layer.topil()
                    red = layer.topil(ChannelID.CHANNEL_0)
                    alpha = layer.topil(ChannelID.TRANSPARENCY_MASK)

        Note:
                Not all of the PSD image modes are supported in PIL.Image.Image. For example, 'CMYK' mode cannot include alpha channel in PIL. In this case, topil drops alpha channel.

        update_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Update the pixel mask of this layer with a new image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- New source Image for the mask.

                •   top -- New top offset of the mask. Defaults to current mask top.

                •   left -- New left offset of the mask. Defaults to current mask left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The updated Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer does not have a mask.

        property vector_mask: VectorMask <#psd_tools.api.shape.VectorMask> | None
            Returns vector mask associated with this layer.

            Returns
                VectorMask <#psd_tools.api.shape.VectorMask> or None

        property visible: bool
            Layer visibility. Doesn't take group visibility in account. Writable.

            Returns
                bool

        property width: int
            Width of the layer.

            Returns
                int

  Adjustment layers

Adjustment layers apply image filtering to the composed result. All adjustment layers inherit from AdjustmentLayer. Adjustment layers do not have pixels, and currently ignored in compose. Attempts to call topil on adjustment layers always return None.

Just as any other layer, adjustment layers might have an associated mask or vector mask. Adjustment can appear in other layers' clipping layers.

Example:

            if isinstance(layer, psd_tools.layers.AdjustmentLayer):
                print(layer.kind)

  BrightnessContrast

    class psd_tools.api.adjustments.BrightnessContrast(*args: Any)
        Brightness and contrast adjustment.

        property automatic: bool

        property brightness: int

        property contrast: int

        property lab: bool

        property mean: int

        property use_legacy: bool

        property vrsn: int

  Curves

    class psd_tools.api.adjustments.Curves(*args: Any)
        Curves adjustment.

        property data: Curves
            Raw data.

            Returns
                Curves

        property extra: Any

  Exposure

    class psd_tools.api.adjustments.Exposure(*args: Any)
        Exposure adjustment.

        property exposure: float
            Exposure.

            Returns
                float

        property exposure_offset: float
            Exposure offset.

            Returns
                float

        property gamma: float
            Gamma.

            Returns
                float

  Levels

    class psd_tools.api.adjustments.Levels(*args: Any)
        Levels adjustment.

        Levels contain a list of LevelRecord.

        property data: Levels
            List of level records. The first record is the master.

            Returns
                Levels.

        property master: LevelRecord
            Master record.

  Vibrance

    class psd_tools.api.adjustments.Vibrance(*args: Any)
        Vibrance adjustment.

        property saturation: int
            Saturation.

            Returns
                int

        property vibrance: int
            Vibrance.

            Returns
                int

  HueSaturation

    class psd_tools.api.adjustments.HueSaturation(*args: Any)
        Hue/Saturation adjustment.

        HueSaturation contains a list of data.

        property colorization: tuple
            Colorization.

            Returns
                tuple

        property data: list
            List of Hue/Saturation records.

            Returns
                list

        property enable_colorization: int
            Enable colorization.

            Returns
                int

        property master: tuple
            Master record.

            Returns
                tuple

  ColorBalance

    class psd_tools.api.adjustments.ColorBalance(*args: Any)
        Color balance adjustment.

        property highlights: tuple
            Highlights.

            Returns
                tuple

        property luminosity: int
            Luminosity.

            Returns
                int

        property midtones: tuple
            Mid-tones.

            Returns
                tuple

        property shadows: tuple
            Shadows.

            Returns
                tuple

  BlackAndWhite

    class psd_tools.api.adjustments.BlackAndWhite(*args: Any)
        Black and white adjustment.

        property blue: int

        property cyan: int

        property green: int

        property magenta: int

        property preset_file_name: str

        property preset_kind: int

        property red: int

        property tint_color: Any

        property use_tint: bool

        property yellow: int

  PhotoFilter

    class psd_tools.api.adjustments.PhotoFilter(*args: Any)
        Photo filter adjustment.

        property color_components: Any

        property color_space: Any

        property density: Any

        property luminosity: Any

        property xyz: bool
            xyz.

            Returns
                bool

  ChannelMixer

    class psd_tools.api.adjustments.ChannelMixer(*args: Any)
        Channel mixer adjustment.

        property data: Any

        property monochrome: Any

  ColorLookup

    class psd_tools.api.adjustments.ColorLookup(*args: Any)
        Color lookup adjustment.

  Posterize

    class psd_tools.api.adjustments.Posterize(*args: Any)
        Posterize adjustment.

        property posterize: int
            Posterize value.

            Returns
                int

  Threshold

    class psd_tools.api.adjustments.Threshold(*args: Any)
        Threshold adjustment.

        property threshold: int
            Threshold value.

            Returns
                int

  SelectiveColor

    class psd_tools.api.adjustments.SelectiveColor(*args: Any)
        Selective color adjustment.

        property data: Any

        property method: Any

  GradientMap

    class psd_tools.api.adjustments.GradientMap(*args: Any)
        Gradient map adjustment.

        property color_model: Any

        property color_stops: Any

        property dithered: Any

        property expansion: Any

        property gradient_name: Any

        property interpolation: float
            Interpolation between 0.0 and 1.0.

        property length: Any

        property max_color: Any

        property min_color: Any

        property mode: Any

        property random_seed: Any

        property reversed: Any

        property roughness: Any

        property show_transparency: Any

        property transparency_stops: Any

        property use_vector_color: Any

  psd_tools.api.effects

Effects module.

    class psd_tools.api.effects.Effects(layer: LayerProtocol)
        List-like effects.

        Only present effects are kept.

        property enabled: bool
            Whether if all the effects are enabled.

            Return type
                bool

        find(name: str, enabled: bool = True) -> Iterator[_Effect]
            Iterate effect items by name.

            Parameters

                •   name -- Effect name, e.g. DropShadow, InnerShadow, OuterGlow, InnerGlow, ColorOverlay, GradientOverlay, PatternOverlay, Stroke, BevelEmboss, or Satin.

                •   enabled -- If true, only return enabled effects.

            Return type
                Iterator[Effect <#psd_tools.terminology.Key.Effect>]

        property scale: float
            Scale value.

  DropShadow

    class psd_tools.api.effects.DropShadow(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property angle: float
            Angle value.

        property anti_aliased: bool
            Angi-aliased.

        property blend_mode: bytes
            Effect blending mode.

        property choke: float
            Choke level in pixels.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property distance: float
            Distance in pixels.

        property enabled: bool
            Whether if the effect is enabled.

        property layer_knocks_out: bool
            Layers are knocking out.

        property name: str
            Effect name.

        property noise: float
            Noise level in percent.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size in pixels.

        property use_global_light: bool
            Using global light.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  InnerShadow

    class psd_tools.api.effects.InnerShadow(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property angle: float
            Angle value.

        property anti_aliased: bool
            Angi-aliased.

        property blend_mode: bytes
            Effect blending mode.

        property choke: float
            Choke level in pixels.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property distance: float
            Distance in pixels.

        property enabled: bool
            Whether if the effect is enabled.

        property name: str
            Effect name.

        property noise: float
            Noise level in percent.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size in pixels.

        property use_global_light: bool
            Using global light.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  OuterGlow

    class psd_tools.api.effects.OuterGlow(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property angle: float
            Angle value.

        property anti_aliased: bool
            Angi-aliased.

        property blend_mode: bytes
            Effect blending mode.

        property choke: float
            Choke level in pixels.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property dithered: bool
            Dither flag.

        property enabled: bool
            Whether if the effect is enabled.

        property glow_type: bytes
            Glow type.

        property gradient: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Gradient configuration.

        property name: str
            Effect name.

        property noise: float
            Noise level in percent.

        property offset: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Offset value in Pnt descriptor.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property quality_jitter: float
            Quality jitter in percent.

        property quality_range: float
            Quality range in percent.

        property reversed: bool
            Reverse flag.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size in pixels.

        property spread: float
            Spread level in percent.

        property type: bytes
            Gradient type, one of linear, radial, angle, reflected, or diamond.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  InnerGlow

    class psd_tools.api.effects.InnerGlow(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property angle: float
            Angle value.

        property anti_aliased: bool
            Angi-aliased.

        property blend_mode: bytes
            Effect blending mode.

        property choke: float
            Choke level in pixels.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property dithered: bool
            Dither flag.

        property enabled: bool
            Whether if the effect is enabled.

        property glow_source: bytes
            Elements source.

        property glow_type: bytes
            Glow type.

        property gradient: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Gradient configuration.

        property name: str
            Effect name.

        property noise: float
            Noise level in percent.

        property offset: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Offset value in Pnt descriptor.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property quality_jitter: float
            Quality jitter in percent.

        property quality_range: float
            Quality range in percent.

        property reversed: bool
            Reverse flag.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size in pixels.

        property type: bytes
            Gradient type, one of linear, radial, angle, reflected, or diamond.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  ColorOverlay

    class psd_tools.api.effects.ColorOverlay(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property blend_mode: bytes
            Effect blending mode.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property enabled: bool
            Whether if the effect is enabled.

        property name: str
            Effect name.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property shown: bool
            Whether if the effect is shown in dialog.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  GradientOverlay

    class psd_tools.api.effects.GradientOverlay(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property aligned: bool
            Aligned.

        property angle: float
            Angle value.

        property blend_mode: bytes
            Effect blending mode.

        property dithered: bool
            Dither flag.

        property enabled: bool
            Whether if the effect is enabled.

        property gradient: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Gradient configuration.

        property name: str
            Effect name.

        property offset: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Offset value in Pnt descriptor.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property reversed: bool
            Reverse flag.

        property scale: float
            Scale value.

        property shown: bool
            Whether if the effect is shown in dialog.

        property type: bytes
            Gradient type, one of linear, radial, angle, reflected, or diamond.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  PatternOverlay

    class psd_tools.api.effects.PatternOverlay(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property aligned: bool
            Aligned.

        property angle: float
            Angle value.

        property blend_mode: bytes
            Effect blending mode.

        property enabled: bool
            Whether if the effect is enabled.

        property linked: bool
            Linked.

        property name: str
            Effect name.

        property opacity: float
            Layer effect opacity in percentage.

        property pattern: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Pattern config.

        property phase: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Phase value in Point.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property scale: float
            Scale value.

        property shown: bool
            Whether if the effect is shown in dialog.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  Stroke

    class psd_tools.api.effects.Stroke(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property angle: float
            Angle value.

        property blend_mode: bytes
            Effect blending mode.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property dithered: bool
            Dither flag.

        property enabled: bool
            Whether if the effect is enabled.

        property fill_type: bytes
            Fill type, SolidColor, Gradient, or Pattern.

        property gradient: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Gradient configuration.

        property linked: bool
            Linked.

        property name: str
            Effect name.

        property offset: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Offset value in Pnt descriptor.

        property opacity: float
            Layer effect opacity in percentage.

        property overprint: bool
            Overprint flag.

        property pattern: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Pattern config.

        property phase: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Phase value in Point.

        property position: bytes
            Position of the stroke, InsetFrame, OutsetFrame, or CenteredFrame.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property reversed: bool
            Reverse flag.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size value.

        property type: bytes
            Gradient type, one of linear, radial, angle, reflected, or diamond.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  BevelEmboss

    class psd_tools.api.effects.BevelEmboss(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)

        property altitude: float
            Altitude value in angle.

        property angle: float
            Angle value.

        property anti_aliased: bool
            Anti-aliased.

        property bevel_style: bytes
            Bevel style, one of OuterBevel, InnerBevel, Emboss, PillowEmboss, or StrokeEmboss.

        property bevel_type: bytes
            Bevel type, one of SoftMatte, HardLight, SoftLight.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property depth: float
            Depth value in percentage.

        property direction: bytes
            Direction, either StampIn or StampOut.

        property enabled: bool
            Whether if the effect is enabled.

        property highlight_color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Highlight color value.

        property highlight_mode: bytes
            Highlight blending mode.

        property highlight_opacity: float
            Highlight opacity value in percentage.

        property name: str
            Effect name.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property shadow_color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Shadow color value.

        property shadow_mode: bytes
            Shadow blending mode.

        property shadow_opacity: float
            Shadow opacity value in percentage.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size value in pixel.

        property soften: float
            Soften value in pixels.

        property use_global_light: bool
            Using global light.

        property use_shape: bool
            Using shape.

        property use_texture: bool
            Using texture.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  Satin

    class psd_tools.api.effects.Satin(descriptor: Descriptor <#psd_tools.psd.descriptor.Descriptor>, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources>)
        Satin effect

        property angle: float
            Angle value in degrees.

        property anti_aliased: bool
            Anti-aliased.

        property blend_mode: bytes
            Effect blending mode.

        property color: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Color.

        property contour: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Contour configuration.

        property distance: float
            Distance value in pixels.

        property enabled: bool
            Whether if the effect is enabled.

        property inverted: bool
            Inverted.

        property name: str
            Effect name.

        property opacity: float
            Layer effect opacity in percentage.

        property present: bool
            Whether if the effect is present in Photoshop UI.

        property shown: bool
            Whether if the effect is shown in dialog.

        property size: float
            Size value in pixel.

        property value: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Deprecated

            Effect descriptor value. Use descriptor property instead.

  psd_tools.api.layers

Layer module.

This module implements the high-level layer API for psd-tools, providing Pythonic interfaces for working with Photoshop layers. It defines the layer type hierarchy and common operations.

Key classes:

    •   Layer: Base class for all layer types

    •   GroupMixin: Mixin for layers that contain children (groups, documents)

    •   Group: Folder/group layer containing other layers

    •   PixelLayer: Regular raster layer with pixel data

    •   TypeLayer: Text layer with typography information

    •   ShapeLayer: Vector shape layer

    •   SmartObjectLayer: Embedded or linked smart object

    •   AdjustmentLayer: Non-destructive adjustment (curves, levels, etc.)

Layer hierarchy:

Layers are organized in a tree structure where groups can contain child layers. The GroupMixin provides iteration, indexing, and search capabilities:

            # Iterate through all layers
            for layer in psd:
                print(layer.name)

            # Access by index
            first_layer = psd[0]

            # Check if layer is a specific type
            if layer.kind == 'pixel':
                pixels = layer.numpy()

Common layer properties:

    •   name: Layer name

    •   visible: Visibility flag

    •   opacity: Opacity (0-255)

    •   blend_mode: Blend mode enum

    •   bbox: Bounding box (left, top, right, bottom)

    •   width, height: Dimensions

    •   kind: Layer type string ('pixel', 'group', 'type', etc.)

    •   parent: Parent layer or document

Layer operations:

    •   composite(): Render layer to PIL Image

    •   numpy(): Get pixel data as NumPy array

    •   topil(): Convert to PIL Image

    •   has_mask(): Check if layer has a mask

    •   has_clip_layers(): Check if layer has clipping mask

Example usage:

            from psd_tools import PSDImage

            psd = PSDImage.open('document.psd')

            # Access first layer
            layer = psd[0]

            # Modify layer properties
            layer.visible = False
            layer.opacity = 128
            layer.name = "New Name"

            # Get pixel data
            pixels = layer.numpy()  # NumPy array
            image = layer.topil()   # PIL Image

            # Work with groups
            for group in psd.descendants():
                if group.kind == 'group':
                    print(f"Group: {group.name} with {len(group)} layers")

            # Composite specific layer
            rendered = layer.composite()
            rendered.save('layer.png')

Layer types are automatically determined from the underlying PSD structures and exposed through the kind property for easy type checking.

  Layer

    class psd_tools.api.layers.Layer(parent: GroupMixin, record: LayerRecord <#psd_tools.psd.layer_and_mask.LayerRecord>, channels: ChannelDataList <#psd_tools.psd.layer_and_mask.ChannelDataList>)

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property blend_mode: BlendMode <#psd_tools.constants.BlendMode>
            Blend mode of this layer. Writable.

            Example:

                    from psd_tools.constants import BlendMode
                    if layer.blend_mode == BlendMode.NORMAL:
                        layer.blend_mode = BlendMode.SCREEN

            Returns
                BlendMode <#psd_tools.constants.BlendMode>.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property clip_layers: list[Self]
            Clip layers associated with this layer.

            Returns
                list of layers

        property clipping: bool
            Clipping flag for this layer. Writable.

            Returns
                bool

        property clipping_layer: bool
            Deprecated. Use clipping property instead.

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer and masks (mask, vector mask, and clipping layers).

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the layer's bbox.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.Image or None.

        create_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Create a pixel mask on this layer from a PIL Image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- Source Image for the mask.

                •   top -- Top offset of the mask. Defaults to the layer's top.

                •   left -- Left offset of the mask. Defaults to the layer's left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The new Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer already has a mask.

        delete_layer() -> Self
            Deprecated: Use layer.parent.remove(layer) instead.

        property effects: Effects <#psd_tools.api.effects.Effects>
            Layer effects.

            Returns
                Effects <#psd_tools.api.effects.Effects>

        property fill_opacity: int
            Fill opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        has_clip_layers(visible: bool = False) -> bool
            Returns True if the layer has associated clipping.

            Parameters
                visible -- If True, check for visible clipping layers.

            Returns
                bool

        has_effects(enabled: bool = True, name: str | None = None) -> bool
            Returns True if the layer has effects.

            Parameters

                •   enabled -- If True, check for enabled effects.

                •   name -- If given, check for specific effect type.

            Returns
                bool

        has_mask() -> bool
            Returns True if the layer has a mask.

            Returns
                bool

        has_origination() -> bool
            Returns True if the layer has live shape properties.

            Returns
                bool

        has_pixels() -> bool
            Returns True if the layer has associated pixels. When this is True, topil method returns PIL.Image.Image.

            Returns
                bool

        has_stroke() -> bool
            Returns True if the shape has a stroke.

        has_vector_mask() -> bool
            Returns True if the layer has a vector mask.

            Returns
                bool

        property height: int
            Height of the layer.

            Returns
                int

        is_group() -> bool
            Return True if the layer is a group.

            Returns
                bool

        is_visible() -> bool
            Layer visibility. Takes group visibility in account.

            Returns
                bool

        property kind: str
            Kind of this layer, such as group, pixel, shape, type, smartobject, or psdimage. Class name without layer suffix.

            Returns
                str

        property layer_id: int
            Layer ID.

            Returns
                int layer id. if the layer is not assigned an id, -1.

        property left: int
            Left coordinate. Writable.

            Returns
                int

        lock(lock_flags: int = ProtectedFlags.COMPLETE) -> None
            Locks a layer accordind to the combination of flags.

            Parameters
                lockflags -- An integer representing the locking state

        Example using the constants of ProtectedFlags and bitwise or operation to lock both pixels and positions:

                    layer.lock(ProtectedFlags.COMPOSITE | ProtectedFlags.POSITION)

        property mask: Mask <#psd_tools.api.mask.Mask> | None
            Returns mask associated with this layer.

            Returns
                Mask <#psd_tools.api.mask.Mask> or None

        move_down(offset: int = 1) -> Self
            Moves the layer down a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer down (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        move_to_group(group: GroupMixin) -> Self
            Deprecated: Use group.append(layer) instead.

            Parameters
                group -- The group the current layer will be moved into.

        move_up(offset: int = 1) -> Self
            Moves the layer up a certain offset within the group the layer is in.

            Parameters
                offset -- The number of positions to move the layer up (can be negative).

            Raises

                •   ValueError -- If layer has no parent or parent is not a group

                •   IndexError -- If the new index is out of bounds

            Returns
                self

        property name: str
            Layer name. Writable.

            Returns
                str

        next_sibling(visible: bool = False) -> Self | None
            Next sibling of this layer.

        numpy(channel: str | None = None, real_mask: bool = True) -> ndarray | None
            Get NumPy array of the layer.

            Parameters
                channel -- Which channel to return, can be 'color', 'shape', 'alpha', or 'mask'. Default is 'color+alpha'.

            Returns
                numpy.ndarray or None if there is no pixel.

        property offset: tuple[int, int]
            (left, top) tuple. Writable.

            Returns
                tuple

        property opacity: int
            Opacity of this layer in [0, 255] range. Writable.

            Returns
                int

        property origination: list[Origination]
            Property for a list of live shapes or a line.

            Some of the vector masks have associated live shape properties, that are Photoshop feature to handle primitive shapes such as a rectangle, an ellipse, or a line. Vector masks without live shape properties are plain path objects.

            See psd_tools.api.shape <#module-psd_tools.api.shape>.

            Returns
                List of Invalidated <#psd_tools.api.shape.Invalidated>, Rectangle <#psd_tools.api.shape.Rectangle>, RoundedRectangle <#psd_tools.api.shape.RoundedRectangle>, Ellipse <#psd_tools.api.shape.Ellipse>, or Line <#psd_tools.api.shape.Line>.

        property parent: GroupMixinProtocol | None
            Parent of this layer.

        previous_sibling(visible: bool = False) -> Self | None
            Previous sibling of this layer.

        property reference_point: tuple[float, float]
            Reference point of this layer as (x, y) tuple in the canvas coordinates. Writable.

            Reference point is used for transformations such as rotation and scaling.

            Returns
                (x, y) tuple

        remove_mask() -> None
            Remove the pixel mask from this layer.

            Raises
                ValueError -- If the layer does not have a mask.

        property right: int
            Right coordinate.

            Returns
                int

        property sheet_color: SheetColorType
            Color label of this layer in the Photoshop layers panel. Writable.

            Returns
                SheetColorType

        property size: tuple[int, int]
            (width, height) tuple.

            Returns
                tuple

        property stroke: Stroke <#psd_tools.api.shape.Stroke> | None
            Property for strokes.

        property tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>
            Layer tagged blocks that is a dict-like container of settings.

            See psd_tools.constants.Tag <#psd_tools.constants.Tag> for available keys.

            Returns
                TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

        Example:

                    from psd_tools.constants import Tag
                    metadata = layer.tagged_blocks.get_data(Tag.METADATA_SETTING)

        property top: int
            Top coordinate. Writable.

            Returns
                int

        topil(channel: int | None = None, apply_icc: bool = True) -> Image | None
            Get PIL Image of the layer.

            Parameters

                •   channel -- Which channel to return; e.g., 0 for 'R' channel in RGB image. See ChannelID <#psd_tools.constants.ChannelID>. When None, the method returns all the channels supported by PIL modes.

                •   apply_icc -- Whether to apply ICC profile conversion to sRGB.

            Returns
                PIL.Image.Image, or None if the layer has no pixels.

        Example:

                    from psd_tools.constants import ChannelID

                    image = layer.topil()
                    red = layer.topil(ChannelID.CHANNEL_0)
                    alpha = layer.topil(ChannelID.TRANSPARENCY_MASK)

        Note:
                Not all of the PSD image modes are supported in PIL.Image.Image. For example, 'CMYK' mode cannot include alpha channel in PIL. In this case, topil drops alpha channel.

        update_mask(image: Image, top: int | None = None, left: int | None = None, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE) -> Mask <#psd_tools.api.mask.Mask>
            Update the pixel mask of this layer with a new image.

            If the image has an alpha channel (e.g. RGBA, LA), the alpha channel is used as the mask data. Otherwise the image is converted to grayscale (L mode). White (255) means fully unmasked, black (0) means fully masked.

            Parameters

                •   image -- New source Image for the mask.

                •   top -- New top offset of the mask. Defaults to current mask top.

                •   left -- New left offset of the mask. Defaults to current mask left.

                •   compression -- Compression algorithm for the mask data.

            Returns
                The updated Mask <#psd_tools.api.mask.Mask>.

            Raises
                ValueError -- If the layer does not have a mask.

        property vector_mask: VectorMask <#psd_tools.api.shape.VectorMask> | None
            Returns vector mask associated with this layer.

            Returns
                VectorMask <#psd_tools.api.shape.VectorMask> or None

        property visible: bool
            Layer visibility. Doesn't take group visibility in account. Writable.

            Returns
                bool

        property width: int
            Width of the layer.

            Returns
                int

  Artboard

    class psd_tools.api.layers.Artboard(parent: GroupMixin, record: LayerRecord <#psd_tools.psd.layer_and_mask.LayerRecord>, channels: ChannelDataList <#psd_tools.psd.layer_and_mask.ChannelDataList>)
        Artboard is a special kind of group that has a pre-defined viewbox.

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property bottom: int
            Bottom coordinate (computed from children, read-only).

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray | None = None, alpha: float | ndarray | None = None, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer, automatically applying the artboard's background color.

            When either color or alpha is not explicitly provided, reads the artboard background from the ARTBOARD_DATA tagged block (artboardBackgroundType and Clr descriptor) and uses the missing value or values as the compositing backdrop.

        property left: int
            Left coordinate (computed from children, read-only).

        property right: int
            Right coordinate (computed from children, read-only).

        property top: int
            Top coordinate (computed from children, read-only).

  Group

    class psd_tools.api.layers.Group(parent: GroupMixin, record: LayerRecord <#psd_tools.psd.layer_and_mask.LayerRecord>, channels: ChannelDataList <#psd_tools.psd.layer_and_mask.ChannelDataList>)
        Group of layers.

        Example:

                group = psd[1]
                for layer in group:
                    if layer.kind == 'pixel':
                        print(layer.name)

        property blend_mode: BlendMode <#psd_tools.constants.BlendMode>
            Blend mode of this layer. Writable.

        property bottom: int
            Bottom coordinate (computed from children, read-only).

        property clipping: bool
            Clipping flag for this layer. Writable.

            Returns
                bool

        composite(viewport: tuple[int, int, int, int] | None = None, force: bool = False, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, layer_filter: Callable | None = None, apply_icc: bool = True) -> Image | None
            Composite layer and masks (mask, vector mask, and clipping layers).

            Parameters

                •   viewport -- Viewport bounding box specified by (x1, y1, x2, y2) tuple. Default is the layer's bbox.

                •   force -- Boolean flag to force vector drawing.

                •   color -- Backdrop color specified by scalar or tuple of scalar. The color value should be in [0.0, 1.0]. For example, (1., 0., 0.) specifies red in RGB color mode.

                •   alpha -- Backdrop alpha in [0.0, 1.0].

                •   layer_filter -- Callable that takes a layer as argument and returns whether if the layer is composited. Default is is_visible().

            Returns
                PIL.Image.Image.

        static extract_bbox(layers: Sequence[Layer <#psd_tools.api.layers.Layer>] | GroupMixin, include_invisible: bool = False, include_clipping: bool = False) -> tuple[int, int, int, int]
            Returns a bounding box for layers or (0, 0, 0, 0) if the layers have no bounding box.

            Parameters

                •   layers -- sequence of layers or a group.

                •   include_invisible -- include invisible layers in calculation.

                •   include_clipping -- include clipping layers in calculation. Defaults to False to match visible pixel bounds.

            Returns
                tuple of four int

        classmethod group_layers(parent: GroupMixin, layers: Sequence[Layer <#psd_tools.api.layers.Layer>], name: str = 'Group', open_folder: bool = True) -> Self
            Deprecated: Use psdimage.create_group(layer_list, name) instead.

            Parameters

                •   parent -- The parent group to add the newly created Group object into.

                •   layers -- The layers to group. Can by any subclass of Layer

                •   name -- The display name of the group. Default to "Group".

                •   open_folder -- Boolean defining whether the folder will be open or closed in photoshop. Default to True.

            Returns
                A Group

            Raises
                ValueError -- If layers is empty

        is_group() -> bool
            Return True if the layer is a group.

            Returns
                bool

        property left: int
            Left coordinate (computed from children, read-only).

        classmethod new(parent: GroupMixin, name: str = 'Group', open_folder: bool = True) -> Self
            Create a new Group object with minimal records and data channels and metadata to properly include the group in the PSD file.

            Parameters

                •   name -- The display name of the group. Default to "Group".

                •   open_folder -- Boolean defining whether the folder will be open or closed in photoshop. Default to True.

                •   parent -- Optional parent folder to move the newly created group into.

            Returns
                A Group object

            Raises
                ValueError -- If parent is None

        property open_folder: bool
            Returns True if the group is an open folder.

            Returns
                bool

        property right: int
            Right coordinate (computed from children, read-only).

        property top: int
            Top coordinate (computed from children, read-only).

  PixelLayer

    class psd_tools.api.layers.PixelLayer(parent: GroupMixin, record: LayerRecord <#psd_tools.psd.layer_and_mask.LayerRecord>, channels: ChannelDataList <#psd_tools.psd.layer_and_mask.ChannelDataList>)
        Layer that has rasterized image in pixels.

        Example:

                assert layer.kind == 'pixel':
                image = layer.composite()
                image.save('layer.png')

        classmethod frompil(image: Image, parent: GroupMixin, name: str = 'Layer', top: int = 0, left: int = 0, compression: Compression <#psd_tools.constants.Compression> = Compression.RLE, **kwargs: Any) -> PixelLayer <#psd_tools.api.layers.PixelLayer>
            Create a PixelLayer from a PIL image for a given psd file.

            Parameters

                •   image -- The Image object to convert to photoshop

                •   parent -- The parent group or PSDImage this layer belongs to.

                •   name -- The name of the layer. Defaults to "Layer"

                •   top -- Pixelwise offset from the top of the canvas for the new layer.

                •   left -- Pixelwise offset from the left of the canvas for the new layer.

                •   compression -- Compression algorithm to use for the data.

            Returns
                A PixelLayer object

            Raises

                •   TypeError -- If image is not a PIL Image

                •   ValueError -- If parent is None

        Note:
                If the image has an alpha channel and the parent PSD mode supports layer transparency (e.g. RGBA, LA), the alpha is stored as the layer transparency channel and no extra mask is created. For PSD modes that do not carry a transparency band (e.g. RGB, CMYK), the alpha channel is instead stored as a pixel mask (USER_LAYER_MASK).

  ShapeLayer

    class psd_tools.api.layers.ShapeLayer(*args: Any)
        Layer that has drawing in vector mask.

        property bbox: tuple[int, int, int, int]
            (left, top, right, bottom) tuple.

        property bottom: int
            Bottom coordinate.

            Returns
                int

        property left: int
            Left coordinate. Writable.

            Returns
                int

        property right: int
            Right coordinate.

            Returns
                int

        property top: int
            Top coordinate. Writable.

            Returns
                int

  SmartObjectLayer

    class psd_tools.api.layers.SmartObjectLayer(parent: GroupMixin, record: LayerRecord <#psd_tools.psd.layer_and_mask.LayerRecord>, channels: ChannelDataList <#psd_tools.psd.layer_and_mask.ChannelDataList>)
        Layer that inserts external data.

        Use smart_object attribute to get the external data. See SmartObject <#psd_tools.api.smart_object.SmartObject>.

        Example:

                import io
                so = layer.smart_object
                if so.detected_filetype == 'jpg':
                    # Use open(external_dir=...) when processing untrusted PSD files.
                    with so.open() as f:
                        image = Image.open(io.BytesIO(f.read()))

        property smart_object: SmartObject <#psd_tools.api.smart_object.SmartObject>
            Associated smart object.

            Returns
                SmartObject <#psd_tools.api.smart_object.SmartObject>.

  TypeLayer

    class psd_tools.api.layers.TypeLayer(*args: Any)
        Layer that has text and styling information for fonts or paragraphs.

        Text is accessible at text property. Styling information for paragraphs is in engine_dict. Document styling information such as font list is is resource_dict.

        Currently, textual information is read-only.

        Example:

                if layer.kind == 'type':
                    print(layer.text)
                    print(layer.engine_dict['StyleRun'])

                    # Extract font for each substring in the text.
                    text = layer.engine_dict['Editor']['Text'].value
                    fontset = layer.resource_dict['FontSet']
                    runlength = layer.engine_dict['StyleRun']['RunLengthArray']
                    rundata = layer.engine_dict['StyleRun']['RunArray']
                    index = 0
                    for length, style in zip(runlength, rundata):
                        substring = text[index:index + length]
                        stylesheet = style['StyleSheet']['StyleSheetData']
                        font = fontset[stylesheet['Font']]
                        print('%r gets %s' % (substring, font))
                        index += length

        property document_resources: Dict <#psd_tools.psd.engine_data.Dict>
            Resource set relevant to the document.

        property engine_dict: Dict <#psd_tools.psd.engine_data.Dict>
            Styling information dict.

        property font_names: list[str]
            List of PostScript font names used in this text layer.

            Convenience shortcut for:

                    [font.postscript_name for font in layer.typesetting.fonts]

        property resource_dict: Dict <#psd_tools.psd.engine_data.Dict>
            Resource set.

        property text: str
            Text in the layer. Read-only.

            Note:
                New-line character in Photoshop is '\r'.

        property text_type: TextType <#psd_tools.constants.TextType> | None
            Text type. Read-only.

            Returns

                •

                    psd_tools.constants.TextType.POINT <#psd_tools.constants.TextType.POINT> for point type text
                        (also known as character type)

                •

                    psd_tools.constants.TextType.PARAGRAPH <#psd_tools.constants.TextType.PARAGRAPH> for paragraph type text
                        (also known as area type)

                •   None if text type cannot be determined or information is unavailable

        See psd_tools.constants.TextType <#psd_tools.constants.TextType>.

        property transform: tuple[float, float, float, float, float, float]
            Matrix (xx, xy, yx, yy, tx, ty) applies affine transformation.

        property typesetting: TypeSetting
            Structured typographic data.

            Returns a TypeSetting object that provides Pythonic access to fonts, paragraphs, styled runs, and default styles without navigating raw engine data dicts.

            Example:

                    ts = layer.typesetting
                    for paragraph in ts:
                        print(paragraph.style.justification)
                        for run in paragraph.runs:
                            print(run.text, run.style.font_name, run.style.font_size)

        See also: engine_dict, resource_dict for raw data.

        property warp: DescriptorBlock | None
            Warp configuration.

  psd_tools.api.mask

Mask module.

Masks are used to determine the visible area of a layer. There are two types of masks: user mask and vector mask. User mask refers to any pixel-based mask, whereas vector mask refers to a mask from a shape path.

Masks are accessible from the layer's mask property:

            from psd_tools import PSDImage

            psdimage = PSDImage.open('example.psd')
            layer = psdimage[0]
            mask = layer.mask
            assert mask is not None
            print(mask.bbox)  # (left, top, right, bottom)

            mask_image = mask.topil()  # Show the mask as a PIL Image.
            if mask_image is not None:
                mask_image.save("mask.png")

To create a new mask, use the layer's create_mask() <#psd_tools.api.layers.Layer.create_mask> method:

            from psd_tools import PSDImage
            from PIL import Image

            psdimage = PSDImage.new(mode="RGB", size=(128, 128))
            layer = psdimage.create_pixel_layer(Image.new("RGB", (128, 128)))
            layer.create_mask(Image.new("L", (128, 128), 255))

Note that creating a pixel layer from RGBA image will automatically create a user mask:

            psdimage = PSDImage.new(mode="RGB", size=(128, 128))
            layer = psdimage.create_pixel_layer(Image.new("RGBA", (128, 128)))

  Mask

    class psd_tools.api.mask.Mask(layer: LayerProtocol)
        Mask data attached to a layer.

        There are two distinct internal mask data: user mask and vector mask. User mask refers any pixel-based mask whereas vector mask refers a mask from a shape path. Internally, two masks are combined and referred real mask.

        property background_color: int
            Background color.

        property bbox: tuple[int, int, int, int]
            BBox

        property bottom: int
            Bottom coordinate.

        property data: MaskData <#psd_tools.psd.layer_and_mask.MaskData>
            Return raw mask data, or None if no data.

        property disabled: bool
            Disabled.

        property flags: MaskFlags <#psd_tools.psd.layer_and_mask.MaskFlags>
            Flags.

        has_real() -> bool
            Return True if the mask has real flags.

        property height: int
            Height.

        property left: int
            Left coordinate.

        property parameters: Any
            Parameters.

        property real_flags: MaskFlags <#psd_tools.psd.layer_and_mask.MaskFlags> | None
            Real flag.

        property right: int
            Right coordinate.

        property size: tuple[int, int]
            (Width, Height) tuple.

        property top: int
            Top coordinate.

        topil(real: bool = True, layer_sized: bool = False, **kwargs: Any) -> Image | None
            Get PIL Image of the mask.

            Parameters

                •   real -- When True, returns pixel + vector mask combined.

                •   layer_sized -- When True, returns a layer-sized image pre-filled with background_color, with the mask data pasted at the correct position. When False (default), returns the raw stored mask data at mask dimensions.

            Returns
                PIL Image object, or None if the mask is empty.

        property width: int
            Width.

  psd_tools.api.shape

Shape module.

In PSD/PSB, shapes are all represented as VectorMask in each layer, and optionally there might be Origination object to control live shape properties and Stroke to specify how outline is stylized.

  VectorMask

    class psd_tools.api.shape.VectorMask(data: VectorMaskSetting <#psd_tools.psd.vector.VectorMaskSetting>)
        Vector mask data.

        Vector mask is a resolution-independent mask that consists of one or more Path objects. In Photoshop, all the path objects are represented as Bezier curves. Check paths property for how to deal with path objects.

        property bbox: tuple[float, float, float, float]
            Bounding box tuple (left, top, right, bottom) in relative coordinates, where top-left corner is (0., 0.) and bottom-right corner is (1., 1.).

            The bounding box accounts for the full extent of all cubic Bezier curves, not just the anchor points.

            Returns
                tuple

        property clipboard_record: ClipboardRecord <#psd_tools.psd.vector.ClipboardRecord> | None
            Clipboard record containing bounding box information.

            Depending on the Photoshop version, this field can be None.

        property disabled: bool
            If the mask is disabled.

        property initial_fill_rule: int
            Initial fill rule.

            When 0, fill inside of the path. When 1, fill outside of the shape.

            Returns
                int

        property inverted: bool
            Invert the mask.

        property not_linked: bool
            If the knots are not linked.

        property paths: list[Subpath <#psd_tools.psd.vector.Subpath>]
            List of Subpath <#psd_tools.psd.vector.Subpath>. Subpath is a list-like structure that contains one or more Knot <#psd_tools.psd.vector.Knot> items. Knot contains relative coordinates of control points for a Bezier curve. index <#psd_tools.psd.vector.Subpath.index> indicates which origination item the subpath belongs, and operation <#psd_tools.psd.vector.Subpath.operation> indicates how to combine multiple shape paths.

            In PSD, path fill rule is even-odd.

            Example:

                    for subpath in layer.vector_mask.paths:
                        anchors = [(
                            int(knot.anchor[1] * psd.width),
                            int(knot.anchor[0] * psd.height),
                        ) for knot in subpath]

            Returns
                List of Subpath.

  Stroke

    class psd_tools.api.shape.Stroke(data: VectorStrokeContentSetting <#psd_tools.psd.vector.VectorStrokeContentSetting>)
        Stroke contains decorative information for strokes.

        This is a thin wrapper around Descriptor <#psd_tools.psd.descriptor.Descriptor> structure. Check _data attribute to get the raw data.

        property blend_mode: Any
            Blend mode.

        property content: Any
            Fill effect.

        property enabled: bool
            If the stroke is enabled.

        property fill_enabled: bool
            If the stroke fill is enabled.

        property line_alignment: str
            Alignment, one of inner, outer, center.

        property line_cap_type: str
            Cap type, one of butt, round, square.

        property line_dash_offset: float
            Line dash offset in float.

            Returns
                float

        property line_dash_set: list
            Line dash set in list of UnitFloat.

            Returns
                list

        property line_join_type: str
            Join type, one of miter, round, bevel.

        property line_width: float
            Stroke width in float.

        property miter_limit: Any
            Miter limit in float.

        property opacity: Any
            Opacity value.

        property stroke_adjust: Any
            Stroke adjust

  Origination

Origination keeps live shape properties for some of the primitive shapes. Origination objects are accessible via origination <#psd_tools.api.layers.Layer.origination> property of layers. Following primitive shapes are defined: Invalidated, Line, Rectangle, Ellipse, and RoundedRectangle.

  Invalidated

    class psd_tools.api.shape.Invalidated(data: Descriptor <#psd_tools.psd.descriptor.Descriptor>)
        Invalidated live shape.

        This equals to a primitive shape that does not provide Live shape properties. Use VectorMask to access shape information instead of this origination object.

        property invalidated: bool
            bool

            Type
                return

  Line

    class psd_tools.api.shape.Line(data: Descriptor <#psd_tools.psd.descriptor.Descriptor>)
        Line live shape.

        property arrow_conc: int
            int

            Type
                return

        property arrow_end: bool
            Line arrow end.

            Returns
                bool

        property arrow_length: float
            Line arrow length.

            Returns
                float

        property arrow_start: bool
            Line arrow start.

            Returns
                bool

        property arrow_width: float
            Line arrow width.

            Returns
                float

        property bbox: tuple[float, float, float, float]
            Bounding box of the live shape.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property index: int
            Origination item index.

            Returns
                int

        property invalidated: bool
            bool

            Type
                return

        property line_end: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Line end.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property line_start: Descriptor <#psd_tools.psd.descriptor.Descriptor>
            Line start.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property line_weight: float
            Line weight

            Returns
                float

        property origin_type: int
            Type of the vector shape.

            •   1: Rectangle

            •   2: RoundedRectangle

            •   4: Line

            •   5: Ellipse

            Returns
                int

        property resolution: float
            Resolution.

            Returns
                float

  Ellipse

    class psd_tools.api.shape.Ellipse(data: Descriptor <#psd_tools.psd.descriptor.Descriptor>)
        Ellipse live shape.

        property bbox: tuple[float, float, float, float]
            Bounding box of the live shape.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property index: int
            Origination item index.

            Returns
                int

        property invalidated: bool
            bool

            Type
                return

        property origin_type: int
            Type of the vector shape.

            •   1: Rectangle

            •   2: RoundedRectangle

            •   4: Line

            •   5: Ellipse

            Returns
                int

        property resolution: float
            Resolution.

            Returns
                float

  Rectangle

    class psd_tools.api.shape.Rectangle(data: Descriptor <#psd_tools.psd.descriptor.Descriptor>)
        Rectangle live shape.

        property bbox: tuple[float, float, float, float]
            Bounding box of the live shape.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property index: int
            Origination item index.

            Returns
                int

        property invalidated: bool
            bool

            Type
                return

        property origin_type: int
            Type of the vector shape.

            •   1: Rectangle

            •   2: RoundedRectangle

            •   4: Line

            •   5: Ellipse

            Returns
                int

        property resolution: float
            Resolution.

            Returns
                float

  RoundedRectangle

    class psd_tools.api.shape.RoundedRectangle(data: Descriptor <#psd_tools.psd.descriptor.Descriptor>)
        Rounded rectangle live shape.

        property bbox: tuple[float, float, float, float]
            Bounding box of the live shape.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property index: int
            Origination item index.

            Returns
                int

        property invalidated: bool
            bool

            Type
                return

        property origin_type: int
            Type of the vector shape.

            •   1: Rectangle

            •   2: RoundedRectangle

            •   4: Line

            •   5: Ellipse

            Returns
                int

        property radii: Any
            Corner radii of rounded rectangles. The order is top-left, top-right, bottom-left, bottom-right.

            Returns
                Descriptor <#psd_tools.psd.descriptor.Descriptor>

        property resolution: float
            Resolution.

            Returns
                float

  psd_tools.api.smart_object

Smart object module.

  SmartObject

    class psd_tools.api.smart_object.SmartObject(layer: LayerProtocol)
        Smart object that represents embedded or external file.

        Smart objects are attached to SmartObjectLayer <#psd_tools.api.layers.SmartObjectLayer>.

        property data: bytes
            Embedded file content as bytes.

            For kind == 'data' this returns the bytes stored in the PSD without any filesystem access. For kind == 'external' this calls open() with no external_dir argument, which trusts fullPath from the PSD verbatim. Prefer open() with an explicit external_dir when processing untrusted files.

        property detected_filetype: str | None
            Best-effort file type, falling back when filetype is None.

            Resolution order:

            1.  filetype — the value stored in the PSD.

            2.  Extension taken from filename (lower-cased, dot stripped).

            3.  Magic-byte sniffing of the first few embedded bytes (only for kind == 'data'; external objects are not read from disk to keep this property side-effect-free).

        Warning:
                Steps 2 and 3 are heuristic. Do not use the result for security-sensitive decisions (e.g. deciding whether to execute content or trust a type boundary).

        property filename: str
            Original file name of the object.

        property filesize: int
            File size of the object.

        property filetype: str | None
            4-byte file-type code stored in the PSD, lowercased and stripped.

            Returns None when the field is absent or blank (e.g. some Adobe Illustrator smart objects store four spaces instead of a real type code). Use detected_filetype for a best-effort guess that falls back to the filename extension and magic bytes.

        is_psd() -> bool
            Return True if the file is embedded PSD/PSB.

            Checks the stored filetype first; if that is None (blank field), falls back to inspecting the first four magic bytes of the embedded data. The filename extension is intentionally not used as a fallback to avoid misclassifying non-PSD files named *.psd.

        property kind: str
            Kind of the link, 'data', 'alias', or 'external'.

        open(external_dir: str | PathLike | None = None) -> Iterator[IO[bytes]]
            Open the smart object as binary IO.

            Parameters
                external_dir -- Directory to resolve external paths against. When provided, a fullPath that resolves outside this directory is silently ignored and relPath is tried instead. A relPath that resolves outside this directory raises ValueError. Strongly recommended when processing untrusted PSD files.

        Example:

                    with layer.smart_object.open() as f:
                        data = f.read()

        property resolution: float
            Resolution of the object.

        save(filename: str | PathLike | None = None, directory: str | PathLike | None = None, external_dir: str | PathLike | None = None) -> None
            Save the smart object to a file.

            Parameters

                •   filename -- Explicit destination path. When provided it is used as-is and directory is ignored.

                •   directory -- Output directory used when filename is None. Defaults to the current working directory. The embedded basename is written inside this directory; path-traversal sequences in the embedded name are stripped automatically.

                •   external_dir -- Passed to open() when the smart object kind is 'external'. Constrains which paths on disk may be read. Strongly recommended when processing untrusted PSD files.

            Raises
                ValueError -- If the embedded name contains no safe basename, resolves outside directory, or (for external kind) the source path escapes external_dir.

        property transform_box: tuple[float, float, float, float, float, float, float, float] | None
            A tuple representing the coordinates of the smart objects's transformed box. This box is the result of one or more transformations such as scaling, rotation, translation, or skewing to the original bounding box of the smart object.

            The format of the tuple is as follows: (x1, y1, x2, y2, x3, y3, x4, y4)

            Where 1 is top left corner, 2 is top right, 3 is bottom right and 4 is bottom left.

        property unique_id: str
            UUID of the object.

        property warp: object | None
            Warp parameters.

  psd_tools.composite

Composite module for layer rendering and blending.

This subpackage provides the rendering engine for compositing PSD layers into raster images. It implements Photoshop's blend modes, layer effects, and vector shape rasterization.

Note: This module requires optional dependencies. Install with:

            pip install 'psd-tools[composite]'

Or using uv:

            uv sync --extra composite

The composite extra includes:

    •   aggdraw: For vector path and bezier curve rasterization

    •   scipy: For advanced image processing operations

    •   scikit-image: For morphological operations in effects

Key modules:

    •   psd_tools.composite.composite: Main compositing functions

    •   psd_tools.composite.blend: Blend mode implementations

    •   psd_tools.composite.effects: Layer effects (stroke, shadow, etc.)

    •   psd_tools.composite.vector: Vector shape and path rendering

    •   psd_tools.composite.paint: Fill rendering (gradients, patterns)

Example usage:

            from psd_tools import PSDImage

            psd = PSDImage.open('document.psd')

            # Composite entire document to PIL Image
            image = psd.composite()
            image.save('output.png')

            # Composite specific layer
            layer_image = psd[0].composite()

The compositing engine uses NumPy arrays for efficient pixel manipulation and supports all of Photoshop's standard blend modes including multiply, screen, overlay, soft light, and more.

Performance considerations:

    •   Compositing can be memory-intensive for large documents

    •   Vector shapes require aggdraw for accurate rendering

    •   Some effects have limited support compared to Photoshop

This module provides layer rendering and compositing functionality.

Installation: Requires optional dependencies:

            pip install psd-tools[composite]

Or with uv:

            uv sync --extra composite

  Composite Functions

    psd_tools.composite.composite(group: Layer <#psd_tools.api.layers.Layer> | PSDImage <#psd_tools.api.psd_image.PSDImage>, color: float | tuple[float, ...] | ndarray = 1.0, alpha: float | ndarray = 0.0, viewport: tuple[int, int, int, int] | None = None, layer_filter: Callable[[Layer <#psd_tools.api.layers.Layer>], bool] | None = None, force: bool = False, as_layer: bool = False) -> tuple[ndarray, ndarray, ndarray]
        Composite layers and return NumPy arrays.

        This function composites the given layer or document into NumPy arrays representing color, shape, and alpha channels. It applies layer blending, effects, masks, and clipping according to the PSD specification.

        Parameters

            •   group -- Layer or PSDImage to composite

            •   color -- Initial backdrop color (0.0-1.0, default: 1.0). Can be a scalar float applied to all channels, a tuple of per-channel values, or an ndarray.

            •   alpha -- Initial backdrop alpha (0.0-1.0, default: 0.0). Can be scalar or ndarray.

            •   viewport -- Bounding box (left, top, right, bottom) to composite. If None, uses layer bounds

            •   layer_filter -- Optional callable(layer) -> bool to filter which layers to composite

            •   force -- If True, force re-rendering of all layers including vector shapes and fills

            •   as_layer -- If True, treat the group as a layer (apply blend mode to backdrop)

        Returns

            •   color: RGB/CMYK/Grayscale values in range [0.0, 1.0]

            •   shape: Layer shape/coverage mask in range [0.0, 1.0]

            •   alpha: Composite alpha channel in range [0.0, 1.0]

        Return type
            Tuple of (color <#psd_tools.api.effects.DropShadow.color>, shape <#psd_tools.psd.image_resources.HalftoneScreen.shape>, alpha <#psd_tools.psd.image_resources.SliceV6.alpha>) as float32 ndarrays with shape (height <#psd_tools.PSDImage.height>, width <#psd_tools.PSDImage.width>, channels <#psd_tools.PSDImage.channels>)

    Examples

        >>> from psd_tools import PSDImage
        >>> psd = PSDImage.open('example.psd')
        >>> color, shape, alpha = composite(psd)
        >>> # Apply custom backdrop
        >>> color, shape, alpha = composite(psd, color=(1.0, 0.0, 0.0), alpha=1.0)
        >>> # Force re-render vector layers
        >>> color, shape, alpha = composite(psd, force=True)
        >>> # Composite only visible layers
        >>> color, shape, alpha = composite(psd, layer_filter=lambda l: l.visible)

    Note:

                •   Requires optional composite dependencies (aggdraw, scipy, scikit-image) for vector shape rendering, gradient fills, and layer effects.

                •   Adjustment layers have limited support.

                •   Text rendering is not supported (text layers show as raster if available).

    psd_tools.composite.composite_pil(layer: Layer <#psd_tools.api.layers.Layer> | PSDImage <#psd_tools.api.psd_image.PSDImage>, color: float | tuple[float, ...] | ndarray, alpha: float | ndarray, viewport: tuple[int, int, int, int] | None, layer_filter: Callable[[Layer <#psd_tools.api.layers.Layer>], bool] | None, force: bool, as_layer: bool = False, apply_icc: bool = True) -> Image | None
        Composite layers and return a PIL Image.

        This function composites the given layer or document into a PIL Image, applying blend modes, effects, and color management.

        Parameters

            •   layer -- Layer or PSDImage to composite

            •   color -- Initial backdrop color (0.0-1.0). Can be scalar, tuple, or ndarray

            •   alpha -- Initial backdrop alpha (0.0-1.0). Can be scalar or ndarray

            •   viewport -- Bounding box (left, top, right, bottom) to composite. If None, uses layer bounds

            •   layer_filter -- Optional callable to filter which layers to composite. Should return True to include

            •   force -- If True, force re-rendering of all layers (ignore cached pixels)

            •   as_layer -- If True, apply layer blend modes (default: False for document-level compositing)

            •   apply_icc -- If True, apply ICC profile color correction (default: True)

        Returns
            PIL Image with composited result, or None if viewport is empty

    Note:

                •   Requires optional composite dependencies (aggdraw, scipy, scikit-image)

                •   LAB and Duotone color modes have limited blending support

                •   Alpha channel handling varies by color mode

  Blend Modes

Blend mode implementations.

This module implements Photoshop's blend modes for compositing layers. Blend modes determine how a layer's colors interact with the layers beneath it. Each function implements the mathematical formula for a specific blend mode.

The blend functions operate on NumPy arrays with normalized float32 values (0.0-1.0) representing pixel color channels. They follow Adobe's PDF Blend Mode specification.

Blend mode categories:

Normal modes: - normal: Source replaces backdrop (no blending)

Darken modes: - darken: Selects darker of source and backdrop - multiply: Multiplies colors (darkens) - color_burn: Darkens backdrop to reflect source - linear_burn: Similar to multiply but more extreme - darker_color: Selects darker color (non-separable)

Lighten modes: - lighten: Selects lighter of source and backdrop - screen: Inverted multiply (lightens) - color_dodge: Brightens backdrop to reflect source - linear_dodge: Same as addition (Add blend mode) - lighter_color: Selects lighter color (non-separable)

Contrast modes: - overlay: Combination of multiply and screen - soft_light: Soft version of overlay - hard_light: Hard version of overlay - vivid_light: Combination of color dodge and burn - linear_light: Combination of linear dodge and burn - pin_light: Replaces colors based on brightness - hard_mix: Posterizes to primary colors

Inversion modes: - difference: Absolute difference between colors - exclusion: Similar to difference but lower contrast

Component modes (non-separable): - hue: Preserves luminosity and saturation, replaces hue - saturation: Preserves luminosity and hue, replaces saturation - color: Preserves luminosity, replaces hue and saturation - luminosity: Preserves hue and saturation, replaces luminosity

Implementation details:

    •   Separable blend modes process each color channel independently

    •   Non-separable modes convert to HSL color space first

    •   All functions expect normalized float32 arrays (0.0-1.0 range)

    •   Division by zero is protected with small epsilon values

Example usage:

            import numpy as np
            from psd_tools.composite.blend import multiply, screen

            # Create backdrop and source colors (normalized)
            backdrop = np.array([0.5, 0.3, 0.8], dtype=np.float32)
            source = np.array([0.7, 0.6, 0.2], dtype=np.float32)

            # Apply blend mode
            result = multiply(backdrop, source)
            # Result: [0.35, 0.18, 0.16]

The BLEND_FUNC dictionary maps BlendMode <#psd_tools.constants.BlendMode> enums to their corresponding functions for easy lookup during compositing.

    psd_tools.composite.blend.divide(Cb: ndarray, Cs: ndarray) -> ndarray
        Looks at the color information in each channel and divides the blend color from the base color.

    psd_tools.composite.blend.hard_mix(Cb: ndarray, Cs: ndarray) -> ndarray
        Adds the red, green and blue channel values of the blend color to the RGB values of the base color. If the resulting sum for a channel is 255 or greater, it receives a value of 255; if less than 255, a value of 0. Therefore, all blended pixels have red, green, and blue channel values of either 0 or 255. This changes all pixels to primary additive colors (red, green, or blue), white, or black.

    psd_tools.composite.blend.hsl2hsv(img: ndarray) -> ndarray
        Convert an HSL image to HSV space using vectorized arrays.

    psd_tools.composite.blend.hsl2rgb(img: ndarray) -> ndarray
        Convert an HSL image to RGB space using vectorized arrays.

    psd_tools.composite.blend.hsv2hsl(img: ndarray) -> ndarray
        Convert an HSV image to HSL space using vectorized arrays.

    psd_tools.composite.blend.linear_light(Cb: ndarray, Cs: ndarray) -> ndarray
        Burns or dodges the colors by decreasing or increasing the brightness, depending on the blend color. If the blend color (light source) is lighter than 50% gray, the image is lightened by increasing the brightness. If the blend color is darker than 50% gray, the image is darkened by decreasing the brightness.

    psd_tools.composite.blend.non_separable(k: str = 's')
        Wrap non-separable blending function for CMYK handling.

    psd_tools.composite.blend.pin_light(Cb: ndarray, Cs: ndarray) -> ndarray
        Replaces the colors, depending on the blend color. If the blend color (light source) is lighter than 50% gray, pixels darker than the blend color are replaced, and pixels lighter than the blend color do not change. If the blend color is darker than 50% gray, pixels lighter than the blend color are replaced, and pixels darker than the blend color do not change. This is useful for adding special effects to an image.

    psd_tools.composite.blend.rgb2hsl(img: ndarray) -> ndarray
        Convert an RGB image to HSL space using vectorized arrays.

    psd_tools.composite.blend.vivid_light(Cb: ndarray, Cs: ndarray) -> ndarray
        Burns or dodges the colors by increasing or decreasing the contrast, depending on the blend color. If the blend color (light source) is lighter than 50% gray, the image is lightened by decreasing the contrast. If the blend color is darker than 50% gray, the image is darkened by increasing the contrast.

The blend module implements Photoshop's blend modes following the Adobe PDF specification. All blend functions operate on normalized float32 NumPy arrays.

  Vector Rendering

Vector shapes and path operations for compositing.

    psd_tools.composite.vector.draw_stroke(layer: Layer <#psd_tools.api.layers.Layer>) -> ndarray
        Draw a stroke.

        Requires aggdraw for bezier curve rasterization.

    psd_tools.composite.vector.draw_vector_mask(layer: Layer <#psd_tools.api.layers.Layer>) -> ndarray
        Draw a vector mask.

        Requires aggdraw for bezier curve rasterization.

Vector shape and path rendering using aggdraw for bezier curve rasterization.

  Effects Rendering

Layer effects rendering.

This module implements rendering for Photoshop layer effects (also known as layer styles). Effects are non-destructive visual enhancements applied to layers such as strokes, shadows, glows, and overlays.

Note: Effects rendering requires scikit-image. Install with:

            pip install 'psd-tools[composite]'

Currently supported effects:

    •   Stroke: Outline around layer shape or pixels - Supports solid color, gradient, and pattern fills - Position: inside, outside, or centered - Limited compared to Photoshop's full implementation

Partially supported or limited effects:

    •   Drop shadow, inner shadow, outer glow, inner glow

    •   These may render but with reduced accuracy

The main function draw_stroke_effect() handles stroke rendering by:

    1.  Extracting the layer's alpha channel or shape mask

    2.  Applying morphological operations (dilation/erosion) based on stroke size and position

    3.  Filling the stroke region with the specified paint (solid color, gradient, pattern)

    4.  Returning the rendered stroke as a NumPy array

Implementation notes:

    •   Effects are image-based rather than vector-based, which may differ from Photoshop

    •   For layers with vector paths, ideally strokes should be drawn geometrically

    •   Some effect parameters may not be fully supported

    •   Complex effect combinations may not render identically to Photoshop

Example usage (internal):

            from psd_tools.composite.effects import draw_stroke_effect

            # Called during layer compositing
            viewport = (0, 0, 100, 100)  # Region to render
            shape = layer_alpha_channel    # NumPy array
            desc = stroke_descriptor       # Effect parameters

            color, alpha = draw_stroke_effect(viewport, shape, desc, psd)

The effects system integrates with the main compositing pipeline and is automatically applied when rendering layers that have effects enabled.

Layer effects rendering including strokes, shadows, and glows. Requires scikit-image for morphological operations.

  psd_tools.compression

Image compression utilities for PSD channel data.

This subpackage provides compression and decompression codecs for raw pixel data in PSD files. Adobe Photoshop supports multiple compression methods for channel data to reduce file size.

Supported compression methods:

    •   RAW (Compression.RAW): Uncompressed raw pixel data

    •   RLE (Compression.RLE): Apple PackBits run-length encoding

    •   ZIP (Compression.ZIP): ZIP/Deflate compression without prediction

    •   ZIP_WITH_PREDICTION (Compression.ZIP_WITH_PREDICTION): ZIP with delta encoding

The RLE codec includes both a pure Python implementation and a Cython-optimized version (_rle.pyx) that provides significant performance improvements. The Cython version is used automatically when available, with graceful fallback to pure Python.

Key functions:

    •   compress(): Compress raw pixel data using specified method

    •   decompress(): Decompress pixel data back to raw bytes

    •   encode_rle(): RLE encoding for a single channel

    •   decode_rle(): RLE decoding for a single channel

Example usage:

            from psd_tools.compression import compress, decompress
            from psd_tools.constants import Compression

            # Compress raw channel data
            compressed = compress(
                data=raw_pixels,
                compression=Compression.RLE,
                width=100,
                height=100,
                depth=8,
                version=1
            )

            # Decompress back to raw data
            raw_pixels = decompress(
                data=compressed,
                compression=Compression.RLE,
                width=100,
                height=100,
                depth=8,
                version=1
            )

Performance notes:

    •   RLE is most effective for images with large uniform areas

    •   ZIP with prediction works well for continuous-tone images

    •   The Cython RLE codec can be 10-100x faster than pure Python

    •   Compression method is chosen per-channel when saving PSD files

The compression module handles various bit depths (8, 16, 32-bit per channel) and implements delta encoding for improved compression ratios on certain image types.

This module provides compression and decompression codecs for PSD channel data.

  Compression Functions

    psd_tools.compression.compress(data: bytes, compression: Compression <#psd_tools.constants.Compression>, width: int, height: int, depth: int, version: int = 1) -> bytes
        Compress raw data.

        Parameters

            •   data -- raw data bytes to write.

            •   compression -- compression type, see Compression <#psd_tools.constants.Compression>.

            •   width -- width.

            •   height -- height.

            •   depth -- bit depth of the pixel.

            •   version -- psd file version.

        Returns
            compressed data bytes.

    psd_tools.compression.decompress(data: bytes, compression: Compression <#psd_tools.constants.Compression>, width: int, height: int, depth: int, version: int = 1) -> bytes
        Decompress raw data.

        Parameters

            •   data -- compressed data bytes.

            •   compression -- compression type, see Compression <#psd_tools.constants.Compression>.

            •   width -- width in pixels; must be in [1, 300000].

            •   height -- height in pixels; must be in [1, 300000].

            •   depth -- bit depth of the pixel; must be one of 1, 8, 16, 32.

            •   version -- psd file version.

        Returns
            decompressed data bytes.

        Raises
            ValueError -- if width, height, or depth are out of range.

  RLE Codec

    psd_tools.compression.encode_rle(data: bytes, width: int, height: int, depth: int, version: int) -> bytes

    psd_tools.compression.decode_rle(data: bytes, width: int, height: int, depth: int, version: int) -> bytes

The RLE (Run-Length Encoding) codec implements Apple PackBits compression. A Cython-optimized version (_rle.pyx) is used when available, providing 10-100x performance improvement over the pure Python fallback.

  Prediction Encoding

    psd_tools.compression.encode_prediction(data: bytes | bytearray, w: int, h: int, depth: int) -> bytes

    psd_tools.compression.decode_prediction(data: bytes, w: int, h: int, depth: int) -> bytes

Prediction encoding applies delta compression before ZIP compression, improving compression ratios for continuous-tone images. Supports 8, 16, and 32-bit depths.

  psd_tools.constants

Various constants for psd_tools

  BlendMode

    class psd_tools.constants.BlendMode(*values)
        Blend modes.

        COLOR = b'colr'

        COLOR_BURN = b'idiv'

        COLOR_DODGE = b'div '

        DARKEN = b'dark'

        DARKER_COLOR = b'dkCl'

        DIFFERENCE = b'diff'

        DISSOLVE = b'diss'

        DIVIDE = b'fdiv'

        EXCLUSION = b'smud'

        HARD_LIGHT = b'hLit'

        HARD_MIX = b'hMix'

        HUE = b'hue '

        LIGHTEN = b'lite'

        LIGHTER_COLOR = b'lgCl'

        LINEAR_BURN = b'lbrn'

        LINEAR_DODGE = b'lddg'

        LINEAR_LIGHT = b'lLit'

        LUMINOSITY = b'lum '

        MULTIPLY = b'mul '

        NORMAL = b'norm'

        OVERLAY = b'over'

        PASS_THROUGH = b'pass'

        PIN_LIGHT = b'pLit'

        SATURATION = b'sat '

        SCREEN = b'scrn'

        SOFT_LIGHT = b'sLit'

        SUBTRACT = b'fsub'

        VIVID_LIGHT = b'vLit'

  ChannelID

    class psd_tools.constants.ChannelID(*values)
        Channel types.

        CHANNEL_0 = 0

        CHANNEL_1 = 1

        CHANNEL_2 = 2

        CHANNEL_3 = 3

        CHANNEL_4 = 4

        CHANNEL_5 = 5

        CHANNEL_6 = 6

        CHANNEL_7 = 7

        CHANNEL_8 = 8

        CHANNEL_9 = 9

        REAL_USER_LAYER_MASK = -3

        TRANSPARENCY_MASK = -1

        USER_LAYER_MASK = -2

  Clipping

    class psd_tools.constants.Clipping(*values)
        Clipping.

        BASE = 0

        NON_BASE = 1

  ColorMode

    class psd_tools.constants.ColorMode(*values)
        Color mode.

        BITMAP = 0

        CMYK = 4

        DUOTONE = 8

        GRAYSCALE = 1

        INDEXED = 2

        LAB = 9

        MULTICHANNEL = 7

        RGB = 3

        static channels(value: ColorMode <#psd_tools.constants.ColorMode>, alpha: bool = False) -> int

  ColorSpaceID

    class psd_tools.constants.ColorSpaceID(*values)
        Color space types.

        CMYK = 2

        GRAYSCALE = 8

        HSB = 1

        LAB = 7

        RGB = 0

  CompatibilityMode

    class psd_tools.constants.CompatibilityMode(*values)
        Compatibility modes that describe how compositing and layer control should attempt to behave.

        CLIP_STUDIO_PAINT = 3

        DEFAULT = 1

        GIMP = 4

        KRITA = 5

        PAINT_TOOL_SAI = 2

        PHOTOSHOP = 1

  Compression

    class psd_tools.constants.Compression(*values)
        Compression modes.

        Compression. 0 = Raw Data, 1 = RLE compressed, 2 = ZIP without prediction, 3 = ZIP with prediction.

        RAW = 0

        RLE = 1

        ZIP = 2

        ZIP_WITH_PREDICTION = 3

  EffectOSType

    class psd_tools.constants.EffectOSType(*values)
        OS Type keys for Layer Effects.

        BEVEL = b'bevl'

        COMMON_STATE = b'cmnS'

        DROP_SHADOW = b'dsdw'

        INNER_GLOW = b'iglw'

        INNER_SHADOW = b'isdw'

        OUTER_GLOW = b'oglw'

        SOLID_FILL = b'sofi'

  GlobalLayerMaskKind

    class psd_tools.constants.GlobalLayerMaskKind(*values)
        Global layer mask kind.

        COLOR_PROTECTED = 1

        COLOR_SELECTED = 0

        PER_LAYER = 128

  LinkedLayerType

    class psd_tools.constants.LinkedLayerType(*values)
        Linked layer types.

        ALIAS = b'liFA'

        DATA = b'liFD'

        EXTERNAL = b'liFE'

  PathResourceID

    class psd_tools.constants.PathResourceID(*values)

        CLIPBOARD = 7

        CLOSED_KNOT_LINKED = 1

        CLOSED_KNOT_UNLINKED = 2

        CLOSED_LENGTH = 0

        INITIAL_FILL = 8

        OPEN_KNOT_LINKED = 4

        OPEN_KNOT_UNLINKED = 5

        OPEN_LENGTH = 3

        PATH_FILL = 6

  PlacedLayerType

    class psd_tools.constants.PlacedLayerType(*values)

        IMAGE_STACK = 3

        RASTER = 2

        UNKNOWN = 0

        VECTOR = 1

  PrintScaleStyle

    class psd_tools.constants.PrintScaleStyle(*values)
        Print scale style.

        CENTERED = 0

        SIZE_TO_FIT = 1

        USER_DEFINED = 2

  Resource

    class psd_tools.constants.Resource(*values)
        Image resource keys.

        Note the following is not defined for performance reasons.

                •   PATH_INFO_10 to PATH_INFO_989 corresponding to 2010 - 2989

                •

                    PLUGIN_RESOURCES_10 to PLUGIN_RESOURCES_989 corresponding to
                        4010 - 4989

        ALPHA_IDENTIFIERS = 1053

        ALPHA_NAMES_PASCAL = 1006

        ALPHA_NAMES_UNICODE = 1045

        ALTERNATE_DUOTONE_COLORS = 1066

        ALTERNATE_SPOT_COLORS = 1067

        AUTO_SAVE_FILE_PATH = 1086

        AUTO_SAVE_FORMAT = 1087

        BACKGROUND_COLOR = 1010

        BORDER_INFO = 1009

        CAPTION_DIGEST = 1061

        CAPTION_PASCAL = 1008

        CLIPPING_PATH_NAME = 2999

        COLOR_HALFTONING_INFO = 1013

        COLOR_SAMPLERS_RESOURCE = 1073

        COLOR_SAMPLERS_RESOURCE_OBSOLETE = 1038

        COLOR_TRANSFER_FUNCTION = 1016

        COPYRIGHT_FLAG = 1034

        COUNT_INFO = 1080

        DISPLAY_INFO = 1077

        DISPLAY_INFO_OBSOLETE = 1007

        DUOTONE_HALFTONING_INFO = 1014

        DUOTONE_IMAGE_INFO = 1018

        DUOTONE_TRANSFER_FUNCTION = 1017

        EFFECTIVE_BW = 1019

        EFFECTS_VISIBLE = 1042

        EPS_OPTIONS = 1021

        EXIF_DATA_1 = 1058

        EXIF_DATA_3 = 1059

        GLOBAL_ALTITUDE = 1049

        GLOBAL_ANGLE = 1037

        GRAYSCALE_HALFTONING_INFO = 1012

        GRAYSCALE_TRANSFER_FUNCTION = 1015

        GRID_AND_GUIDES_INFO = 1032

        HDR_TONING_INFO = 1070

        ICC_PROFILE = 1039

        ICC_UNTAGGED_PROFILE = 1041

        IDS_SEED_NUMBER = 1044

        IMAGE_MODE_RAW = 1029

        IMAGE_READY_7_ROLLOVER_EXPANDED_STATE = 7003

        IMAGE_READY_DATA_SETS = 7001

        IMAGE_READY_DEFAULT_SELECTED_STATE = 7002

        IMAGE_READY_ROLLOVER_EXPANDED_STATE = 7004

        IMAGE_READY_SAVE_LAYER_SETTINGS = 7005

        IMAGE_READY_VARIABLES = 7000

        IMAGE_READY_VERSION = 7006

        INDEXED_COLOR_TABLE_COUNT = 1046

        IPTC_NAA = 1028

        JPEG_QUALITY = 1030

        JUMP_TO_XPEP = 1052

        LAYER_COMPS = 1065

        LAYER_GROUPS_ENABLED_ID = 1072

        LAYER_GROUP_INFO = 1026

        LAYER_SELECTION_IDS = 1069

        LAYER_STATE_INFO = 1024

        LIGHTROOM_WORKFLOW = 8000

        MAC_NSPRINTINFO = 1084

        MAC_PAGE_FORMAT_INFO = 1002

        MAC_PRINT_MANAGER_INFO = 1001

        MEASUREMENT_SCALE = 1074

        OBSOLETE1 = 1000

        OBSOLETE2 = 1003

        OBSOLETE3 = 1020

        OBSOLETE4 = 1023

        OBSOLETE5 = 1027

        ONION_SKINS = 1078

        ORIGIN_PATH_INFO = 3000

        PATH_INFO_0 = 2000

        PATH_INFO_1 = 2001

        PATH_INFO_2 = 2002

        PATH_INFO_3 = 2003

        PATH_INFO_4 = 2004

        PATH_INFO_5 = 2005

        PATH_INFO_6 = 2006

        PATH_INFO_7 = 2007

        PATH_INFO_8 = 2008

        PATH_INFO_9 = 2009

        PATH_INFO_990 = 2990

        PATH_INFO_991 = 2991

        PATH_INFO_992 = 2992

        PATH_INFO_993 = 2993

        PATH_INFO_994 = 2994

        PATH_INFO_995 = 2995

        PATH_INFO_996 = 2996

        PATH_INFO_997 = 2997

        PATH_SELECTION_STATE = 1088

        PIXEL_ASPECT_RATIO = 1064

        PLUGIN_RESOURCE_0 = 4000

        PLUGIN_RESOURCE_1 = 4001

        PLUGIN_RESOURCE_2 = 4002

        PLUGIN_RESOURCE_3 = 4003

        PLUGIN_RESOURCE_4 = 4004

        PLUGIN_RESOURCE_4990 = 4990

        PLUGIN_RESOURCE_4991 = 4991

        PLUGIN_RESOURCE_4992 = 4992

        PLUGIN_RESOURCE_4993 = 4993

        PLUGIN_RESOURCE_4994 = 4994

        PLUGIN_RESOURCE_4995 = 4995

        PLUGIN_RESOURCE_4996 = 4996

        PLUGIN_RESOURCE_4997 = 4997

        PLUGIN_RESOURCE_4998 = 4998

        PLUGIN_RESOURCE_4999 = 4990

        PLUGIN_RESOURCE_5 = 4005

        PLUGIN_RESOURCE_6 = 4006

        PLUGIN_RESOURCE_7 = 4007

        PLUGIN_RESOURCE_8 = 4008

        PLUGIN_RESOURCE_9 = 4009

        PRINT_FLAGS = 1011

        PRINT_FLAGS_INFO = 10000

        PRINT_INFO_CS2 = 1071

        PRINT_INFO_CS5 = 1082

        PRINT_SCALE = 1062

        PRINT_STYLE = 1083

        QUICK_MASK_INFO = 1022

        RESOLUTION_INFO = 1005

        SHEET_DISCLOSURE = 1076

        SLICES = 1050

        SPOT_HALFTONE = 1043

        THUMBNAIL_RESOURCE = 1036

        THUMBNAIL_RESOURCE_PS4 = 1033

        TIMELINE_INFO = 1075

        TRANSPARENCY_INDEX = 1047

        URL = 1035

        URL_LIST = 1054

        VERSION_INFO = 1057

        WATERMARK = 1040

        WINDOWS_DEVMODE = 1085

        WORKFLOW_URL = 1051

        WORKING_PATH = 1025

        XMP_METADATA = 1060

        static is_path_info(value: int) -> bool

        static is_plugin_resource(value: int) -> bool

  SectionDivider

    class psd_tools.constants.SectionDivider(*values)

        BOUNDING_SECTION_DIVIDER = 3

        CLOSED_FOLDER = 2

        OPEN_FOLDER = 1

        OTHER = 0

  Tag

    class psd_tools.constants.Tag(*values)
        Tagged blocks keys.

        ALPHA = b'Alph'

        ANIMATION_EFFECTS = b'anFX'

        ANNOTATIONS = b'Anno'

        ARTBOARD_DATA1 = b'artb'

        ARTBOARD_DATA2 = b'artd'

        ARTBOARD_DATA3 = b'abdd'

        BLACK_AND_WHITE = b'blwh'

        BLEND_CLIPPING_ELEMENTS = b'clbl'

        BLEND_FILL_OPACITY = b'iOpa'

        BLEND_INTERIOR_ELEMENTS = b'infx'

        BRIGHTNESS_AND_CONTRAST = b'brit'

        CAI = b'CAI '

        CHANNEL_BLENDING_RESTRICTIONS_SETTING = b'brst'

        CHANNEL_MIXER = b'mixr'

        COLOR_BALANCE = b'blnc'

        COLOR_LOOKUP = b'clrL'

        COMPOSITOR_INFO = b'cinf'

        CONTENT_GENERATOR_EXTRA_DATA = b'CgEd'

        CURVES = b'curv'

        EFFECTS_LAYER = b'lrFX'

        EXPORT_SETTING1 = b'extd'

        EXPORT_SETTING2 = b'extn'

        EXPOSURE = b'expA'

        FILTER_EFFECTS1 = b'FXid'

        FILTER_EFFECTS2 = b'FEid'

        FILTER_EFFECTS3 = b'FELS'

        FILTER_MASK = b'FMsk'

        FOREIGN_EFFECT_ID = b'ffxi'

        FRAMED_GROUP = b'frgb'

        GENI = b'GenI'

        GRADIENT_FILL_SETTING = b'GdFl'

        GRADIENT_MAP = b'grdm'

        HUE_SATURATION = b'hue2'

        HUE_SATURATION_V4 = b'hue '

        INVERT = b'nvrt'

        KNOCKOUT_SETTING = b'knko'

        LAYER = b'Layr'

        LAYER_16 = b'Lr16'

        LAYER_32 = b'Lr32'

        LAYER_ID = b'lyid'

        LAYER_MASK_AS_GLOBAL_MASK = b'lmgm'

        LAYER_NAME_SOURCE_SETTING = b'lnsr'

        LAYER_VERSION = b'lyvr'

        LEVELS = b'levl'

        LINKED_LAYER1 = b'lnkD'

        LINKED_LAYER2 = b'lnk2'

        LINKED_LAYER3 = b'lnk3'

        LINKED_LAYER_EXTERNAL = b'lnkE'

        METADATA_SETTING = b'shmd'

        NESTED_SECTION_DIVIDER_SETTING = b'lsdk'

        OBJECT_BASED_EFFECTS_LAYER_INFO = b'lfx2'

        OBJECT_BASED_EFFECTS_LAYER_INFO_V0 = b'lmfx'

        OBJECT_BASED_EFFECTS_LAYER_INFO_V1 = b'lfxs'

        OCIO = b'OCIO'

        PATT = b'patt'

        PATTERNS1 = b'Patt'

        PATTERNS2 = b'Pat2'

        PATTERNS3 = b'Pat3'

        PATTERN_DATA = b'shpa'

        PATTERN_FILL_SETTING = b'PtFl'

        PHOTO_FILTER = b'phfl'

        PIXEL_SOURCE_DATA1 = b'PxSc'

        PIXEL_SOURCE_DATA2 = b'PxSD'

        PLACED_LAYER1 = b'plLd'

        PLACED_LAYER2 = b'PlLd'

        POSTERIZE = b'post'

        PROTECTED_SETTING = b'lspf'

        REFERENCE_POINT = b'fxrp'

        SAVING_MERGED_TRANSPARENCY = b'Mtrn'

        SAVING_MERGED_TRANSPARENCY16 = b'Mt16'

        SAVING_MERGED_TRANSPARENCY32 = b'Mt32'

        SECTION_DIVIDER_SETTING = b'lsct'

        SELECTIVE_COLOR = b'selc'

        SHEET_COLOR_SETTING = b'lclr'

        SMART_OBJECT_LAYER_DATA1 = b'SoLd'

        SMART_OBJECT_LAYER_DATA2 = b'SoLE'

        SOLID_COLOR_SHEET_SETTING = b'SoCo'

        TEXT_ENGINE_DATA = b'Txt2'

        THRESHOLD = b'thrs'

        TRANSPARENCY_SHAPES_LAYER = b'tsly'

        TYPE_TOOL_INFO = b'tySh'

        TYPE_TOOL_OBJECT_SETTING = b'TySh'

        UNICODE_LAYER_NAME = b'luni'

        UNICODE_PATH_NAME = b'pths'

        USER_MASK = b'LMsk'

        USING_ALIGNED_RENDERING = b'sn2P'

        VECTOR_MASK_AS_GLOBAL_MASK = b'vmgm'

        VECTOR_MASK_SETTING1 = b'vmsk'

        VECTOR_MASK_SETTING2 = b'vsms'

        VECTOR_ORIGINATION_DATA = b'vogk'

        VECTOR_ORIGINATION_UNKNOWN = b'vowv'

        VECTOR_STROKE_CONTENT_DATA = b'vscg'

        VECTOR_STROKE_DATA = b'vstk'

        VIBRANCE = b'vibA'

  TextType

    class psd_tools.constants.TextType(*values)
        Type of text

        PARAGRAPH = 1

        POINT = 0

  psd_tools.psd

Low-level API that translates binary data to Python structure.

All the data structure in this subpackage inherits from one of the object defined in psd_tools.psd.base <#module-psd_tools.psd.base> module.

  PSD

    class psd_tools.psd.PSD(header: FileHeader <#psd_tools.psd.header.FileHeader> = NOTHING, color_mode_data: ColorModeData <#psd_tools.psd.color_mode_data.ColorModeData> = NOTHING, image_resources: ImageResources <#psd_tools.psd.image_resources.ImageResources> = NOTHING, layer_and_mask_information: LayerAndMaskInformation <#psd_tools.psd.layer_and_mask.LayerAndMaskInformation> = NOTHING, image_data: ImageData <#psd_tools.psd.image_data.ImageData> = NOTHING)
        Low-level PSD file structure that resembles the specification <https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/>.

        Example:

                from psd_tools.psd import PSD

                with open(input_file, 'rb') as f:
                    psd = PSD.read(f)

                with open(output_file, 'wb') as f:
                    psd.write(f)

        header
            See FileHeader <#psd_tools.psd.header.FileHeader>.

        color_mode_data
            See ColorModeData <#psd_tools.psd.color_mode_data.ColorModeData>.

        image_resources
            See ImageResources <#psd_tools.psd.image_resources.ImageResources>.

        layer_and_mask_information
            See LayerAndMaskInformation <#psd_tools.psd.layer_and_mask.LayerAndMaskInformation>.

        image_data
            See ImageData <#psd_tools.psd.image_data.ImageData>.

  psd_tools.psd.base

Base data structures intended for inheritance.

All the data objects in this subpackage inherit from the base classes here. That means, all the data structures in the psd_tools.psd <#module-psd_tools.psd> subpackage implements the methods of BaseElement for serialization and decoding.

Objects that inherit from the BaseElement typically gets attrs <https://www.attrs.org/en/stable/index.html> decoration to have data fields.

  BaseElement

    class psd_tools.psd.base.BaseElement
        Base element of various PSD file structs. All the data objects in psd_tools.psd <#module-psd_tools.psd> subpackage inherit from this class.

        classmethod read(cls, fp)
            Read the element from a file-like object.

        write(self, fp)
            Write the element to a file-like object.

        classmethod frombytes(self, data, *args, **kwargs)
            Read the element from bytes.

        tobytes(self, *args, **kwargs)
            Write the element to bytes.

        validate(self)
            Validate the attribute.

  EmptyElement

    class psd_tools.psd.base.EmptyElement
        Empty element that does not have a value.

  ValueElement

    class psd_tools.psd.base.ValueElement(value: object = None)
        Single value wrapper that has a value attribute.

        Pretty printing shows the internal value by default. Inherit with @define(repr=False) decorator to keep this behavior.

        value
            Internal value.

  NumericElement

    class psd_tools.psd.base.NumericElement(value=0.0)
        Single value element that has a numeric value attribute.

  IntegerElement

    class psd_tools.psd.base.IntegerElement(value=0)
        Single integer value element that has a value attribute.

        Use with @define(repr=False) decorator.

  ShortIntegerElement

    class psd_tools.psd.base.ShortIntegerElement(value=0)
        Single short integer element that has a value attribute.

        Use with @define(repr=False) decorator.

  ByteElement

    class psd_tools.psd.base.ByteElement(value=0)
        Single 1-byte integer element that has a value attribute.

        Use with @define(repr=False) decorator.

  BooleanElement

    class psd_tools.psd.base.BooleanElement(value=False)
        Single bool value element that has a value attribute.

        Use with @define(repr=False) decorator.

  StringElement

    class psd_tools.psd.base.StringElement(value: str = '')
        Single unicode string.

        value
            str value

  ListElement

    class psd_tools.psd.base.ListElement(items=NOTHING)
        List-like element that has items list.

  DictElement

    class psd_tools.psd.base.DictElement(items=NOTHING)
        Dict-like element that has items OrderedDict.

  psd_tools.psd.color_mode_data

Color mode data structure.

  ColorModeData

    class psd_tools.psd.color_mode_data.ColorModeData(value: bytes = b'')
        Color mode data section of the PSD file.

        For indexed color images the data is the color table for the image in a non-interleaved order.

        Duotone images also have this data, but the data format is undocumented.

        interleave() -> bytes
            Returns interleaved color table in bytes.

  psd_tools.psd.descriptor

Descriptor data structure.

Descriptors are basic data structure used throughout PSD files. Descriptor is one kind of serialization protocol for data objects, and enum classes in psd_tools.terminology <#module-psd_tools.terminology> or bytes indicates what kind of descriptor it is.

The class ID can be pre-defined enum if the tag is 4-byte length or plain bytes if the length is arbitrary. They depend on the internal version of Adobe Photoshop but the detail is unknown.

Pretty printing is the best approach to check the descriptor content:

            from IPython.pretty import pprint
            pprint(descriptor)

  Alias

    class psd_tools.psd.descriptor.Alias(value: bytes = b'\x00\x00\x00\x00')
        Alias structure equivalent to RawData.

  Bool

    class psd_tools.psd.descriptor.Bool(value=False)
        Bool structure.

        value
            bool value

  Class

    class psd_tools.psd.descriptor.Class(name: str = '', classID: bytes = b'\x00\x00\x00\x00')
        Class structure.

        name
            str value

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

  Class1

    class psd_tools.psd.descriptor.Class1(name: str = '', classID: bytes = b'\x00\x00\x00\x00')
        Class structure equivalent to Class.

  Class2

    class psd_tools.psd.descriptor.Class2(name: str = '', classID: bytes = b'\x00\x00\x00\x00')
        Class structure equivalent to Class.

  Class3

    class psd_tools.psd.descriptor.Class3(name: str = '', classID: bytes = b'\x00\x00\x00\x00')
        Class structure equivalent to Class.

  Descriptor

    class psd_tools.psd.descriptor.Descriptor(items=NOTHING, name: str = '', classID: bytes = b'null')
        Dict-like descriptor structure.

        Key values can be 4-character bytes in Key <#psd_tools.terminology.Key> or arbitrary length bytes. Supports direct access by Key <#psd_tools.terminology.Key>.

        Example:

                from psd_tools.terminology import Key

                descriptor[Key.Enabled]

                for key in descriptor:
                    print(descriptor[key])

        name
            str

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

  Double

    class psd_tools.psd.descriptor.Double(value=0.0)
        Double structure.

        value
            float value

  Enumerated

    class psd_tools.psd.descriptor.Enumerated(typeID: bytes = b'\x00\x00\x00\x00', enum: bytes = b'\x00\x00\x00\x00')
        Enum structure.

        typeID
            bytes in Type <#psd_tools.terminology.Type>

        enum
            bytes in Enum <#psd_tools.terminology.Enum>

        get_name() -> str
            Get enum name.

  EnumeratedReference

    class psd_tools.psd.descriptor.EnumeratedReference(name: str = '', classID: bytes = b'\x00\x00\x00\x00', typeID: bytes = b'\x00\x00\x00\x00', enum: bytes = b'\x00\x00\x00\x00')
        Enumerated reference structure.

        name
            str value

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

        typeID
            bytes in Type <#psd_tools.terminology.Type>

        enum
            bytes in Enum <#psd_tools.terminology.Enum>

  GlobalObject

    class psd_tools.psd.descriptor.GlobalObject(items=NOTHING, name: str = '', classID: bytes = b'null')
        Global object structure equivalent to Descriptor.

  Identifier

    class psd_tools.psd.descriptor.Identifier(value=0)
        Identifier equivalent to Integer.

  Index

    class psd_tools.psd.descriptor.Index(value=0)
        Index equivalent to Integer.

  Integer

    class psd_tools.psd.descriptor.Integer(value=0)
        Integer structure.

        value
            int value

  LargeInteger

    class psd_tools.psd.descriptor.LargeInteger(value=0)
        LargeInteger structure.

        value
            int value

  List

    class psd_tools.psd.descriptor.List(items=NOTHING)
        List structure.

        Example:

                for item in list_value:
                    print(item)

  Name

    class psd_tools.psd.descriptor.Name(name: str = '', classID: bytes = b'\x00\x00\x00\x00', value: str = '')
        Name structure (Undocumented).

        name
            str

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

        value
            str

  ObjectArray

    class psd_tools.psd.descriptor.ObjectArray(items=NOTHING, items_count: int = 0, name: str = '', classID: bytes = b'null')
        Object array structure almost equivalent to Descriptor.

        items_count
            int value

        name
            str value

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

  Property

    class psd_tools.psd.descriptor.Property(name: str = '', classID: bytes = b'\x00\x00\x00\x00', keyID: bytes = b'\x00\x00\x00\x00')
        Property structure.

        name
            str value

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

        keyID
            bytes in Key <#psd_tools.terminology.Key>

  Offset

    class psd_tools.psd.descriptor.Offset(name: str = '', classID: bytes = b'\x00\x00\x00\x00', value: int = 0)
        Offset structure.

        name
            str value

        classID
            bytes in Klass <#psd_tools.terminology.Klass>

        value
            int value

  Path

    class psd_tools.psd.descriptor.Path(value: bytes = b'\x00\x00\x00\x00')
        Undocumented path structure equivalent to RawData.

  RawData

    class psd_tools.psd.descriptor.RawData(value: bytes = b'\x00\x00\x00\x00')
        RawData structure.

        value
            bytes value

  Reference

    class psd_tools.psd.descriptor.Reference(items=NOTHING)
        Reference structure equivalent to List.

  String

    class psd_tools.psd.descriptor.String(value: str = '')
        String structure.

        value
            str value

  UnitFloat

    class psd_tools.psd.descriptor.UnitFloat(value: float = 0.0, unit: Unit <#psd_tools.terminology.Unit> = Unit._None)
        Unit float structure.

        unit
            unit of the value in Unit or Enum

        value
            float value

  UnitFloats

    class psd_tools.psd.descriptor.UnitFloats(unit: Unit <#psd_tools.terminology.Unit> = Unit._None, values: list = NOTHING)
        Unit floats structure.

        unit
            unit of the value in Unit or Enum

        values
            List of float values

  psd_tools.psd.engine_data

EngineData structure.

PSD file embeds text formatting data in its own markup language referred EngineData. The format looks like the following:

            <<
              /EngineDict
              <<
                /Editor
                <<
                  /Text (˛ˇMake a change and save.)
                >>
              >>
              /Font
              <<
                /Name (˛ˇHelveticaNeue-Light)
                /FillColor
                <<
                  /Type 1
                  /Values [ 1.0 0.0 0.0 0.0 ]
                >>
                /StyleSheetSet [
                <<
                  /Name (˛ˇNormal RGB)
                >>
                ]
              >>
            >>

  EngineData

    class psd_tools.psd.engine_data.EngineData(items=NOTHING)
        Dict-like element.

        TYPE_TOOL_OBJECT_SETTING tagged block contains this object in its descriptor.

  EngineData2

    class psd_tools.psd.engine_data.EngineData2(items=NOTHING)
        Dict-like element.

        TEXT_ENGINE_DATA tagged block has this object.

  Bool

    class psd_tools.psd.engine_data.Bool(value=False)
        Bool element.

  Dict

    class psd_tools.psd.engine_data.Dict(items=NOTHING)
        Dict-like element.

  Float

    class psd_tools.psd.engine_data.Float(value=0.0)
        Float element.

  Integer

    class psd_tools.psd.engine_data.Integer(value=0)
        Integer element.

  List

    class psd_tools.psd.engine_data.List(items=NOTHING)
        List-like element.

  Property

    class psd_tools.psd.engine_data.Property(value: object = None)
        Property element.

  String

    class psd_tools.psd.engine_data.String(value: object = None)
        String element.

  psd_tools.psd.effects_layer

Effects layer structure.

Note the structures in this module is obsolete and object-based layer effects are stored in tagged blocks.

  EffectsLayer

    class psd_tools.psd.effects_layer.EffectsLayer(items=NOTHING, version: int = 0)
        Dict-like EffectsLayer structure. See psd_tools.constants.EffectOSType <#psd_tools.constants.EffectOSType> for available keys.

        version

  CommonStateInfo

    class psd_tools.psd.effects_layer.CommonStateInfo(version: int = 0, visible: int = 1)
        Effects layer common state info.

        version

        visible

  ShadowInfo

    class psd_tools.psd.effects_layer.ShadowInfo(version: int = 0, blur: int = 0, intensity: int = 0, angle: int = 0, distance: int = 0, color: Color = NOTHING, blend_mode=BlendMode.NORMAL, enabled: int = 0, use_global_angle: int = 0, opacity: int = 0, native_color: Color = NOTHING)
        Effects layer shadow info.

        version

        blur

        intensity

        angle

        distance

        color

        blend_mode

        enabled

        use_global_angle

        opacity

        native_color

  OuterGlowInfo

    class psd_tools.psd.effects_layer.OuterGlowInfo(version: int = 0, blur: int = 0, intensity: int = 0, color: Color = NOTHING, blend_mode=BlendMode.NORMAL, enabled: int = 0, opacity: int = 0, native_color: object = None)
        Effects layer outer glow info.

        version

        blur

        intensity

        color

        blend_mode

        enabled

        opacity

        native_color

  InnerGlowInfo

    class psd_tools.psd.effects_layer.InnerGlowInfo(version: int = 0, blur: int = 0, intensity: int = 0, color: Color = NOTHING, blend_mode=BlendMode.NORMAL, enabled: int = 0, opacity: int = 0, invert: int | None = None, native_color: object | None = None)
        Effects layer inner glow info.

        version

        blur

        intensity

        color

        blend_mode

        enabled

        opacity

        invert

        native_color

  BevelInfo

    class psd_tools.psd.effects_layer.BevelInfo(version: int = 0, angle: int = 0, depth: int = 0, blur: int = 0, highlight_blend_mode=BlendMode.NORMAL, shadow_blend_mode=BlendMode.NORMAL, highlight_color: Color = NOTHING, shadow_color: Color = NOTHING, bevel_style: int = 0, highlight_opacity: int = 0, shadow_opacity: int = 0, enabled: int = 0, use_global_angle: int = 0, direction: int = 0, real_highlight_color: object = None, real_shadow_color: object = None)
        Effects layer bevel info.

        version

        angle

        depth

        blur

        highlight_blend_mode

        shadow_blend_mode

        highlight_color

        shadow_color

        highlight_opacity

        shadow_opacity

        enabled

        use_global_angle

        direction

        real_hightlight_color

        real_shadow_color

  SolidFillInfo

    class psd_tools.psd.effects_layer.SolidFillInfo(version: int = 2, blend_mode=BlendMode.NORMAL, color: Color = NOTHING, opacity: int = 0, enabled: int = 0, native_color: Color = NOTHING)
        Effects layer inner glow info.

        version

        blend_mode

        color

        opacity

        enabled

        native_color

  psd_tools.psd.filter_effects

Filter effects structure.

  FilterEffects

    class psd_tools.psd.filter_effects.FilterEffects(items=NOTHING, version: int = 1)
        List-like FilterEffects structure. See FilterEffect.

        version

  FilterEffect

    class psd_tools.psd.filter_effects.FilterEffect(uuid: str | None = None, version: int | None = None, rectangle: tuple | None = None, depth: int | None = None, max_channels: int | None = None, channels: list | None = None, extra: object | None = None)
        FilterEffect structure.

        uuid

        version

        rectangle

        depth

        max_channels

        channels
            List of FilterEffectChannel.

        extra
            See FilterEffectExtra.

  FilterEffectChannel

    class psd_tools.psd.filter_effects.FilterEffectChannel(is_written: int = 0, compression: int | None = None, data: bytes = b'')
        FilterEffectChannel structure.

        is_written

        compression

        data

  FilterEffectExtra

    class psd_tools.psd.filter_effects.FilterEffectExtra(is_written: int = 0, rectangle=NOTHING, compression: int = 0, data: bytes = b'')
        FilterEffectExtra structure.

        is_written

        rectangle

        compression

        data

  psd_tools.psd.header

File header structure.

  FileHeader

    class psd_tools.psd.header.FileHeader(signature: bytes = b'8BPS', version: int = 1, channels: int = 4, height: int = 64, width: int = 64, depth: int = 8, color_mode=ColorMode.RGB)
        Header section of the PSD file.

        Example:

                from psd_tools.psd.header import FileHeader
                from psd_tools.constants import ColorMode

                header = FileHeader(channels=2, height=359, width=400, depth=8,
                                    color_mode=ColorMode.GRAYSCALE)

        signature
            Signature: always equal to b'8BPS'.

        version
            Version number. PSD is 1, and PSB is 2.

        channels
            The number of channels in the image, including any user-defined alpha channel.

        height
            The height of the image in pixels.

        width
            The width of the image in pixels.

        depth
            The number of bits per channel.

        color_mode
            The color mode of the file. See ColorMode <#psd_tools.constants.ColorMode>

  psd_tools.psd.image_data

Image data section structure.

ImageData corresponds to the last section of the PSD/PSB file where a composited image is stored. When the file does not contain layers, this is the only place pixels are saved.

  ImageData

    class psd_tools.psd.image_data.ImageData(compression=Compression.RAW, data: bytes = b'')
        Merged channel image data.

        compression
            See Compression <#psd_tools.constants.Compression>.

        data
            bytes as compressed in the compression flag.

        get_data(header: FileHeader <#psd_tools.psd.header.FileHeader>, split: bool = True) -> list[bytes] | bytes
            Get decompressed data.

            Parameters
                header -- See FileHeader <#psd_tools.psd.header.FileHeader>.

            Returns
                list of bytes corresponding each channel.

        classmethod new(header: FileHeader <#psd_tools.psd.header.FileHeader>, color: int | Sequence[int] = 0, compression: Compression <#psd_tools.constants.Compression> = Compression.RAW) -> T
            Create a new image data object.

            Parameters

                •   header -- FileHeader.

                •   compression -- compression type.

                •   color -- default color. int or iterable for channel length.

        set_data(data: Sequence[bytes], header: FileHeader <#psd_tools.psd.header.FileHeader>) -> int
            Set raw data and compress.

            Parameters

                •   data -- list of raw data bytes corresponding channels.

                •   compression -- compression type, see Compression <#psd_tools.constants.Compression>.

                •   header -- See FileHeader <#psd_tools.psd.header.FileHeader>.

            Returns
                length of compressed data.

  psd_tools.psd.image_resources

Image resources section structure. Image resources are used to store non-pixel data associated with images, such as pen tool paths or slices.

See Resource <#psd_tools.constants.Resource> to check available resource names.

Example:

            from psd_tools.constants import Resource

            version_info = psd.image_resources.get_data(Resource.VERSION_INFO)

The following resources are plain bytes:

            Resource.OBSOLETE1: 1000
            Resource.MAC_PRINT_MANAGER_INFO: 1001
            Resource.MAC_PAGE_FORMAT_INFO: 1002
            Resource.OBSOLETE2: 1003
            Resource.DISPLAY_INFO_OBSOLETE: 1007
            Resource.BORDER_INFO: 1009
            Resource.DUOTONE_IMAGE_INFO: 1018
            Resource.EFFECTIVE_BW: 1019
            Resource.OBSOLETE3: 1020
            Resource.EPS_OPTIONS: 1021
            Resource.QUICK_MASK_INFO: 1022
            Resource.OBSOLETE4: 1023
            Resource.WORKING_PATH: 1025
            Resource.OBSOLETE5: 1027
            Resource.IPTC_NAA: 1028
            Resource.IMAGE_MODE_RAW: 1029
            Resource.JPEG_QUALITY: 1030
            Resource.URL: 1035
            Resource.COLOR_SAMPLERS_RESOURCE_OBSOLETE: 1038
            Resource.ICC_PROFILE: 1039
            Resource.SPOT_HALFTONE: 1043
            Resource.JUMP_TO_XPEP: 1052
            Resource.EXIF_DATA_1: 1058
            Resource.EXIF_DATA_3: 1059
            Resource.XMP_METADATA: 1060
            Resource.CAPTION_DIGEST: 1061
            Resource.ALTERNATE_DUOTONE_COLORS: 1066
            Resource.ALTERNATE_SPOT_COLORS: 1067
            Resource.HDR_TONING_INFO: 1070
            Resource.PRINT_INFO_CS2: 1071
            Resource.COLOR_SAMPLERS_RESOURCE: 1073
            Resource.DISPLAY_INFO: 1077
            Resource.MAC_NSPRINTINFO: 1084
            Resource.WINDOWS_DEVMODE: 1085
            Resource.PATH_INFO_N: 2000-2999
            Resource.PLUGIN_RESOURCES_N: 4000-4999
            Resource.IMAGE_READY_VARIABLES: 7000
            Resource.IMAGE_READY_DATA_SETS: 7001
            Resource.IMAGE_READY_DEFAULT_SELECTED_STATE: 7002
            Resource.IMAGE_READY_7_ROLLOVER_EXPANDED_STATE: 7003
            Resource.IMAGE_READY_ROLLOVER_EXPANDED_STATE: 7004
            Resource.IMAGE_READY_SAVE_LAYER_SETTINGS: 7005
            Resource.IMAGE_READY_VERSION: 7006
            Resource.LIGHTROOM_WORKFLOW: 8000

  ImageResources

    class psd_tools.psd.image_resources.ImageResources(items=NOTHING)
        Image resources section of the PSD file. Dict of ImageResource.

        get_data(key: Any, default: Any = None) -> Any
            Get data from the image resources.

            Shortcut for the following:

                    if key in image_resources:
                        value = tagged_blocks[key].data

        classmethod new(**kwargs: Any) -> T_ImageResources
            Create a new default image resouces.

            Returns
                ImageResources

  ImageResource

    class psd_tools.psd.image_resources.ImageResource(signature: bytes = b'8BIM', key: int = 1000, name: str = '', data: bytes = b'')
        Image resource block.

        signature
            Binary signature. Usually b'8BIM', but some resources use alternative signatures such as b'MeSa' (e.g., IMAGE_READY_VARIABLES <#psd_tools.constants.Resource.IMAGE_READY_VARIABLES>), b'AgHg', b'PHUT', or b'DCSR'.

        key Unique identifier for the resource. See Resource <#psd_tools.constants.Resource>.

        name

        data
            The resource data.

  AlphaIdentifiers

    class psd_tools.psd.image_resources.AlphaIdentifiers(items=NOTHING)
        List of alpha identifiers.

  AlphaNamesPascal

    class psd_tools.psd.image_resources.AlphaNamesPascal(items=NOTHING)
        List of alpha names.

  AlphaNamesUnicode

    class psd_tools.psd.image_resources.AlphaNamesUnicode(items=NOTHING)
        List of alpha names.

  Byte

    class psd_tools.psd.image_resources.Byte(value=0)
        Byte element.

  GridGuidesInfo

    class psd_tools.psd.image_resources.GridGuidesInfo(version: int = 1, horizontal: int = 0, vertical: int = 0, data=NOTHING)
        Grid and guides info structure.

  HalftoneScreens

    class psd_tools.psd.image_resources.HalftoneScreens(items=NOTHING)
        Halftone screens.

  HalftoneScreen

    class psd_tools.psd.image_resources.HalftoneScreen(freq: int = 0, unit: int = 0, angle: int = 0, shape: int = 0, use_accurate: bool = False, use_printer: bool = False)
        Halftone screen.

        freq

        unit

        angle

        shape

        use_accurate

        use_printer

  Integer

    class psd_tools.psd.image_resources.Integer(value=0)
        Integer element.

  LayerGroupEnabledIDs

    class psd_tools.psd.image_resources.LayerGroupEnabledIDs(items=NOTHING)
        Layer group enabled ids.

  LayerGroupInfo

    class psd_tools.psd.image_resources.LayerGroupInfo(items=NOTHING)
        Layer group info list.

  LayerSelectionIDs

    class psd_tools.psd.image_resources.LayerSelectionIDs(items=NOTHING)
        Layer selection ids.

  ShortInteger

    class psd_tools.psd.image_resources.ShortInteger(value=0)
        Short integer element.

  PascalString

    class psd_tools.psd.image_resources.PascalString(value: object = None)
        Pascal string element.

  PixelAspectRatio

    class psd_tools.psd.image_resources.PixelAspectRatio(value=0.0, version: int = 1)
        Pixel aspect ratio.

  PrintFlags

    class psd_tools.psd.image_resources.PrintFlags(labels: bool = False, crop_marks: bool = False, colorbars: bool = False, registration_marks: bool = False, negative: bool = False, flip: bool = False, interpolate: bool = False, caption: bool = False, print_flags: bool | None = None)
        Print flags.

  PrintFlagsInfo

    class psd_tools.psd.image_resources.PrintFlagsInfo(version: int = 0, center_crop: int = 0, bleed_width_value: int = 0, bleed_width_scale: int = 0)
        Print flags info structure.

        version

        center_crop

        bleed_width_value

        bleed_width_scale

  PrintScale

    class psd_tools.psd.image_resources.PrintScale(style=PrintScaleStyle.CENTERED, x: float = 0.0, y: float = 0.0, scale: float = 0.0)
        Print scale structure.

        style

        x

        y

        scale

  ResoulutionInfo

    class psd_tools.psd.image_resources.ResoulutionInfo(horizontal: int = 0, horizontal_unit: int = 0, width_unit: int = 0, vertical: int = 0, vertical_unit: int = 0, height_unit: int = 0)
        Resoulution info structure.

        horizontal

        horizontal_unit

        width_unit

        vertical

        vertical_unit

        height_unit

  Slices

    class psd_tools.psd.image_resources.Slices(version: int = 0, data: object = None)
        Slices resource.

        version

        data

  SlicesV6

    class psd_tools.psd.image_resources.SlicesV6(bbox=NOTHING, name: str = '', items=NOTHING)
        Slices resource version 6.

        bbox

        name

        items

  SliceV6

    class psd_tools.psd.image_resources.SliceV6(slice_id: int = 0, group_id: int = 0, origin: int = 0, associated_id: int | None = None, name: str = '', slice_type: int = 0, bbox=NOTHING, url: str = '', target: str = '', message: str = '', alt_tag: str = '', cell_is_html: bool = False, cell_text: str = '', horizontal_align: int = 0, vertical_align: int = 0, alpha: int = 0, red: int = 0, green: int = 0, blue: int = 0, data: object = None)
        Slice element for version 6.

        slice_id

        group_id

        origin

        associated_id

        name

        slice_type

        bbox

        url

        target

        message

        alt_tag

        cell_is_html

        cell_text

        horizontal

        vertical

        alpha

        red

        green

        blue

        data

  ThumbnailResource

    class psd_tools.psd.image_resources.ThumbnailResource(fmt: int = 0, width: int = 0, height: int = 0, row: int = 0, total_size: int = 0, bits: int = 0, planes: int = 0, data: bytes = b'')
        Thumbnail resource structure.

        fmt

        width

        height

        row

        total_size

        size

        bits

        planes

        data

  ThumbnailResourceV4

    class psd_tools.psd.image_resources.ThumbnailResourceV4(fmt: int = 0, width: int = 0, height: int = 0, row: int = 0, total_size: int = 0, bits: int = 0, planes: int = 0, data: bytes = b'')

  TransferFunctions

    class psd_tools.psd.image_resources.TransferFunctions(items=NOTHING)
        Transfer functions.

  TransferFunction

    class psd_tools.psd.image_resources.TransferFunction(curve=NOTHING, override: int = 0)
        Transfer function for a single plate.

        Contains 13 signed short integers representing curve control points in the range 0...1000 (corresponding to 0.0%...100.0%). The first and last values are always present; any intermediate value may be -1 to indicate that no control point exists at that position. A NULL (identity) transfer curve has the form:

                [0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000]

    Followed by one unsigned short override flag (non-zero means the transfer function overrides the default).

    See Adobe PSD spec §Transfer Functions <https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_pgfId-1071095>.

  URLList

    class psd_tools.psd.image_resources.URLList(items=NOTHING)
        URL list structure.

  URLItem

    class psd_tools.psd.image_resources.URLItem(number: int = 0, id: int = 0, name: str = '')
        URL item.

        number

        id

        name

  VersionInfo

    class psd_tools.psd.image_resources.VersionInfo(version: int = 1, has_composite: bool = False, writer: str = '', reader: str = '', file_version: int = 1)
        Version info structure.

        version

        has_composite

        writer

        reader

        file_version

  psd_tools.psd.layer_and_mask

Layer and mask data structures.

This module implements the low-level binary structures for PSD layers and masks, corresponding to the "Layer and Mask Information" section of PSD files. This is one of the most complex parts of the PSD format.

Key classes:

    •   LayerAndMaskInformation: Top-level container for all layer data

    •   LayerInfo: Contains layer records and channel image data

    •   LayerRecords: List of individual layer records

    •   LayerRecord: Single layer metadata (name, bounds, blend mode, etc.)

    •   ChannelInfo: Channel metadata within a layer record

    •   ChannelImageData: Compressed pixel data for all channels

    •   ChannelData: Single channel's compressed pixel data

    •   MaskData: Layer mask parameters

    •   GlobalLayerMaskInfo: Document-wide mask settings

    •   TaggedBlocks: Extended layer metadata (see psd_tools.psd.tagged_blocks <#module-psd_tools.psd.tagged_blocks>)

The layer structure in PSD files is stored as a flat list with implicit hierarchy. Group boundaries are marked by special layers with SectionDivider tagged blocks:

    •   BOUNDING_SECTION_DIVIDER: Marks the start of a group (the layer that opens the group)

    •   OPEN_FOLDER or CLOSED_FOLDER: Marks the end of a group (the closing divider layer) - OPEN_FOLDER: Group was open in Photoshop UI - CLOSED_FOLDER: Group was closed in Photoshop UI

The high-level API (psd_tools.api <#module-psd_tools.api>) reconstructs this into a proper tree structure with parent-child relationships.

Each layer record contains:

    1.  Metadata: Rectangle bounds, blend mode, opacity, flags

    2.  Channel info: List of channels (R, G, B, A, masks, etc.) with byte offsets

    3.  Blend ranges: Advanced blending parameters

    4.  Layer name: Pascal string (legacy, inaccurate for Unicode names)

    5.  Tagged blocks: Extended metadata in key-value format

The channel image data section follows all layer records and contains the actual compressed pixel data for each channel, referenced by the channel info structures.

Example of reading layer metadata:

            from psd_tools.psd import PSD

            with open('file.psd', 'rb') as f:
                psd = PSD.read(f)

            layer_info = psd.layer_and_mask_information.layer_info
            for record in layer_info.layer_records:
                print(f"Layer: {record.name}")
                print(f"  Bounds: {record.top}, {record.left}, {record.bottom}, {record.right}")
                print(f"  Blend mode: {record.blend_mode}")
                print(f"  Channels: {len(record.channel_info)}")

For most use cases, prefer the high-level Layer <#psd_tools.api.layers.Layer> API which provides easier access to this data.

  LayerAndMaskInformation

    class psd_tools.psd.layer_and_mask.LayerAndMaskInformation(layer_info: LayerInfo <#psd_tools.psd.layer_and_mask.LayerInfo> | None = None, global_layer_mask_info: GlobalLayerMaskInfo <#psd_tools.psd.layer_and_mask.GlobalLayerMaskInfo> | None = None, tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> | None = None)
        Layer and mask information section.

        layer_info
            See LayerInfo.

        global_layer_mask_info
            See GlobalLayerMaskInfo.

        tagged_blocks
            See TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

  LayerInfo

    class psd_tools.psd.layer_and_mask.LayerInfo(layer_count: int = 0, layer_records: LayerRecords <#psd_tools.psd.layer_and_mask.LayerRecords> = NOTHING, channel_image_data: ChannelImageData <#psd_tools.psd.layer_and_mask.ChannelImageData> = NOTHING)
        High-level organization of the layer information.

        layer_count
            Layer count. If it is a negative number, its absolute value is the number of layers and the first alpha channel contains the transparency data for the merged result.

        layer_records
            Information about each layer. See LayerRecords.

        channel_image_data
            Channel image data. See ChannelImageData.

  GlobalLayerMaskInfo

    class psd_tools.psd.layer_and_mask.GlobalLayerMaskInfo(overlay_color: list[int] | None = None, opacity: int = 0, kind=GlobalLayerMaskKind.PER_LAYER)
        Global mask information.

        overlay_color
            Overlay color space (undocumented) and color components.

        opacity
            Opacity. 0 = transparent, 100 = opaque.

        kind
            Kind. 0 = Color selected--i.e. inverted; 1 = Color protected; 128 = use value stored per layer. This value is preferred. The others are for backward compatibility with beta versions.

  LayerRecords

    class psd_tools.psd.layer_and_mask.LayerRecords(items=NOTHING)
        List of layer records. See LayerRecord.

  LayerRecord

    class psd_tools.psd.layer_and_mask.LayerRecord(top: int = 0, left: int = 0, bottom: int = 0, right: int = 0, channel_info: list[ChannelInfo <#psd_tools.psd.layer_and_mask.ChannelInfo>] = NOTHING, signature: bytes = b'8BIM', blend_mode=BlendMode.NORMAL, opacity: int = 255, clipping=Clipping.BASE, flags: LayerFlags <#psd_tools.psd.layer_and_mask.LayerFlags> = NOTHING, mask_data: object = None, blending_ranges: LayerBlendingRanges <#psd_tools.psd.layer_and_mask.LayerBlendingRanges> = NOTHING, name: str = '', tagged_blocks: TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks> = NOTHING)
        Layer record.

        top Top position.

        left
            Left position.

        bottom
            Bottom position.

        right
            Right position.

        channel_info
            List of ChannelInfo.

        signature
            Blend mode signature b'8BIM'.

        blend_mode
            Blend mode key. See BlendMode <#psd_tools.constants.BlendMode>.

        opacity
            Opacity, 0 = transparent, 255 = opaque.

        clipping
            Clipping, 0 = base, 1 = non-base. See Clipping <#psd_tools.constants.Clipping>.

        flags
            See LayerFlags.

        mask_data
            MaskData or None.

        blending_ranges
            See LayerBlendingRanges.

        name
            Layer name.

        tagged_blocks
            See TaggedBlocks <#psd_tools.psd.tagged_blocks.TaggedBlocks>.

        property channel_sizes: list[tuple[int, int]]
            [(width, height)].

            Type
                List <#psd_tools.psd.descriptor.List> of channel sizes

        property height: int
            Height of the layer.

        property width: int
            Width of the layer.

  LayerFlags

    class psd_tools.psd.layer_and_mask.LayerFlags(transparency_protected: bool = False, visible: bool = True, obsolete: bool = False, photoshop_v5_later: bool = True, pixel_data_irrelevant: bool = False, undocumented_1: bool = False, undocumented_2: bool = False, undocumented_3: bool = False)
        Layer flags.

        Note there are undocumented flags. Maybe photoshop version.

        transparency_protected

        visible

        pixel_data_irrelevant

  LayerBlendingRanges

    class psd_tools.psd.layer_and_mask.LayerBlendingRanges(composite_ranges: list[tuple[int, int]] = NOTHING, channel_ranges: list[list[tuple[int, int]]] = NOTHING)
        Layer blending ranges.

        All ranges contain 2 black values followed by 2 white values.

        composite_ranges
            List of composite gray blend source and destination ranges.

        channel_ranges
            List of channel source and destination ranges.

  MaskData

    class psd_tools.psd.layer_and_mask.MaskData(top: int = 0, left: int = 0, bottom: int = 0, right: int = 0, background_color: int = 0, flags: MaskFlags <#psd_tools.psd.layer_and_mask.MaskFlags> = NOTHING, parameters: MaskParameters <#psd_tools.psd.layer_and_mask.MaskParameters> | None = None, real_flags: MaskFlags <#psd_tools.psd.layer_and_mask.MaskFlags> | None = None, real_background_color: int | None = None, real_top: int | None = None, real_left: int | None = None, real_bottom: int | None = None, real_right: int | None = None)
        Mask data.

        Real user mask is a final composite mask of vector and pixel masks.

        top Top position.

        left
            Left position.

        bottom
            Bottom position.

        right
            Right position.

        background_color
            Default color. 0 or 255.

        flags
            See MaskFlags.

        parameters
            MaskParameters or None.

        real_flags
            Real user mask flags. See MaskFlags.

        real_background_color
            Real user mask background. 0 or 255.

        real_top
            Top position of real user mask.

        real_left
            Left position of real user mask.

        real_bottom
            Bottom position of real user mask.

        real_right
            Right position of real user mask.

        property height: int
            Height of the mask.

        property real_height: int
            Height of real user mask.

        property real_width: int
            Width of real user mask.

        property width: int
            Width of the mask.

  MaskFlags

    class psd_tools.psd.layer_and_mask.MaskFlags(pos_relative_to_layer: bool = False, mask_disabled: bool = False, invert_mask: bool = False, user_mask_from_render: bool = False, parameters_applied: bool = False, undocumented_1: bool = False, undocumented_2: bool = False, undocumented_3: bool = False)
        Mask flags.

        pos_relative_to_layer
            Position relative to layer.

        mask_disabled
            Layer mask disabled.

        invert_mask
            Invert layer mask when blending (Obsolete).

        user_mask_from_render
            The user mask actually came from rendering other data.

        parameters_applied
            The user and/or vector masks have parameters applied to them.

  MaskParameters

    class psd_tools.psd.layer_and_mask.MaskParameters(user_mask_density: int | None = None, user_mask_feather: float | None = None, vector_mask_density: int | None = None, vector_mask_feather: float | None = None)
        Mask parameters.

        user_mask_density

        user_mask_feather

        vector_mask_density

        vector_mask_feather

  ChannelInfo

    class psd_tools.psd.layer_and_mask.ChannelInfo(id=ChannelID.CHANNEL_0, length: int = 0)
        Channel information.

        id  Channel ID: 0 = red, 1 = green, etc.; -1 = transparency mask; -2 = user supplied layer mask, -3 real user supplied layer mask (when both a user mask and a vector mask are present). See ChannelID <#psd_tools.constants.ChannelID>.

        length
            Length of the corresponding channel data.

  ChannelImageData

    class psd_tools.psd.layer_and_mask.ChannelImageData(items=NOTHING)
        List of channel data list.

        This size of this list corresponds to the size of LayerRecords. Each item corresponds to the channels of each layer.

        See ChannelDataList.

  ChannelDataList

    class psd_tools.psd.layer_and_mask.ChannelDataList(items=NOTHING)
        List of channel image data, corresponding to each color or alpha.

        See ChannelData.

  ChannelData

    class psd_tools.psd.layer_and_mask.ChannelData(compression=Compression.RAW, data: bytes = b'')
        Channel data.

        compression
            Compression type. See Compression <#psd_tools.constants.Compression>.

        data
            Data.

        get_data(width: int, height: int, depth: int, version: int = 1) -> bytes
            Get decompressed channel data.

            Parameters

                •   width -- width.

                •   height -- height.

                •   depth -- bit depth of the pixel.

                •   version -- psd file version.

            Return type
                bytes

        set_data(data: bytes, width: int, height: int, depth: int, version: int = 1) -> int
            Set raw channel data and compress to store.

            Parameters

                •   data -- raw data bytes to write.

                •   compression -- compression type, see Compression <#psd_tools.constants.Compression>.

                •   width -- width.

                •   height -- height.

                •   depth -- bit depth of the pixel.

                •   version -- psd file version.

  psd_tools.psd.linked_layer

Linked layer structure.

  LinkedLayers

    class psd_tools.psd.linked_layer.LinkedLayers(items=NOTHING)
        List of LinkedLayer structure. See LinkedLayer.

  LinkedLayer

    class psd_tools.psd.linked_layer.LinkedLayer(kind: LinkedLayerType <#psd_tools.constants.LinkedLayerType> = LinkedLayerType.ALIAS, version: int = 1, uuid: str = '', filename: str = '', filetype: bytes = b'\x00\x00\x00\x00', creator: bytes = b'\x00\x00\x00\x00', filesize: int | None = None, open_file: DescriptorBlock | None = None, linked_file: DescriptorBlock | None = None, timestamp: tuple | None = None, data: bytes | None = None, child_id: str | None = None, mod_time: float | None = None, lock_state: int | None = None)
        LinkedLayer structure.

        kind

        version

        uuid

        filename

        filetype

        creator

        filesize

        open_file

        linked_file

        timestamp

        data

        child_id

        mod_time

        lock_state

  psd_tools.psd.patterns

Patterns structure.

  Patterns

    class psd_tools.psd.patterns.Patterns(items=NOTHING)
        List of Pattern structure. See Pattern.

  Pattern

    class psd_tools.psd.patterns.Pattern(version: int = 1, image_mode=ColorMode.RGB, point: tuple[int, int] = (0, 0), name: str = '', pattern_id: str = '', color_table: list[tuple[int, int, int]] = NOTHING, data: VirtualMemoryArrayList <#psd_tools.psd.patterns.VirtualMemoryArrayList> = None)
        Pattern structure.

        version

        image_mode
            See ColorMode

        point
            Size in tuple.

        name
            str name of the pattern.

        pattern_id
            ID of this pattern.

        color_table
            Color table if the mode is INDEXED.

        data
            See VirtualMemoryArrayList

  VirtualMemoryArrayList

    class psd_tools.psd.patterns.VirtualMemoryArrayList(version: int = 3, rectangle: tuple[int, int, int, int] = (0, 0, 0, 0), channels: list[VirtualMemoryArray <#psd_tools.psd.patterns.VirtualMemoryArray>] = NOTHING)
        VirtualMemoryArrayList structure. Container of channels.

        version

        rectangle
            Tuple of int

        channels
            List of VirtualMemoryArray

  VirtualMemoryArray

    class psd_tools.psd.patterns.VirtualMemoryArray(is_written: int = 0, depth: int | None = None, rectangle: tuple[int, int, int, int] | None = None, pixel_depth: int | None = None, compression=Compression.RAW, data: bytes = b'')
        VirtualMemoryArrayList structure, corresponding to each channel.

        is_written

        depth

        rectangle

        pixel_depth

        compression

        data

        get_data() -> bytes | None
            Get decompressed bytes.

        set_data(size: tuple[int, int], data: bytes, depth: int, compression: int = 0) -> None
            Set bytes.

  psd_tools.psd.tagged_blocks

Tagged block data structure.

  Todo

Support the following tagged blocks: Tag.PATTERN_DATA, Tag.TYPE_TOOL_INFO, Tag.LAYER, Tag.ALPHA

  TaggedBlocks

    class psd_tools.psd.tagged_blocks.TaggedBlocks(items=NOTHING)
        Dict of tagged block items.

        See Tag <#psd_tools.constants.Tag> for available keys.

        Example:

                from psd_tools.constants import Tag

                # Iterate over fields
                for key in tagged_blocks:
                    print(key)

                # Get a field
                value = tagged_blocks.get_data(Tag.TYPE_TOOL_OBJECT_SETTING)

  TaggedBlock

    class psd_tools.psd.tagged_blocks.TaggedBlock(signature: bytes = b'8BIM', key: bytes = b'', data: bytes = b'')
        Layer tagged block with extra info.

        key 4-character code. See Tag <#psd_tools.constants.Tag>

        data
            Data.

  Annotations

    class psd_tools.psd.tagged_blocks.Annotations(items=NOTHING, major_version: int = 2, minor_version: int = 1)
        List of Annotation, see :py:class: .Annotation.

        major_version

        minor_version

  Annotation

    class psd_tools.psd.tagged_blocks.Annotation(kind: bytes = b'txtA', is_open: int = 0, flags: int = 0, optional_blocks: int = 1, icon_location=NOTHING, popup_location=NOTHING, color: Color = NOTHING, author: str = '', name: str = '', mod_date: str = '', marker: bytes = b'txtC', data: bytes = b'')
        Annotation structure.

        kind

        is_open

  Bytes

    class psd_tools.psd.tagged_blocks.Bytes(value: bytes = b'\x00\x00\x00\x00')
        Bytes structure.

        value

  ChannelBlendingRestrictionsSetting

    class psd_tools.psd.tagged_blocks.ChannelBlendingRestrictionsSetting(items=NOTHING)
        ChannelBlendingRestrictionsSetting structure.

        List of restricted channel numbers (int).

  FilterMask

    class psd_tools.psd.tagged_blocks.FilterMask(color: Color = NOTHING, opacity: int = 0)
        FilterMask structure.

        color

        opacity

  MetadataSettings

    class psd_tools.psd.tagged_blocks.MetadataSettings(items=NOTHING)
        MetadataSettings structure.

  MetadataSetting

    class psd_tools.psd.tagged_blocks.MetadataSetting(signature: bytes = b'8BIM', key: bytes = b'', copy_on_sheet: bool = False, data: bytes = b'')
        MetadataSetting structure.

  PixelSourceData2

    class psd_tools.psd.tagged_blocks.PixelSourceData2(items=NOTHING)
        PixelSourceData2 structure.

  PlacedLayerData

    class psd_tools.psd.tagged_blocks.PlacedLayerData(kind: bytes = b'plcL', version: int = 3, uuid: bytes = b'', page: int = 0, total_pages: int = 0, anti_alias: int = 0, layer_type=PlacedLayerType.UNKNOWN, transform: tuple = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), warp: object = None)
        PlacedLayerData structure.

  ProtectedSetting

    class psd_tools.psd.tagged_blocks.ProtectedSetting(value=0)
        ProtectedSetting structure.

  ReferencePoint

    class psd_tools.psd.tagged_blocks.ReferencePoint(items=NOTHING)
        ReferencePoint structure.

  SectionDividerSetting

    class psd_tools.psd.tagged_blocks.SectionDividerSetting(kind=SectionDivider.OTHER, signature: bytes | None = None, blend_mode: BlendMode <#psd_tools.constants.BlendMode> | None = None, sub_type: int | None = None)
        SectionDividerSetting structure.

        kind

        blend_mode

        sub_type

  SheetColorSetting

    class psd_tools.psd.tagged_blocks.SheetColorSetting(value=SheetColorType.NO_COLOR)
        SheetColorSetting value.

        This setting represents color label in the layers panel in Photoshop UI.

        value

  SmartObjectLayerData

    class psd_tools.psd.tagged_blocks.SmartObjectLayerData(kind: bytes = b'soLD', version: int = 5, data: DescriptorBlock = NOTHING)
        VersionedDescriptorBlock structure.

        kind

        version

        data

  TypeToolObjectSetting

    class psd_tools.psd.tagged_blocks.TypeToolObjectSetting(version: int = 1, transform: tuple = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0), text_version: int = 1, text_data: DescriptorBlock = NOTHING, warp_version: int = 1, warp: DescriptorBlock = NOTHING, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0)
        TypeToolObjectSetting structure.

        version

        transform
            Tuple of affine transform parameters (xx, xy, yx, yy, tx, ty).

        text_version

        text_data

        warp_version

        warp

        left

        top

        right

        bottom

  UserMask

    class psd_tools.psd.tagged_blocks.UserMask(color: Color = NOTHING, opacity: int = 0, flag: int = 128)
        UserMask structure.

        color

        opacity

        flag

  psd_tools.psd.vector

Vector mask, path, and stroke structure.

  Path

    class psd_tools.psd.vector.Path(items=NOTHING)
        List-like Path structure. Elements are either PathFillRule, InitialFillRule, ClipboardRecord, ClosedPath, or OpenPath.

  Subpath

    class psd_tools.psd.vector.Subpath(items=NOTHING, operation: int = 1, unknown1: int = 1, unknown2: int = 0, index: int = 0, unknown3: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
        Subpath element. This is a list of Knot objects.

        Note:
            There are undocumented data associated with this structure.

        operation
            int value indicating how multiple subpath should be combined:

            1: Or (union), 2: Not-Or, 3: And (intersect), 0: Xor (exclude)

            The first path element is applied to the background surface. Intersection does not have strokes.

        index
            int index that specifies corresponding origination object.

        is_closed() -> bool
            Returns whether if the path is closed or not.

            Returns
                bool.

  Knot

    class psd_tools.psd.vector.Knot(preceding: tuple = (0.0,), anchor: tuple = (0.0,), leaving: tuple = (0.0,))
        Knot element consisting of 3 control points for Bezier curves.

        preceding
            (y, x) tuple of preceding control point in relative coordinates.

        anchor
            (y, x) tuple of anchor point in relative coordinates.

        leaving
            (y, x) tuple of leaving control point in relative coordinates.

  ClipboardRecord

    class psd_tools.psd.vector.ClipboardRecord(top: int = 0, left: int = 0, bottom: int = 0, right: int = 0, resolution: int = 0)
        Clipboard record.

        top Top position in int

        left
            Left position in int

        bottom
            Bottom position in int

        right
            Right position in int

        resolution
            Resolution in int

  PathFillRule

    class psd_tools.psd.vector.PathFillRule
        Path fill rule record, empty.

  InitialFillRule

    class psd_tools.psd.vector.InitialFillRule(value=0)
        Initial fill rule record.

        rule
            A value of 1 means that the fill starts with all pixels. The value will be either 0 or 1.

  VectorMaskSetting

    class psd_tools.psd.vector.VectorMaskSetting(version: int = 3, flags: int = 0, path: Path <#psd_tools.psd.vector.Path> | None = None)
        VectorMaskSetting structure.

        version

        path
            List of Subpath objects.

        property disable: bool
            Flag to indicate that the vector mask is disabled.

        property invert: bool
            Flag to indicate that the vector mask is inverted.

        property not_link: bool
            Flag to indicate that the vector mask is not linked.

  VectorStrokeContentSetting

    class psd_tools.psd.vector.VectorStrokeContentSetting(items=NOTHING, name: str = '', classID: bytes = b'null', key: bytes = b'\x00\x00\x00\x00', version: int = 1)
        Dict-like Descriptor-based structure. See Descriptor <#psd_tools.psd.descriptor.Descriptor>.

        key

        version

  psd_tools.terminology

Constants for descriptor.

This file is automaticaly generated by tools/extract_terminology.py

  Klass

    class psd_tools.terminology.Klass(*values)
        Klass definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        Action = b'Actn'

        ActionSet = b'ASet'

        Adjustment = b'Adjs'

        AdjustmentLayer = b'AdjL'

        AirbrushTool = b'AbTl'

        AlphaChannelOptions = b'AChl'

        AntiAliasedPICTAcquire = b'AntA'

        Application = b'capp'

        Arrowhead = b'cArw'

        ArtHistoryBrushTool = b'ABTl'

        Assert = b'Asrt'

        AssumedProfile = b'AssP'

        BMPFormat = b'BMPF'

        BackLight = b'BakL'

        BackgroundEraserTool = b'SETl'

        BackgroundLayer = b'BckL'

        BevelEmboss = b'ebbl'

        BitmapMode = b'BtmM'

        BlendRange = b'Blnd'

        BlurTool = b'BlTl'

        BookColor = b'BkCl'

        BrightnessContrast = b'BrgC'

        Brush = b'Brsh'

        BurnInTool = b'BrTl'

        CMYKColor = b'CMYC'

        CMYKColorMode = b'CMYM'

        CMYKSetup = b'CMYS'

        CachePrefs = b'CchP'

        Calculation = b'Clcl'

        Channel = b'Chnl'

        ChannelMatrix = b'ChMx'

        ChannelMixer = b'ChnM'

        ChromeFX = b'ChFX'

        CineonFormat = b'SDPX'

        ClippingInfo = b'Clpo'

        ClippingPath = b'ClpP'

        CloneStampTool = b'ClTl'

        Color = b'Clr '

        ColorBalance = b'ClrB'

        ColorCast = b'ColC'

        ColorCorrection = b'ClrC'

        ColorPickerPrefs = b'Clrk'

        ColorSampler = b'ClSm'

        ColorStop = b'Clrt'

        Command = b'Cmnd'

        Contour = b'FxSc'

        CurvePoint = b'CrPt'

        Curves = b'Crvs'

        CurvesAdjustment = b'CrvA'

        CustomPalette = b'Cstl'

        CustomPhosphors = b'CstP'

        CustomWhitePoint = b'CstW'

        DicomFormat = b'Dicm'

        DisplayPrefs = b'DspP'

        Document = b'Dcmn'

        DodgeTool = b'DdTl'

        DropShadow = b'DrSh'

        DuotoneInk = b'DtnI'

        DuotoneMode = b'DtnM'

        EPSGenericFormat = b'EPSG'

        EPSPICTPreview = b'EPSC'

        EPSTIFFPreview = b'EPST'

        EXRf = b'EXRf'

        Element = b'Elmn'

        Ellipse = b'Elps'

        EraserTool = b'ErTl'

        Export = b'Expr'

        FileInfo = b'FlIn'

        FileSavePrefs = b'FlSv'

        FillFlash = b'FilF'

        FlashPixFormat = b'FlsP'

        FontDesignAxes = b'FntD'

        Format = b'Fmt '

        FrameFX = b'FrFX'

        GIF89aExport = b'GF89'

        GIFFormat = b'GFFr'

        GeneralPrefs = b'GnrP'

        GlobalAngle = b'gblA'

        Gradient = b'Grdn'

        GradientFill = b'Grdf'

        GradientMap = b'GdMp'

        GradientTool = b'GrTl'

        GraySetup = b'GrSt'

        Grayscale = b'Grsc'

        GrayscaleMode = b'Grys'

        Guide = b'Gd '

        GuidesPrefs = b'GdPr'

        HSBColor = b'HSBC'

        HSBColorMode = b'HSBM'

        HalftoneScreen = b'HlfS'

        HalftoneSpec = b'Hlfp'

        HistoryBrushTool = b'HBTl'

        HistoryPrefs = b'CHsP'

        HistoryState = b'HstS'

        HueSatAdjustment = b'HStA'

        HueSatAdjustmentV2 = b'Hst2'

        HueSaturation = b'HStr'

        IFFFormat = b'IFFF'

        IllustratorPathsExport = b'IlsP'

        ImagePoint = b'ImgP'

        Import = b'Impr'

        IndexedColorMode = b'IndC'

        InkTransfer = b'InkT'

        InnerGlow = b'IrGl'

        InnerShadow = b'IrSh'

        InterfaceColor = b'IClr'

        Invert = b'Invr'

        JPEGFormat = b'JPEG'

        LabColor = b'LbCl'

        LabColorMode = b'LbCM'

        Layer = b'Lyr '

        LayerEffects = b'Lefx'

        LayerFXVisible = b'lfxv'

        Levels = b'Lvls'

        LevelsAdjustment = b'LvlA'

        LightSource = b'LghS'

        Line = b'Ln '

        MacPaintFormat = b'McPn'

        MagicEraserTool = b'MgEr'

        MagicPoint = b'Mgcp'

        Mask = b'Msk '

        MenuItem = b'Mn '

        Mode = b'Md '

        MultichannelMode = b'MltC'

        Null = b'null'

        ObsoleteTextLayer = b'TxLy'

        Offset = b'Ofst'

        Opacity = b'Opac'

        OuterGlow = b'OrGl'

        PDFGenericFormat = b'PDFG'

        PICTFileFormat = b'PICF'

        PICTResourceFormat = b'PICR'

        PNGFormat = b'PNGF'

        PageSetup = b'PgSt'

        PaintbrushTool = b'PbTl'

        Path = b'Path'

        PathComponent = b'PaCm'

        PathPoint = b'Pthp'

        Pattern = b'PttR'

        PatternStampTool = b'PaTl'

        PencilTool = b'PcTl'

        Photoshop20Format = b'Pht2'

        Photoshop35Format = b'Pht3'

        PhotoshopDCS2Format = b'PhD2'

        PhotoshopDCSFormat = b'PhD1'

        PhotoshopEPSFormat = b'PhtE'

        PhotoshopPDFFormat = b'PhtP'

        Pixel = b'Pxel'

        PixelPaintFormat = b'PxlP'

        PluginPrefs = b'PlgP'

        Point = b'Pnt '

        Point16 = b'Pnt1'

        Polygon = b'Plgn'

        Posterize = b'Pstr'

        Preferences = b'GnrP'

        ProfileSetup = b'PrfS'

        Property = b'Prpr'

        RGBColor = b'RGBC'

        RGBColorMode = b'RGBM'

        RGBSetup = b'RGBt'

        Range = b'Rang'

        RawFormat = b'Rw '

        Rect16 = b'Rct1'

        Rectangle = b'Rctn'

        SaturationTool = b'SrTl'

        ScitexCTFormat = b'Sctx'

        Selection = b'csel'

        SelectiveColor = b'SlcC'

        ShapingCurve = b'ShpC'

        SharpenTool = b'ShTl'

        SingleColumn = b'Sngc'

        SingleRow = b'Sngr'

        SmudgeTool = b'SmTl'

        Snapshot = b'SnpS'

        SolidFill = b'SoFi'

        SpotColorChannel = b'SCch'

        Style = b'StyC'

        SubPath = b'Sbpl'

        TIFFFormat = b'TIFF'

        TargaFormat = b'TrgF'

        TextLayer = b'TxLr'

        TextStyle = b'TxtS'

        TextStyleRange = b'Txtt'

        Threshold = b'Thrs'

        Tool = b'Tool'

        TransferPoint = b'DtnP'

        TransferSpec = b'Trfp'

        TransparencyPrefs = b'TrnP'

        TransparencyStop = b'TrnS'

        UnitsPrefs = b'UntP'

        UnspecifiedColor = b'UnsC'

        Version = b'Vrsn'

        WebdavPrefs = b'Wdbv'

        XYYColor = b'XYYC'

  Enum

    class psd_tools.terminology.Enum(*values)
        Enum definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        A = b'A '

        ADSBottoms = b'AdBt'

        ADSCentersH = b'AdCH'

        ADSCentersV = b'AdCV'

        ADSHorizontal = b'AdHr'

        ADSLefts = b'AdLf'

        ADSRights = b'AdRg'

        ADSTops = b'AdTp'

        ADSVertical = b'AdVr'

        ASCII = b'ASCI'

        AboutApp = b'AbAp'

        AbsColorimetric = b'AClr'

        Absolute = b'Absl'

        ActualPixels = b'ActP'

        Adaptive = b'Adpt'

        Add = b'Add '

        AdjustmentOptions = b'AdjO'

        AdobeRGB1998 = b'SMPT'

        AirbrushEraser = b'Arbs'

        All = b'Al '

        Amiga = b'Amga'

        AmountHigh = b'amHi'

        AmountLow = b'amLo'

        AmountMedium = b'amMd'

        Angle = b'Angl'

        AntiAliasCrisp = b'AnCr'

        AntiAliasHigh = b'AnHi'

        AntiAliasLow = b'AnLo'

        AntiAliasMedium = b'AnMd'

        AntiAliasNone = b'Anno'

        AntiAliasSmooth = b'AnSm'

        AntiAliasStrong = b'AnSt'

        Any = b'Any '

        AppleRGB = b'AppR'

        ApplyImage = b'AplI'

        AroundCenter = b'ArnC'

        Arrange = b'Arng'

        Ask = b'Ask '

        AskWhenOpening = b'AskW'

        B = b'B '

        Back = b'Back'

        Background = b'Bckg'

        BackgroundColor = b'BckC'

        Backward = b'Bckw'

        Behind = b'Bhnd'

        Best = b'Bst '

        Better = b'Dthb'

        Bicubic = b'Bcbc'

        Bilinear = b'Blnr'

        Binary = b'Bnry'

        BitDepth1 = b'BD1 '

        BitDepth16 = b'BD16'

        BitDepth24 = b'BD24'

        BitDepth32 = b'BD32'

        BitDepth4 = b'BD4 '

        BitDepth8 = b'BD8 '

        BitDepthA1R5G5B5 = b'1565'

        BitDepthA4R4G4B4 = b'4444'

        BitDepthR5G6B5 = b'x565'

        BitDepthX4R4G4B4 = b'x444'

        BitDepthX8R8G8B8 = b'x888'

        Bitmap = b'Btmp'

        Black = b'Blck'

        BlackAndWhite = b'BanW'

        BlackBody = b'BlcB'

        Blacks = b'Blks'

        Blast = b'Blst'

        BlockEraser = b'Blk '

        Blocks = b'Blks'

        Blue = b'Bl '

        Blues = b'Bls '

        Bottom = b'Bttm'

        BrushDarkRough = b'BrDR'

        BrushLightRough = b'BrsL'

        BrushSimple = b'BrSm'

        BrushSize = b'BrsS'

        BrushSparkle = b'BrSp'

        BrushWideBlurry = b'BrbW'

        BrushWideSharp = b'BrsW'

        BrushesAppend = b'BrsA'

        BrushesDefine = b'BrsD'

        BrushesDelete = b'Brsf'

        BrushesLoad = b'Brsd'

        BrushesNew = b'BrsN'

        BrushesOptions = b'BrsO'

        BrushesReset = b'BrsR'

        BrushesSave = b'Brsv'

        Builtin = b'Bltn'

        BurnInH = b'BrnH'

        BurnInM = b'BrnM'

        BurnInS = b'BrnS'

        ButtonMode = b'BtnM'

        CIERGB = b'CRGB'

        CMYK = b'CMYK'

        CMYK64 = b'CMSF'

        CMYKColor = b'ECMY'

        Calculations = b'Clcl'

        Cascade = b'Cscd'

        Center = b'Cntr'

        CenterGlow = b'SrcC'

        CenteredFrame = b'CtrF'

        ChannelOptions = b'ChnO'

        ChannelsPaletteOptions = b'ChnP'

        CheckerboardLarge = b'ChcL'

        CheckerboardMedium = b'ChcM'

        CheckerboardNone = b'ChcN'

        CheckerboardSmall = b'ChcS'

        Clear = b'Clar'

        ClearGuides = b'ClrG'

        Clipboard = b'Clpb'

        ClippingPath = b'ClpP'

        CloseAll = b'ClsA'

        CoarseDots = b'CrsD'

        Color = b'Clr '

        ColorBurn = b'CBrn'

        ColorDodge = b'CDdg'

        ColorMatch = b'ClMt'

        ColorNoise = b'ClNs'

        Colorimetric = b'Clrm'

        Composite = b'Cmps'

        ContourCustom = b'sp06'

        ContourDouble = b'sp04'

        ContourGaussian = b'sp02'

        ContourLinear = b'sp01'

        ContourSingle = b'sp03'

        ContourTriple = b'sp05'

        ConvertToCMYK = b'CnvC'

        ConvertToGray = b'CnvG'

        ConvertToLab = b'CnvL'

        ConvertToRGB = b'CnvR'

        CreateDuplicate = b'CrtD'

        CreateInterpolation = b'CrtI'

        Cross = b'Crs '

        CurrentLayer = b'CrrL'

        Custom = b'Cst '

        CustomPattern = b'Cstm'

        CustomStops = b'CstS'

        Cyan = b'Cyn '

        Cyans = b'Cyns'

        Dark = b'Drk '

        Darken = b'Drkn'

        DarkenOnly = b'DrkO'

        DashedLines = b'DshL'

        Desaturate = b'Dstt'

        Diamond = b'Dmnd'

        Difference = b'Dfrn'

        Diffusion = b'Dfsn'

        DiffusionDither = b'DfnD'

        DisplayCursorsPreferences = b'DspC'

        Dissolve = b'Dslv'

        Distort = b'Dstr'

        DodgeH = b'DdgH'

        DodgeM = b'DdgM'

        DodgeS = b'DdgS'

        Dots = b'Dts '

        Draft = b'Drft'

        Duotone = b'Dtn '

        EBUITU = b'EBT '

        EdgeGlow = b'SrcE'

        EliminateEvenFields = b'ElmE'

        EliminateOddFields = b'ElmO'

        Ellipse = b'Elps'

        Emboss = b'Embs'

        Exact = b'Exct'

        Exclusion = b'Xclu'

        FPXCompressLossyJPEG = b'FxJP'

        FPXCompressNone = b'FxNo'

        Faster = b'Dthf'

        File = b'Fle '

        FileInfo = b'FlIn'

        FillBack = b'FlBc'

        FillFore = b'FlFr'

        FillInverse = b'FlIn'

        FillSame = b'FlSm'

        FineDots = b'FnDt'

        First = b'Frst'

        FirstIdle = b'FrId'

        FitOnScreen = b'FtOn'

        ForegroundColor = b'FrgC'

        Forward = b'Frwr'

        FreeTransform = b'FrTr'

        Front = b'Frnt'

        FullDocument = b'FllD'

        FullSize = b'FlSz'

        GIFColorFileColorTable = b'GFCT'

        GIFColorFileColors = b'GFCF'

        GIFColorFileMicrosoftPalette = b'GFMS'

        GIFPaletteAdaptive = b'GFPA'

        GIFPaletteExact = b'GFPE'

        GIFPaletteOther = b'GFPO'

        GIFPaletteSystem = b'GFPS'

        GIFRequiredColorSpaceIndexed = b'GFCI'

        GIFRequiredColorSpaceRGB = b'GFRG'

        GIFRowOrderInterlaced = b'GFIN'

        GIFRowOrderNormal = b'GFNI'

        GaussianDistribution = b'Gsn '

        GeneralPreferences = b'GnrP'

        Good = b'Gd '

        GradientFill = b'GrFl'

        GrainClumped = b'GrnC'

        GrainContrasty = b'GrCn'

        GrainEnlarged = b'GrnE'

        GrainHorizontal = b'GrnH'

        GrainRegular = b'GrnR'

        GrainSoft = b'GrSf'

        GrainSpeckle = b'GrSp'

        GrainSprinkles = b'GrSr'

        GrainStippled = b'GrSt'

        GrainVertical = b'GrnV'

        GrainyDots = b'GrnD'

        Graphics = b'Grp '

        Gray = b'Gry '

        Gray16 = b'GryX'

        Gray18 = b'Gr18'

        Gray22 = b'Gr22'

        Gray50 = b'Gr50'

        GrayScale = b'Gryc'

        Grayscale = b'Grys'

        Green = b'Grn '

        Greens = b'Grns'

        GuidesGridPreferences = b'GudG'

        HDTV = b'HDTV'

        HSBColor = b'HSBl'

        HSLColor = b'HSLC'

        HalftoneFile = b'HlfF'

        HalftoneScreen = b'HlfS'

        HardLight = b'HrdL'

        Heavy = b'Hvy '

        HideAll = b'HdAl'

        HideSelection = b'HdSl'

        High = b'High'

        HighQuality = b'Hgh '

        Highlights = b'Hghl'

        Histogram = b'Hstg'

        History = b'Hsty'

        HistoryPaletteOptions = b'HstO'

        HistoryPreferences = b'HstP'

        Horizontal = b'Hrzn'

        HorizontalOnly = b'HrzO'

        Hue = b'H '

        IBMPC = b'IBMP'

        ICC = b'ICC '

        Icon = b'Icn '

        IdleVM = b'IdVM'

        Ignore = b'Ignr'

        Image = b'Img '

        ImageCachePreferences = b'ImgP'

        IndexedColor = b'Indl'

        InfoPaletteOptions = b'InfP'

        InfoPaletteToggleSamplers = b'InfT'

        InnerBevel = b'InrB'

        InsetFrame = b'InsF'

        Inside = b'Insd'

        JPEG = b'JPEG'

        JustifyAll = b'JstA'

        JustifyFull = b'JstF'

        KeepProfile = b'KPro'

        KeyboardPreferences = b'KybP'

        Lab = b'Lab '

        Lab48 = b'LbCF'

        LabColor = b'LbCl'

        Large = b'Lrg '

        Last = b'Lst '

        LastFilter = b'LstF'

        LayerOptions = b'LyrO'

        LayersPaletteOptions = b'LyrP'

        Left = b'Left'

        Left_PLUGIN = b'Lft '

        LevelBased = b'LvlB'

        Light = b'Lgt '

        LightBlue = b'LgtB'

        LightDirBottom = b'LDBt'

        LightDirBottomLeft = b'LDBL'

        LightDirBottomRight = b'LDBR'

        LightDirLeft = b'LDLf'

        LightDirRight = b'LDRg'

        LightDirTop = b'LDTp'

        LightDirTopLeft = b'LDTL'

        LightDirTopRight = b'LDTR'

        LightDirectional = b'LghD'

        LightGray = b'LgtG'

        LightOmni = b'LghO'

        LightPosBottom = b'LPBt'

        LightPosBottomLeft = b'LPBL'

        LightPosBottomRight = b'LPBr'

        LightPosLeft = b'LPLf'

        LightPosRight = b'LPRg'

        LightPosTop = b'LPTp'

        LightPosTopLeft = b'LPTL'

        LightPosTopRight = b'LPTR'

        LightRed = b'LgtR'

        LightSpot = b'LghS'

        Lighten = b'Lghn'

        LightenOnly = b'LghO'

        Lightness = b'Lght'

        Line = b'Ln '

        Linear = b'Lnr '

        Lines = b'Lns '

        Linked = b'Lnkd'

        LongLines = b'LngL'

        LongStrokes = b'LngS'

        Low = b'Low '

        LowQuality = b'Lw '

        Lower = b'Lwr '

        Luminosity = b'Lmns'

        MacThumbnail = b'McTh'

        Macintosh = b'Mcnt'

        MacintoshSystem = b'McnS'

        Magenta = b'Mgnt'

        Magentas = b'Mgnt'

        Mask = b'Msk '

        MaskedAreas = b'MskA'

        MasterAdaptive = b'MAdp'

        MasterPerceptual = b'MPer'

        MasterSelective = b'MSel'

        Maximum = b'Mxmm'

        MaximumQuality = b'Mxm '

        Maya = b'Maya'

        Medium = b'Mdim'

        MediumBlue = b'MdmB'

        MediumDots = b'MdmD'

        MediumLines = b'MdmL'

        MediumQuality = b'Mdm '

        MediumStrokes = b'MdmS'

        MemoryPreferences = b'MmrP'

        MergeChannels = b'MrgC'

        Merged = b'Mrgd'

        MergedLayers = b'Mrg2'

        MergedLayersOld = b'MrgL'

        Middle = b'Mddl'

        Midtones = b'Mdtn'

        ModeGray = b'MdGr'

        ModeRGB = b'MdRG'

        Monitor = b'Moni'

        MonitorSetup = b'MntS'

        Monotone = b'Mntn'

        Multi72Color = b'72CM'

        Multi72Gray = b'72GM'

        MultiNoCompositePS = b'NCmM'

        Multichannel = b'Mlth'

        Multiply = b'Mltp'

        NTSC = b'NTSC'

        NavigatorPaletteOptions = b'NvgP'

        NearestNeighbor = b'Nrst'

        NetscapeGray = b'NsGr'

        Neutrals = b'Ntrl'

        NewView = b'NwVw'

        Next = b'Nxt '

        Nikon = b'Nkn '

        Nikon105 = b'Nkn1'

        No = b'N '

        NoCompositePS = b'NCmp'

        Normal = b'Nrml'

        NormalPath = b'NrmP'

        Null = b'null'

        OS2 = b'OS2 '

        Off = b'Off '

        On = b'On '

        OpenAs = b'OpAs'

        Orange = b'Orng'

        OutFromCenter = b'OtFr'

        OutOfGamut = b'OtOf'

        OuterBevel = b'OtrB'

        OutsetFrame = b'OutF'

        Outside = b'Otsd'

        Overlay = b'Ovrl'

        P22EBU = b'P22B'

        PNGFilterAdaptive = b'PGAd'

        PNGFilterAverage = b'PGAv'

        PNGFilterNone = b'PGNo'

        PNGFilterPaeth = b'PGPt'

        PNGFilterSub = b'PGSb'

        PNGFilterUp = b'PGUp'

        PNGInterlaceAdam7 = b'PGIA'

        PNGInterlaceNone = b'PGIN'

        PagePosCentered = b'PgPC'

        PagePosTopLeft = b'PgTL'

        PageSetup = b'PgSt'

        PaintbrushEraser = b'Pntb'

        PalSecam = b'PlSc'

        PanaVision = b'PnVs'

        PathsPaletteOptions = b'PthP'

        Pattern = b'Ptrn'

        PatternDither = b'PtnD'

        PencilEraser = b'Pncl'

        Perceptual = b'Perc'

        Perspective = b'Prsp'

        PhotoshopPicker = b'Phtk'

        PickCMYK = b'PckC'

        PickGray = b'PckG'

        PickHSB = b'PckH'

        PickLab = b'PckL'

        PickOptions = b'PckO'

        PickRGB = b'PckR'

        PillowEmboss = b'PlEb'

        PixelPaintSize1 = b'PxS1'

        PixelPaintSize2 = b'PxS2'

        PixelPaintSize3 = b'PxS3'

        PixelPaintSize4 = b'PxS4'

        Place = b'Plce'

        PlaybackOptions = b'PbkO'

        PluginPicker = b'PlgP'

        PluginsScratchDiskPreferences = b'PlgS'

        PolarToRect = b'PlrR'

        PondRipples = b'PndR'

        Precise = b'Prc '

        PreciseMatte = b'PrBL'

        PreviewBlack = b'PrvB'

        PreviewCMY = b'PrvN'

        PreviewCMYK = b'PrvC'

        PreviewCyan = b'Prvy'

        PreviewMagenta = b'PrvM'

        PreviewOff = b'PrvO'

        PreviewYellow = b'PrvY'

        Previous = b'Prvs'

        Primaries = b'Prim'

        PrintSize = b'PrnS'

        PrintingInksSetup = b'PrnI'

        Purple = b'Prp '

        Pyramids = b'Pyrm'

        QCSAverage = b'Qcsa'

        QCSCorner0 = b'Qcs0'

        QCSCorner1 = b'Qcs1'

        QCSCorner2 = b'Qcs2'

        QCSCorner3 = b'Qcs3'

        QCSIndependent = b'Qcsi'

        QCSSide0 = b'Qcs4'

        QCSSide1 = b'Qcs5'

        QCSSide2 = b'Qcs6'

        QCSSide3 = b'Qcs7'

        Quadtone = b'Qdtn'

        QueryAlways = b'QurA'

        QueryAsk = b'Qurl'

        QueryNever = b'QurN'

        RGB = b'RGB '

        RGB48 = b'RGBF'

        RGBColor = b'RGBC'

        Radial = b'Rdl '

        Random = b'Rndm'

        RectToPolar = b'RctP'

        Red = b'Rd '

        RedrawComplete = b'RdCm'

        Reds = b'Rds '

        Reflected = b'Rflc'

        Relative = b'Rltv'

        Repeat = b'Rpt '

        RepeatEdgePixels = b'RptE'

        RevealAll = b'RvlA'

        RevealSelection = b'RvlS'

        Revert = b'Rvrt'

        Right = b'Rght'

        Rotate = b'Rtte'

        RotoscopingPreferences = b'RtsP'

        Round = b'Rnd '

        RulerCm = b'RrCm'

        RulerInches = b'RrIn'

        RulerPercent = b'RrPr'

        RulerPicas = b'RrPi'

        RulerPixels = b'RrPx'

        RulerPoints = b'RrPt'

        SMPTEC = b'SMPC'

        SRGB = b'SRGB'

        Sample3x3 = b'Smp3'

        Sample5x5 = b'Smp5'

        SamplePoint = b'SmpP'

        Saturate = b'Str '

        Saturation = b'Strt'

        SaveForWeb = b'Svfw'

        Saved = b'Sved'

        SavingFilesPreferences = b'SvnF'

        Scale = b'Scl '

        Screen = b'Scrn'

        ScreenCircle = b'ScrC'

        ScreenDot = b'ScrD'

        ScreenLine = b'ScrL'

        SelectedAreas = b'SlcA'

        Selection = b'Slct'

        Selective = b'Sele'

        SeparationSetup = b'SprS'

        SeparationTables = b'SprT'

        Shadows = b'Shdw'

        ShortLines = b'ShrL'

        ShortStrokes = b'ShSt'

        Single72Color = b'72CS'

        Single72Gray = b'72GS'

        SingleNoCompositePS = b'NCmS'

        Skew = b'Skew'

        SlopeLimitMatte = b'Slmt'

        Small = b'Sml '

        SmartBlurModeEdgeOnly = b'SBME'

        SmartBlurModeNormal = b'SBMN'

        SmartBlurModeOverlayEdge = b'SBMO'

        SmartBlurQualityHigh = b'SBQH'

        SmartBlurQualityLow = b'SBQL'

        SmartBlurQualityMedium = b'SBQM'

        Snapshot = b'Snps'

        SoftLight = b'SftL'

        SoftMatte = b'SfBL'

        SolidColor = b'SClr'

        Spectrum = b'Spct'

        Spin = b'Spn '

        SpotColor = b'Spot'

        Square = b'Sqr '

        Stagger = b'Stgr'

        StampIn = b'In '

        StampOut = b'Out '

        Standard = b'Std '

        StdA = b'StdA'

        StdB = b'StdB'

        StdC = b'StdC'

        StdE = b'StdE'

        StretchToFit = b'StrF'

        StrokeDirHorizontal = b'SDHz'

        StrokeDirLeftDiag = b'SDLD'

        StrokeDirRightDiag = b'SDRD'

        StrokeDirVertical = b'SDVt'

        StylesAppend = b'SlsA'

        StylesDelete = b'Slsf'

        StylesLoad = b'Slsd'

        StylesNew = b'SlsN'

        StylesReset = b'SlsR'

        StylesSave = b'Slsv'

        Subtract = b'Sbtr'

        SwatchesAppend = b'SwtA'

        SwatchesReplace = b'Swtp'

        SwatchesReset = b'SwtR'

        SwatchesSave = b'SwtS'

        SystemPicker = b'SysP'

        TIFF = b'TIFF'

        Tables = b'Tbl '

        Target = b'Trgt'

        TargetPath = b'Trgp'

        TexTypeBlocks = b'TxBl'

        TexTypeBrick = b'TxBr'

        TexTypeBurlap = b'TxBu'

        TexTypeCanvas = b'TxCa'

        TexTypeFrosted = b'TxFr'

        TexTypeSandstone = b'TxSt'

        TexTypeTinyLens = b'TxTL'

        Threshold = b'Thrh'

        Thumbnail = b'Thmb'

        Tile = b'Tile'

        Tile_PLUGIN = b'Tl '

        ToggleActionsPalette = b'TglA'

        ToggleBlackPreview = b'TgBP'

        ToggleBrushesPalette = b'TglB'

        ToggleCMYKPreview = b'TglC'

        ToggleCMYPreview = b'TgCM'

        ToggleChannelsPalette = b'Tglh'

        ToggleColorPalette = b'Tglc'

        ToggleCyanPreview = b'TgCP'

        ToggleDocumentPalette = b'TgDc'

        ToggleEdges = b'TglE'

        ToggleGamutWarning = b'TglG'

        ToggleGrid = b'TgGr'

        ToggleGuides = b'Tgld'

        ToggleHistoryPalette = b'TglH'

        ToggleInfoPalette = b'TglI'

        ToggleLayerMask = b'TglM'

        ToggleLayersPalette = b'Tgly'

        ToggleLockGuides = b'TglL'

        ToggleMagentaPreview = b'TgMP'

        ToggleNavigatorPalette = b'TglN'

        ToggleOptionsPalette = b'TglO'

        TogglePaths = b'TglP'

        TogglePathsPalette = b'Tglt'

        ToggleRGBMacPreview = b'TrMp'

        ToggleRGBUncompensatedPreview = b'TrUp'

        ToggleRGBWindowsPreview = b'TrWp'

        ToggleRulers = b'TglR'

        ToggleSnapToGrid = b'TgSn'

        ToggleSnapToGuides = b'TglS'

        ToggleStatusBar = b'Tgls'

        ToggleStylesPalette = b'TgSl'

        ToggleSwatchesPalette = b'Tglw'

        ToggleToolsPalette = b'TglT'

        ToggleYellowPreview = b'TgYP'

        Top = b'Top '

        Transparency = b'Trsp'

        TransparencyGamutPreferences = b'TrnG'

        Transparent = b'Trns'

        Trinitron = b'Trnt'

        Tritone = b'Trtn'

        UIBitmap = b'UBtm'

        UICMYK = b'UCMY'

        UIDuotone = b'UDtn'

        UIGrayscale = b'UGry'

        UIIndexed = b'UInd'

        UILab = b'ULab'

        UIMultichannel = b'UMlt'

        UIRGB = b'URGB'

        Undo = b'Und '

        Uniform = b'Unfm'

        UniformDistribution = b'Unfr'

        UnitsRulersPreferences = b'UntR'

        Upper = b'Upr '

        UserStop = b'UsrS'

        VMPreferences = b'VMPr'

        Vertical = b'Vrtc'

        VerticalOnly = b'VrtO'

        Violet = b'Vlt '

        WaveSine = b'WvSn'

        WaveSquare = b'WvSq'

        WaveTriangle = b'WvTr'

        Web = b'Web '

        White = b'Wht '

        Whites = b'Whts'

        WideGamutRGB = b'WRGB'

        WidePhosphors = b'Wide'

        WinThumbnail = b'WnTh'

        Wind = b'Wnd '

        Windows = b'Win '

        WindowsSystem = b'WndS'

        WorkPath = b'WrkP'

        Wrap = b'Wrp '

        WrapAround = b'WrpA'

        Yellow = b'Yllw'

        YellowColor = b'Ylw '

        Yellows = b'Ylws'

        Yes = b'Ys '

        Zip = b'ZpEn'

        Zoom = b'Zm '

        ZoomIn = b'ZmIn'

        ZoomOut = b'ZmOt'

        _16BitsPerPixel = b'16Bt'

        _1BitPerPixel = b'OnBt'

        _2BitsPerPixel = b'2Bts'

        _32BitsPerPixel = b'32Bt'

        _4BitsPerPixel = b'4Bts'

        _5000 = b'5000'

        _5500 = b'5500'

        _6500 = b'6500'

        _72Color = b'72Cl'

        _72Gray = b'72Gr'

        _7500 = b'7500'

        _8BitsPerPixel = b'EghB'

        _9300 = b'9300'

        _None = b'None'

  Event

    class psd_tools.terminology.Event(*values)
        Event definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        AccentedEdges = b'AccE'

        Add = b'Add '

        AddNoise = b'AdNs'

        AddTo = b'AddT'

        Align = b'Algn'

        All = b'All '

        AngledStrokes = b'AngS'

        ApplyImage = b'AppI'

        ApplyStyle = b'ASty'

        Assert = b'Asrt'

        Average = b'Avrg'

        BackLight = b'BacL'

        BasRelief = b'BsRl'

        Batch = b'Btch'

        BatchFromDroplet = b'BtcF'

        Blur = b'Blr '

        BlurMore = b'BlrM'

        Border = b'Brdr'

        Brightness = b'BrgC'

        CanvasSize = b'CnvS'

        ChalkCharcoal = b'ChlC'

        ChannelMixer = b'ChnM'

        Charcoal = b'Chrc'

        Chrome = b'Chrm'

        Clear = b'Cler'

        Close = b'Cls '

        Clouds = b'Clds'

        ColorBalance = b'ClrB'

        ColorCast = b'ColE'

        ColorHalftone = b'ClrH'

        ColorRange = b'ClrR'

        ColoredPencil = b'ClrP'

        ConteCrayon = b'CntC'

        Contract = b'Cntc'

        ConvertMode = b'CnvM'

        Copy = b'copy'

        CopyEffects = b'CpFX'

        CopyMerged = b'CpyM'

        CopyToLayer = b'CpTL'

        Craquelure = b'Crql'

        CreateDroplet = b'CrtD'

        Crop = b'Crop'

        Crosshatch = b'Crsh'

        Crystallize = b'Crst'

        Curves = b'Crvs'

        Custom = b'Cstm'

        Cut = b'cut '

        CutToLayer = b'CtTL'

        Cutout = b'Ct '

        DarkStrokes = b'DrkS'

        DeInterlace = b'Dntr'

        DefinePattern = b'DfnP'

        Defringe = b'Dfrg'

        Delete = b'Dlt '

        Desaturate = b'Dstt'

        Deselect = b'Dslc'

        Despeckle = b'Dspc'

        DifferenceClouds = b'DfrC'

        Diffuse = b'Dfs '

        DiffuseGlow = b'DfsG'

        DisableLayerFX = b'dlfx'

        Displace = b'Dspl'

        Distribute = b'Dstr'

        Draw = b'Draw'

        DryBrush = b'DryB'

        Duplicate = b'Dplc'

        DustAndScratches = b'DstS'

        Emboss = b'Embs'

        Equalize = b'Eqlz'

        Exchange = b'Exch'

        Expand = b'Expn'

        Export = b'Expr'

        Extrude = b'Extr'

        Facet = b'Fct '

        Fade = b'Fade'

        Feather = b'Fthr'

        Fibers = b'Fbrs'

        Fill = b'Fl '

        FilmGrain = b'FlmG'

        Filter = b'Fltr'

        FindEdges = b'FndE'

        FlattenImage = b'FltI'

        Flip = b'Flip'

        Fragment = b'Frgm'

        Fresco = b'Frsc'

        GaussianBlur = b'GsnB'

        Get = b'getd'

        Glass = b'Gls '

        GlowingEdges = b'GlwE'

        Gradient = b'Grdn'

        GradientMap = b'GrMp'

        Grain = b'Grn '

        GraphicPen = b'GraP'

        Group = b'GrpL'

        Grow = b'Grow'

        HSBHSL = b'HsbP'

        HalftoneScreen = b'HlfS'

        Hide = b'Hd '

        HighPass = b'HghP'

        HueSaturation = b'HStr'

        ImageSize = b'ImgS'

        Import = b'Impr'

        InkOutlines = b'InkO'

        Intersect = b'Intr'

        IntersectWith = b'IntW'

        Inverse = b'Invs'

        Invert = b'Invr'

        LensFlare = b'LnsF'

        Levels = b'Lvls'

        LightingEffects = b'LghE'

        Link = b'Lnk '

        Make = b'Mk '

        Maximum = b'Mxm '

        Median = b'Mdn '

        MergeLayers = b'Mrg2'

        MergeLayersOld = b'MrgL'

        MergeSpotChannel = b'MSpt'

        MergeVisible = b'MrgV'

        Mezzotint = b'Mztn'

        Minimum = b'Mnm '

        Mosaic = b'Msc '

        Mosaic_PLUGIN = b'MscT'

        MotionBlur = b'MtnB'

        Move = b'move'

        NTSCColors = b'NTSC'

        NeonGlow = b'NGlw'

        Next = b'Nxt '

        NotePaper = b'NtPr'

        Notify = b'Ntfy'

        Null = b'null'

        OceanRipple = b'OcnR'

        Offset = b'Ofst'

        Open = b'Opn '

        OpenUntitled = b'OpnU'

        PaintDaubs = b'PntD'

        PaletteKnife = b'PltK'

        Paste = b'past'

        PasteEffects = b'PaFX'

        PasteInto = b'PstI'

        PasteOutside = b'PstO'

        Patchwork = b'Ptch'

        Photocopy = b'Phtc'

        Pinch = b'Pnch'

        Place = b'Plc '

        Plaster = b'Plst'

        PlasticWrap = b'PlsW'

        Play = b'Ply '

        Pointillize = b'Pntl'

        Polar = b'Plr '

        PosterEdges = b'PstE'

        Posterize = b'Pstr'

        Previous = b'Prvs'

        Print = b'Prnt'

        ProfileToProfile = b'PrfT'

        Purge = b'Prge'

        Quit = b'quit'

        RadialBlur = b'RdlB'

        Rasterize = b'Rstr'

        RasterizeTypeSheet = b'RstT'

        RemoveBlackMatte = b'RmvB'

        RemoveLayerMask = b'RmvL'

        RemoveWhiteMatte = b'RmvW'

        Rename = b'Rnm '

        ReplaceColor = b'RplC'

        Reset = b'Rset'

        Reticulation = b'Rtcl'

        Revert = b'Rvrt'

        Ripple = b'Rple'

        Rotate = b'Rtte'

        RoughPastels = b'RghP'

        Save = b'save'

        Select = b'slct'

        SelectiveColor = b'SlcC'

        Set = b'setd'

        Sharpen = b'Shrp'

        SharpenEdges = b'ShrE'

        SharpenMore = b'ShrM'

        Shear = b'Shr '

        Show = b'Shw '

        Similar = b'Smlr'

        SmartBlur = b'SmrB'

        Smooth = b'Smth'

        SmudgeStick = b'SmdS'

        Solarize = b'Slrz'

        Spatter = b'Spt '

        Spherize = b'Sphr'

        SplitChannels = b'SplC'

        Sponge = b'Spng'

        SprayedStrokes = b'SprS'

        StainedGlass = b'StnG'

        Stamp = b'Stmp'

        Stop = b'Stop'

        Stroke = b'Strk'

        Subtract = b'Sbtr'

        SubtractFrom = b'SbtF'

        Sumie = b'Smie'

        TakeMergedSnapshot = b'TkMr'

        TakeSnapshot = b'TkSn'

        TextureFill = b'TxtF'

        Texturizer = b'Txtz'

        Threshold = b'Thrs'

        Tiles = b'Tls '

        TornEdges = b'TrnE'

        TraceContour = b'TrcC'

        Transform = b'Trnf'

        Trap = b'Trap'

        Twirl = b'Twrl'

        Underpainting = b'Undr'

        Undo = b'undo'

        Ungroup = b'Ungr'

        Unlink = b'Unlk'

        UnsharpMask = b'UnsM'

        Variations = b'Vrtn'

        Wait = b'Wait'

        WaterPaper = b'WtrP'

        Watercolor = b'Wtrc'

        Wave = b'Wave'

        Wind = b'Wnd '

        ZigZag = b'ZgZg'

        _3DTransform = b'TdT '

  Form

    class psd_tools.terminology.Form(*values)
        Form definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        Class = b'Clss'

        Enumerated = b'Enmr'

        Identifier = b'Idnt'

        Index = b'indx'

        Offset = b'rele'

        Property = b'prop'

  Key

    class psd_tools.terminology.Key(*values)
        Key definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        A = b'A '

        Adjustment = b'Adjs'

        Aligned = b'Algd'

        Alignment = b'Algn'

        AllExcept = b'AllE'

        AllPS = b'All '

        AllToolOptions = b'AlTl'

        AlphaChannelOptions = b'AChn'

        AlphaChannels = b'AlpC'

        AmbientBrightness = b'AmbB'

        AmbientColor = b'AmbC'

        Amount = b'Amnt'

        AmplitudeMax = b'AmMx'

        AmplitudeMin = b'AmMn'

        Anchor = b'Anch'

        Angle = b'Angl'

        Angle1 = b'Ang1'

        Angle2 = b'Ang2'

        Angle3 = b'Ang3'

        Angle4 = b'Ang4'

        AntiAlias = b'AntA'

        Append = b'Appe'

        Apply = b'Aply'

        Area = b'Ar '

        Arrowhead = b'Arrw'

        As = b'As '

        AssetBin = b'Asst'

        AssumedCMYK = b'AssC'

        AssumedGray = b'AssG'

        AssumedRGB = b'AssR'

        At = b'At '

        Auto = b'Auto'

        AutoContrast = b'AuCo'

        AutoErase = b'Atrs'

        AutoKern = b'AtKr'

        AutoUpdate = b'AtUp'

        Axis = b'Axis'

        B = b'B '

        Background = b'Bckg'

        BackgroundColor = b'BckC'

        BackgroundLevel = b'BckL'

        Backward = b'Bwd '

        Balance = b'Blnc'

        BaselineShift = b'Bsln'

        BeepWhenDone = b'BpWh'

        BeginRamp = b'BgnR'

        BeginSustain = b'BgnS'

        BevelDirection = b'bvlD'

        BevelEmboss = b'ebbl'

        BevelStyle = b'bvlS'

        BevelTechnique = b'bvlT'

        BigNudgeH = b'BgNH'

        BigNudgeV = b'BgNV'

        BitDepth = b'BtDp'

        Black = b'Blck'

        BlackClip = b'BlcC'

        BlackGeneration = b'Blcn'

        BlackGenerationCurve = b'BlcG'

        BlackIntensity = b'BlcI'

        BlackLevel = b'BlcL'

        BlackLimit = b'BlcL'

        Bleed = b'Bld '

        BlendRange = b'Blnd'

        Blue = b'Bl '

        BlueBlackPoint = b'BlBl'

        BlueFloat = b'blueFloat'

        BlueGamma = b'BlGm'

        BlueWhitePoint = b'BlWh'

        BlueX = b'BlX '

        BlueY = b'BlY '

        Blur = b'blur'

        BlurMethod = b'BlrM'

        BlurQuality = b'BlrQ'

        Book = b'Bk '

        BorderThickness = b'BrdT'

        Bottom = b'Btom'

        Brightness = b'Brgh'

        BrushDetail = b'BrsD'

        BrushSize = b'BrsS'

        BrushType = b'BrsT'

        Brushes = b'Brsh'

        BumpAmplitude = b'BmpA'

        BumpChannel = b'BmpC'

        By = b'By '

        Byline = b'Byln'

        BylineTitle = b'BylT'

        ByteOrder = b'BytO'

        CMYKSetup = b'CMYS'

        CachePrefs = b'CchP'

        Calculation = b'Clcl'

        CalibrationBars = b'Clbr'

        Caption = b'Cptn'

        CaptionWriter = b'CptW'

        Category = b'Ctgr'

        CellSize = b'ClSz'

        Center = b'Cntr'

        CenterCropMarks = b'CntC'

        ChalkArea = b'ChlA'

        Channel = b'Chnl'

        ChannelMatrix = b'ChMx'

        ChannelName = b'ChnN'

        Channels = b'Chns'

        ChannelsInterleaved = b'ChnI'

        CharcoalAmount = b'ChAm'

        CharcoalArea = b'ChrA'

        ChokeMatte = b'Ckmt'

        ChromeFX = b'ChFX'

        City = b'City'

        ClearAmount = b'ClrA'

        ClippingPath = b'ClPt'

        ClippingPathEPS = b'ClpP'

        ClippingPathFlatness = b'ClpF'

        ClippingPathIndex = b'ClpI'

        ClippingPathInfo = b'Clpg'

        CloneSource = b'ClnS'

        ClosedSubpath = b'Clsp'

        Color = b'Clr '

        ColorChannels = b'Clrh'

        ColorCorrection = b'ClrC'

        ColorIndicates = b'ClrI'

        ColorManagement = b'ClMg'

        ColorPickerPrefs = b'Clrr'

        ColorSpace = b'ClrS'

        ColorTable = b'ClrT'

        Colorize = b'Clrz'

        Colors = b'Clrs'

        ColorsList = b'ClrL'

        ColumnWidth = b'ClmW'

        CommandKey = b'CmdK'

        Compensation = b'Cmpn'

        Compression = b'Cmpr'

        Concavity = b'Cncv'

        Condition = b'Cndt'

        Constant = b'Cnst'

        Constrain = b'Cnst'

        ConstrainProportions = b'CnsP'

        ConstructionFOV = b'Cfov'

        Contiguous = b'Cntg'

        Continue = b'Cntn'

        Continuity = b'Cnty'

        ContourType = b'ShpC'

        Contrast = b'Cntr'

        Convert = b'Cnvr'

        Copy = b'Cpy '

        Copyright = b'Cpyr'

        CopyrightNotice = b'CprN'

        CornerCropMarks = b'CrnC'

        Count = b'Cnt '

        CountryName = b'CntN'

        CrackBrightness = b'CrcB'

        CrackDepth = b'CrcD'

        CrackSpacing = b'CrcS'

        CreateLayersFromLayerFX = b'blfl'

        Credit = b'Crdt'

        Crossover = b'Crss'

        Current = b'Crnt'

        CurrentHistoryState = b'CrnH'

        CurrentLight = b'CrnL'

        CurrentToolOptions = b'CrnT'

        Curve = b'Crv '

        CurveFile = b'CrvF'

        Custom = b'Cstm'

        CustomForced = b'CstF'

        CustomMatte = b'CstM'

        CustomPalette = b'CstP'

        Cyan = b'Cyn '

        DCS = b'DCS '

        DPXFormat = b'DPXf'

        DarkIntensity = b'DrkI'

        Darkness = b'Drkn'

        DateCreated = b'DtCr'

        Datum = b'Dt '

        Definition = b'Dfnt'

        Density = b'Dnst'

        Depth = b'Dpth'

        DestBlackMax = b'Dstl'

        DestBlackMin = b'DstB'

        DestWhiteMax = b'Dstt'

        DestWhiteMin = b'DstW'

        DestinationMode = b'DstM'

        Detail = b'Dtl '

        Diameter = b'Dmtr'

        DiffusionDither = b'DffD'

        Direction = b'Drct'

        DirectionBalance = b'DrcB'

        DisplaceFile = b'DspF'

        DisplacementMap = b'DspM'

        DisplayPrefs = b'DspP'

        Distance = b'Dstn'

        Distortion = b'Dstr'

        Distribution = b'Dstr'

        Dither = b'Dthr'

        DitherAmount = b'DthA'

        DitherPreserve = b'Dthp'

        DitherQuality = b'Dthq'

        DocumentID = b'DocI'

        DotGain = b'DtGn'

        DotGainCurves = b'DtGC'

        DropShadow = b'DrSh'

        Duplicate = b'Dplc'

        DynamicColorSliders = b'DnmC'

        Edge = b'Edg '

        EdgeBrightness = b'EdgB'

        EdgeFidelity = b'EdgF'

        EdgeIntensity = b'EdgI'

        EdgeSimplicity = b'EdgS'

        EdgeThickness = b'EdgT'

        EdgeWidth = b'EdgW'

        Effect = b'Effc'

        EmbedCMYK = b'EmbC'

        EmbedGray = b'EmbG'

        EmbedLab = b'EmbL'

        EmbedProfiles = b'EmbP'

        EmbedRGB = b'EmbR'

        EmulsionDown = b'EmlD'

        EnableGestures = b'EGst'

        Enabled = b'enab'

        Encoding = b'Encd'

        End = b'End '

        EndArrowhead = b'EndA'

        EndRamp = b'EndR'

        EndSustain = b'EndS'

        Engine = b'Engn'

        EraseToHistory = b'ErsT'

        EraserKind = b'ErsK'

        ExactPoints = b'ExcP'

        Export = b'Expr'

        ExportClipboard = b'ExpC'

        Exposure = b'Exps'

        Extend = b'Extd'

        ExtendedQuality = b'EQlt'

        Extension = b'Extn'

        ExtensionsQuery = b'ExtQ'

        ExtrudeDepth = b'ExtD'

        ExtrudeMaskIncomplete = b'ExtM'

        ExtrudeRandom = b'ExtR'

        ExtrudeSize = b'ExtS'

        ExtrudeSolidFace = b'ExtF'

        ExtrudeType = b'ExtT'

        EyeDropperSample = b'EyDr'

        FPXCompress = b'FxCm'

        FPXQuality = b'FxQl'

        FPXSize = b'FxSz'

        FPXView = b'FxVw'

        FadeTo = b'FdT '

        FadeoutSteps = b'FdtS'

        Falloff = b'FlOf'

        Feather = b'Fthr'

        FiberLength = b'FbrL'

        File = b'File'

        FileCreator = b'FlCr'

        FileInfo = b'FlIn'

        FileReference = b'FilR'

        FileSavePrefs = b'FlSP'

        FileType = b'FlTy'

        FilesList = b'flst'

        Fill = b'Fl '

        FillColor = b'FlCl'

        FillNeutral = b'FlNt'

        FilterLayerPersistentData = b'FlPd'

        FilterLayerRandomSeed = b'FlRs'

        Fingerpainting = b'Fngr'

        FlareCenter = b'FlrC'

        Flatness = b'Fltn'

        Flatten = b'Fltt'

        FlipVertical = b'FlpV'

        Focus = b'Fcs '

        Folders = b'Fldr'

        FontDesignAxes = b'FntD'

        FontDesignAxesVectors = b'FntV'

        FontName = b'FntN'

        FontScript = b'Scrp'

        FontStyleName = b'FntS'

        FontTechnology = b'FntT'

        ForcedColors = b'FrcC'

        ForegroundColor = b'FrgC'

        ForegroundLevel = b'FrgL'

        Format = b'Fmt '

        Forward = b'Fwd '

        FrameFX = b'FrFX'

        FrameWidth = b'FrmW'

        FreeTransformCenterState = b'FTcs'

        Frequency = b'Frqn'

        From = b'From'

        FromBuiltin = b'FrmB'

        FromMode = b'FrmM'

        FunctionKey = b'FncK'

        Fuzziness = b'Fzns'

        GCR = b'GCR '

        GIFColorFileType = b'GFPT'

        GIFColorLimit = b'GFCL'

        GIFExportCaption = b'GFEC'

        GIFMaskChannelIndex = b'GFMI'

        GIFMaskChannelInverted = b'GFMV'

        GIFPaletteFile = b'GFPF'

        GIFPaletteType = b'GFPL'

        GIFRequiredColorSpaceType = b'GFCS'

        GIFRowOrderType = b'GFIT'

        GIFTransparentColor = b'GFTC'

        GIFTransparentIndexBlue = b'GFTB'

        GIFTransparentIndexGreen = b'GFTG'

        GIFTransparentIndexRed = b'GFTR'

        GIFUseBestMatch = b'GFBM'

        Gamma = b'Gmm '

        GamutWarning = b'GmtW'

        GeneralPrefs = b'GnrP'

        GlobalAngle = b'gblA'

        GlobalLightingAngle = b'gagl'

        Gloss = b'Glos'

        GlowAmount = b'GlwA'

        GlowTechnique = b'GlwT'

        Gradient = b'Grad'

        GradientFill = b'Grdf'

        Grain = b'Grn '

        GrainType = b'Grnt'

        Graininess = b'Grns'

        Gray = b'Gry '

        GrayBehavior = b'GrBh'

        GraySetup = b'GrSt'

        Green = b'Grn '

        GreenBlackPoint = b'GrnB'

        GreenFloat = b'greenFloat'

        GreenGamma = b'GrnG'

        GreenWhitePoint = b'GrnW'

        GreenX = b'GrnX'

        GreenY = b'GrnY'

        GridColor = b'GrdC'

        GridCustomColor = b'Grds'

        GridMajor = b'GrdM'

        GridMinor = b'Grdn'

        GridStyle = b'GrdS'

        GridUnits = b'Grdt'

        Group = b'Grup'

        GroutWidth = b'GrtW'

        GrowSelection = b'GrwS'

        Guides = b'Gdes'

        GuidesColor = b'GdsC'

        GuidesCustomColor = b'Gdss'

        GuidesPrefs = b'GdPr'

        GuidesStyle = b'GdsS'

        GutterWidth = b'GttW'

        HalftoneFile = b'HlfF'

        HalftoneScreen = b'HlfS'

        HalftoneSize = b'HlSz'

        HalftoneSpec = b'Hlfp'

        Hardness = b'Hrdn'

        HasCmdHPreference = b'HCdH'

        Header = b'Hdr '

        Headline = b'Hdln'

        Height = b'Hght'

        HighlightArea = b'HghA'

        HighlightColor = b'hglC'

        HighlightLevels = b'HghL'

        HighlightMode = b'hglM'

        HighlightOpacity = b'hglO'

        HighlightStrength = b'HghS'

        HistoryBrushSource = b'HstB'

        HistoryPrefs = b'HstP'

        HistoryStateSource = b'HsSS'

        HistoryStates = b'HsSt'

        Horizontal = b'Hrzn'

        HorizontalScale = b'HrzS'

        HostName = b'HstN'

        HostVersion = b'HstV'

        Hue = b'H '

        ICCEngine = b'ICCE'

        ICCSetupName = b'ICCt'

        ID = b'Idnt'

        Idle = b'Idle'

        ImageBalance = b'ImgB'

        Import = b'Impr'

        Impressionist = b'Imps'

        In = b'In '

        Inherits = b'c@#^'

        InkColors = b'InkC'

        Inks = b'Inks'

        InnerGlow = b'IrGl'

        InnerGlowSource = b'glwS'

        InnerShadow = b'IrSh'

        Input = b'Inpt'

        InputBlackPoint = b'kIBP'

        InputMapRange = b'Inmr'

        InputRange = b'Inpr'

        InputWhitePoint = b'kIWP'

        Intensity = b'Intn'

        Intent = b'Inte'

        InterfaceBevelHighlight = b'IntH'

        InterfaceBevelShadow = b'Intv'

        InterfaceBlack = b'IntB'

        InterfaceBorder = b'Intd'

        InterfaceButtonDarkShadow = b'Intk'

        InterfaceButtonDownFill = b'Intt'

        InterfaceButtonUpFill = b'InBF'

        InterfaceColorBlue2 = b'ICBL'

        InterfaceColorBlue32 = b'ICBH'

        InterfaceColorGreen2 = b'ICGL'

        InterfaceColorGreen32 = b'ICGH'

        InterfaceColorRed2 = b'ICRL'

        InterfaceColorRed32 = b'ICRH'

        InterfaceIconFillActive = b'IntI'

        InterfaceIconFillDimmed = b'IntF'

        InterfaceIconFillSelected = b'Intc'

        InterfaceIconFrameActive = b'Intm'

        InterfaceIconFrameDimmed = b'Intr'

        InterfaceIconFrameSelected = b'IntS'

        InterfacePaletteFill = b'IntP'

        InterfaceRed = b'IntR'

        InterfaceToolTipBackground = b'IntT'

        InterfaceToolTipText = b'ITTT'

        InterfaceTransparencyBackground = b'ITBg'

        InterfaceTransparencyForeground = b'ITFg'

        InterfaceWhite = b'IntW'

        Interlace = b'Intr'

        InterlaceCreateType = b'IntC'

        InterlaceEliminateType = b'IntE'

        Interpolation = b'Intr'

        InterpolationMethod = b'IntM'

        Invert = b'Invr'

        InvertMask = b'InvM'

        InvertSource2 = b'InvS'

        InvertTexture = b'InvT'

        IsDirty = b'IsDr'

        ItemIndex = b'ItmI'

        JPEGQuality = b'JPEQ'

        Kerning = b'Krng'

        Keywords = b'Kywd'

        Kind = b'Knd '

        LUTAnimation = b'LTnm'

        LZWCompression = b'LZWC'

        Labels = b'Lbls'

        Landscape = b'Lnds'

        LastTransform = b'LstT'

        Layer = b'Lyr '

        LayerEffects = b'Lefx'

        LayerFXVisible = b'lfxv'

        LayerID = b'LyrI'

        LayerName = b'LyrN'

        Layers = b'Lyrs'

        Leading = b'Ldng'

        Left = b'Left'

        LegacySerialString = b'lSNs'

        Length = b'Lngt'

        Lens = b'Lns '

        Level = b'Lvl '

        Levels = b'Lvls'

        LightDark = b'LgDr'

        LightDirection = b'LghD'

        LightIntensity = b'LghI'

        LightPosition = b'LghP'

        LightSource = b'LghS'

        LightType = b'LghT'

        LightenGrout = b'LghG'

        Lightness = b'Lght'

        Line = b'Line'

        LinkEnable = b'lnkE'

        LinkedLayerIDs = b'LnkL'

        LocalLightingAltitude = b'Lald'

        LocalLightingAngle = b'lagl'

        LocalRange = b'LclR'

        Location = b'Lctn'

        Log = b'Log '

        Logarithmic = b'kLog'

        LowerCase = b'LwCs'

        Luminance = b'Lmnc'

        Magenta = b'Mgnt'

        MakeVisible = b'MkVs'

        ManipulationFOV = b'Mfov'

        MapBlack = b'MpBl'

        Mapping = b'Mpng'

        MappingShape = b'MpgS'

        Material = b'Mtrl'

        Matrix = b'Mtrx'

        MatteColor = b'MttC'

        Maximum = b'Mxm '

        MaximumStates = b'MxmS'

        MemoryUsagePercent = b'MmrU'

        Merge = b'Mrge'

        Merged = b'Mrgd'

        Message = b'Msge'

        Method = b'Mthd'

        MezzotintType = b'MztT'

        Midpoint = b'Mdpn'

        MidtoneLevels = b'MdtL'

        Minimum = b'Mnm '

        MismatchCMYK = b'MsmC'

        MismatchGray = b'MsmG'

        MismatchRGB = b'MsmR'

        Mode = b'Md '

        Monochromatic = b'Mnch'

        MoveTo = b'MvT '

        Name = b'Nm '

        Negative = b'Ngtv'

        New = b'Nw '

        Noise = b'Nose'

        NonImageData = b'NnIm'

        NonLinear = b'NnLn'

        Null = b'null'

        NumLights = b'Nm L'

        Number = b'Nmbr'

        NumberOfCacheLevels = b'NCch'

        NumberOfCacheLevels64 = b'NC64'

        NumberOfChannels = b'NmbO'

        NumberOfChildren = b'NmbC'

        NumberOfDocuments = b'NmbD'

        NumberOfGenerators = b'NmbG'

        NumberOfLayers = b'NmbL'

        NumberOfLevels = b'NmbL'

        NumberOfPaths = b'NmbP'

        NumberOfRipples = b'NmbR'

        NumberOfSiblings = b'NmbS'

        ObjectName = b'ObjN'

        Offset = b'Ofst'

        OldSmallFontType = b'Sftt'

        On = b'On '

        Opacity = b'Opct'

        Optimized = b'Optm'

        Orientation = b'Ornt'

        OriginalHeader = b'OrgH'

        OriginalTransmissionReference = b'OrgT'

        OtherCursors = b'OthC'

        OuterGlow = b'OrGl'

        Output = b'Otpt'

        OutputBlackPoint = b'kOBP'

        OutputWhitePoint = b'kOWP'

        OverprintColors = b'OvrC'

        OverrideOpen = b'OvrO'

        OverridePrinter = b'ObrP'

        OverrideSave = b'Ovrd'

        PNGFilter = b'PNGf'

        PNGInterlaceType = b'PGIT'

        PageFormat = b'PMpf'

        PageNumber = b'PgNm'

        PagePosition = b'PgPs'

        PageSetup = b'PgSt'

        PaintCursorKind = b'PnCK'

        PaintType = b'PntT'

        PaintingCursors = b'PntC'

        Palette = b'Plt '

        PaletteFile = b'PltF'

        PaperBrightness = b'PprB'

        ParentIndex = b'PrIn'

        ParentName = b'PrNm'

        Path = b'Path'

        PathContents = b'PthC'

        PathName = b'PthN'

        Pattern = b'Pttn'

        PencilWidth = b'Pncl'

        PerspectiveIndex = b'Prsp'

        Phosphors = b'Phsp'

        PickerID = b'PckI'

        PickerKind = b'Pckr'

        PixelPaintSize = b'PPSz'

        Platform = b'Pltf'

        PluginFolder = b'PlgF'

        PluginPrefs = b'PlgP'

        Points = b'Pts '

        Position = b'Pstn'

        PostScriptColor = b'PstS'

        Posterization = b'Pstr'

        PredefinedColors = b'PrdC'

        PreferBuiltin = b'PrfB'

        Preferences = b'Prfr'

        PreserveAdditional = b'PrsA'

        PreserveLuminosity = b'PrsL'

        PreserveTransparency = b'PrsT'

        Pressure = b'Prs '

        Preview = b'Prvw'

        PreviewCMYK = b'PrvK'

        PreviewFullSize = b'PrvF'

        PreviewIcon = b'PrvI'

        PreviewMacThumbnail = b'PrvM'

        PreviewWinThumbnail = b'PrvW'

        PreviewsQuery = b'PrvQ'

        PrintSettings = b'PMps'

        ProfileSetup = b'PrfS'

        ProvinceState = b'PrvS'

        Quality = b'Qlty'

        QuickMask = b'QucM'

        RGBSetup = b'RGBS'

        Radius = b'Rds '

        RandomSeed = b'RndS'

        Ratio = b'Rt '

        RecentFiles = b'Rcnf'

        Red = b'Rd '

        RedBlackPoint = b'RdBl'

        RedFloat = b'redFloat'

        RedGamma = b'RdGm'

        RedWhitePoint = b'RdWh'

        RedX = b'RdX '

        RedY = b'RdY '

        RegistrationMarks = b'RgsM'

        Relative = b'Rltv'

        Relief = b'Rlf '

        RenderFidelity = b'Rfid'

        Resample = b'Rsmp'

        ResizeWindowsOnZoom = b'RWOZ'

        Resolution = b'Rslt'

        ResourceID = b'RsrI'

        Response = b'Rspn'

        RetainHeader = b'RtnH'

        Reverse = b'Rvrs'

        Right = b'Rght'

        RippleMagnitude = b'RplM'

        RippleSize = b'RplS'

        Rotate = b'Rtt '

        Roundness = b'Rndn'

        RulerOriginH = b'RlrH'

        RulerOriginV = b'RlrV'

        RulerUnits = b'RlrU'

        Saturation = b'Strt'

        SaveAndClose = b'SvAn'

        SaveComposite = b'SvCm'

        SavePaletteLocations = b'PltL'

        SavePaths = b'SvPt'

        SavePyramids = b'SvPy'

        Saving = b'Svng'

        Scale = b'Scl '

        ScaleHorizontal = b'SclH'

        ScaleVertical = b'SclV'

        Scaling = b'Scln'

        Scans = b'Scns'

        ScratchDisks = b'ScrD'

        ScreenFile = b'ScrF'

        ScreenType = b'ScrT'

        Separations = b'Sprt'

        SerialString = b'SrlS'

        ShadingIntensity = b'ShdI'

        ShadingNoise = b'ShdN'

        ShadingShape = b'ShdS'

        ShadowColor = b'sdwC'

        ShadowIntensity = b'ShdI'

        ShadowLevels = b'ShdL'

        ShadowMode = b'sdwM'

        ShadowOpacity = b'sdwO'

        Shape = b'Shp '

        Sharpness = b'Shrp'

        ShearEd = b'ShrE'

        ShearPoints = b'ShrP'

        ShearSt = b'ShrS'

        ShiftKey = b'ShfK'

        ShiftKeyToolSwitch = b'ShKT'

        ShortNames = b'ShrN'

        ShowEnglishFontNames = b'ShwE'

        ShowMenuColors = b'SwMC'

        ShowToolTips = b'ShwT'

        ShowTransparency = b'ShTr'

        SizeKey = b'Sz '

        Skew = b'Skew'

        SmallFontType = b'Sfts'

        SmartBlurMode = b'SmBM'

        SmartBlurQuality = b'SmBQ'

        Smooth = b'Smoo'

        Smoothness = b'Smth'

        SnapshotInitial = b'SnpI'

        SoftClip = b'SfCl'

        Softness = b'Sftn'

        SolidFill = b'SoFi'

        Source = b'Srce'

        Source2 = b'Src2'

        SourceMode = b'SrcM'

        Spacing = b'Spcn'

        SpecialInstructions = b'SpcI'

        SpherizeMode = b'SphM'

        Spot = b'Spot'

        SprayRadius = b'SprR'

        SquareSize = b'SqrS'

        SrcBlackMax = b'Srcl'

        SrcBlackMin = b'SrcB'

        SrcWhiteMax = b'Srcm'

        SrcWhiteMin = b'SrcW'

        Start = b'Strt'

        StartArrowhead = b'StrA'

        State = b'Stte'

        Strength = b'srgh'

        StrengthRatio = b'srgR'

        Strength_PLUGIN = b'Strg'

        StrokeDetail = b'StDt'

        StrokeDirection = b'SDir'

        StrokeLength = b'StrL'

        StrokePressure = b'StrP'

        StrokeSize = b'StrS'

        StrokeWidth = b'StrW'

        Style = b'Styl'

        Styles = b'Stys'

        StylusIsColor = b'StlC'

        StylusIsOpacity = b'StlO'

        StylusIsPressure = b'StlP'

        StylusIsSize = b'StlS'

        SubPathList = b'SbpL'

        SupplementalCategories = b'SplC'

        SystemInfo = b'SstI'

        SystemPalette = b'SstP'

        Target = b'null'

        TargetPath = b'Trgp'

        TargetPathIndex = b'TrgP'

        TermLength = b'Lngt'

        Text = b'Txt '

        TextClickPoint = b'TxtC'

        TextData = b'TxtD'

        TextStyle = b'TxtS'

        TextStyleRange = b'Txtt'

        Texture = b'Txtr'

        TextureCoverage = b'TxtC'

        TextureFile = b'TxtF'

        TextureType = b'TxtT'

        Threshold = b'Thsh'

        TileNumber = b'TlNm'

        TileOffset = b'TlOf'

        TileSize = b'TlSz'

        Title = b'Ttl '

        To = b'T '

        ToBuiltin = b'TBl '

        ToLinked = b'ToLk'

        ToMode = b'TMd '

        ToggleOthers = b'TglO'

        Tolerance = b'Tlrn'

        Top = b'Top '

        TotalLimit = b'TtlL'

        Tracking = b'Trck'

        TransferFunction = b'TrnF'

        TransferSpec = b'TrnS'

        Transparency = b'Trns'

        TransparencyGrid = b'TrnG'

        TransparencyGridColors = b'TrnC'

        TransparencyGridSize = b'TrnG'

        TransparencyPrefs = b'TrnP'

        TransparencyShape = b'TrnS'

        TransparentIndex = b'TrnI'

        TransparentWhites = b'TrnW'

        Twist = b'Twst'

        Type = b'Type'

        UCA = b'UC '

        URL = b'URL '

        UndefinedArea = b'UndA'

        Underline = b'Undl'

        UnitsPrefs = b'UntP'

        Untitled = b'Untl'

        UpperY = b'UppY'

        Urgency = b'Urgn'

        UseAccurateScreens = b'AcrS'

        UseAdditionalPlugins = b'AdPl'

        UseCacheForHistograms = b'UsCc'

        UseCurves = b'UsCr'

        UseDefault = b'UsDf'

        UseGlobalAngle = b'uglg'

        UseICCProfile = b'UsIC'

        UseMask = b'UsMs'

        UserMaskEnabled = b'UsrM'

        UserMaskLinked = b'Usrs'

        Using = b'Usng'

        Value = b'Vl '

        Variance = b'Vrnc'

        Vector0 = b'Vct0'

        Vector1 = b'Vct1'

        VectorColor = b'VctC'

        VersionFix = b'VrsF'

        VersionMajor = b'VrsM'

        VersionMinor = b'VrsN'

        Vertical = b'Vrtc'

        VerticalScale = b'VrtS'

        VideoAlpha = b'Vdlp'

        Visible = b'Vsbl'

        WatchSuspension = b'WtcS'

        Watermark = b'watr'

        WaveType = b'Wvtp'

        WavelengthMax = b'WLMx'

        WavelengthMin = b'WLMn'

        WebdavPrefs = b'WbdP'

        WetEdges = b'Wtdg'

        What = b'What'

        WhiteClip = b'WhtC'

        WhiteIntensity = b'WhtI'

        WhiteIsHigh = b'WhHi'

        WhiteLevel = b'WhtL'

        WhitePoint = b'WhtP'

        WholePath = b'WhPt'

        Width = b'Wdth'

        WindMethod = b'WndM'

        With = b'With'

        WorkPath = b'WrPt'

        WorkPathIndex = b'WrkP'

        X = b'X '

        Y = b'Y '

        Yellow = b'Ylw '

        ZigZagType = b'ZZTy'

        _3DAntiAlias = b'Alis'

        comp = b'comp'

  Type

    class psd_tools.terminology.Type(*values)
        Type definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        ActionData = b'ActD'

        ActionReference = b'#Act'

        AlignDistributeSelector = b'ADSt'

        Alignment = b'Alg '

        Amount = b'Amnt'

        AntiAlias = b'Annt'

        AreaSelector = b'ArSl'

        AssumeOptions = b'AssO'

        BevelEmbossStampStyle = b'BESs'

        BevelEmbossStyle = b'BESl'

        BitDepth = b'BtDp'

        BlackGeneration = b'BlcG'

        BlendMode = b'BlnM'

        BlurMethod = b'BlrM'

        BlurQuality = b'BlrQ'

        BrushType = b'BrsT'

        BuiltInContour = b'BltC'

        BuiltinProfile = b'BltP'

        CMYKSetupEngine = b'CMYE'

        Calculation = b'Clcn'

        Channel = b'Chnl'

        ChannelReference = b'#ChR'

        CheckerboardSize = b'Chck'

        ClassColor = b'#Clr'

        ClassElement = b'#ClE'

        ClassExport = b'#Cle'

        ClassFormat = b'#ClF'

        ClassHueSatHueSatV2 = b'#HsV'

        ClassImport = b'#ClI'

        ClassMode = b'#ClM'

        ClassStringFormat = b'#ClS'

        ClassTextExport = b'#CTE'

        ClassTextImport = b'#ClT'

        Color = b'Clr '

        ColorChannel = b'#ClC'

        ColorPalette = b'ClrP'

        ColorSpace = b'ClrS'

        ColorStopType = b'Clry'

        Colors = b'Clrs'

        Compensation = b'Cmpn'

        ContourEdge = b'CntE'

        Convert = b'Cnvr'

        CorrectionMethod = b'CrcM'

        CursorKind = b'CrsK'

        DCS = b'DCS '

        DeepDepth = b'DpDp'

        Depth = b'Dpth'

        DiffuseMode = b'DfsM'

        Direction = b'Drct'

        DisplacementMap = b'DspM'

        Distribution = b'Dstr'

        Dither = b'Dthr'

        DitherQuality = b'Dthq'

        DocumentReference = b'#DcR'

        EPSPreview = b'EPSP'

        ElementReference = b'#ElR'

        Encoding = b'Encd'

        EraserKind = b'ErsK'

        ExtrudeRandom = b'ExtR'

        ExtrudeType = b'ExtT'

        EyeDropperSample = b'EyDp'

        FPXCompress = b'FxCm'

        Fill = b'Fl '

        FillColor = b'FlCl'

        FillContents = b'FlCn'

        FillMode = b'FlMd'

        ForcedColors = b'FrcC'

        FrameFill = b'FrFl'

        FrameStyle = b'FStl'

        GIFColorFileType = b'GFPT'

        GIFPaletteType = b'GFPL'

        GIFRequiredColorSpaceType = b'GFCS'

        GIFRowOrderType = b'GFIT'

        GlobalClass = b'GlbC'

        GlobalObject = b'GlbO'

        GradientForm = b'GrdF'

        GradientType = b'GrdT'

        GrainType = b'Grnt'

        GrayBehavior = b'GrBh'

        GuideGridColor = b'GdGr'

        GuideGridStyle = b'GdGS'

        HistoryStateSource = b'HstS'

        HorizontalLocation = b'HrzL'

        ImageReference = b'#ImR'

        InnerGlowSource = b'IGSr'

        IntegerChannel = b'#inC'

        Intent = b'Inte'

        InterlaceCreateType = b'IntC'

        InterlaceEliminateType = b'IntE'

        Interpolation = b'Intp'

        Kelvin = b'Klvn'

        KelvinCustomWhitePoint = b'#Klv'

        Lens = b'Lns '

        LightDirection = b'LghD'

        LightPosition = b'LghP'

        LightType = b'LghT'

        LocationReference = b'#Lct'

        MaskIndicator = b'MskI'

        MatteColor = b'MttC'

        MatteTechnique = b'BETE'

        MenuItem = b'MnIt'

        Method = b'Mthd'

        MezzotintType = b'MztT'

        Mode = b'Md '

        Notify = b'Ntfy'

        Object = b'Objc'

        ObjectReference = b'obj '

        OnOff = b'OnOf'

        Ordinal = b'Ordn'

        Orientation = b'Ornt'

        PNGFilter = b'PNGf'

        PNGInterlaceType = b'PGIT'

        PagePosition = b'PgPs'

        PathKind = b'PthK'

        PathReference = b'#PtR'

        Phosphors = b'Phsp'

        PhosphorsCustomPhosphors = b'#Phs'

        PickerKind = b'PckK'

        PixelPaintSize = b'PPSz'

        Platform = b'Pltf'

        Preview = b'Prvw'

        PreviewCMYK = b'Prvt'

        ProfileMismatch = b'PrfM'

        PurgeItem = b'PrgI'

        QuadCenterState = b'QCSt'

        Quality = b'Qlty'

        QueryState = b'QurS'

        RGBSetupSource = b'RGBS'

        RawData = b'tdta'

        RippleSize = b'RplS'

        RulerUnits = b'RlrU'

        ScreenType = b'ScrT'

        Shape = b'Shp '

        SmartBlurMode = b'SmBM'

        SmartBlurQuality = b'SmBQ'

        SourceMode = b'Cndn'

        SpherizeMode = b'SphM'

        State = b'Stte'

        StringChannel = b'#sth'

        StringClassFormat = b'#StC'

        StringCompensation = b'#Stm'

        StringFSS = b'#Stf'

        StringInteger = b'#StI'

        StrokeDirection = b'StrD'

        StrokeLocation = b'StrL'

        TextureType = b'TxtT'

        TransparencyGridColors = b'Trnl'

        TransparencyGridSize = b'TrnG'

        TypeClassModeOrClassMode = b'#TyM'

        UndefinedArea = b'UndA'

        UnitFloat = b'UntF'

        Urgency = b'Urgn'

        UserMaskOptions = b'UsrM'

        ValueList = b'VlLs'

        VerticalLocation = b'VrtL'

        WaveType = b'Wvtp'

        WindMethod = b'WndM'

        YesNo = b'YsN '

        ZigZagType = b'ZZTy'

  Unit

    class psd_tools.terminology.Unit(*values)
        Unit definitions extracted from PITerminology.h.

        See <https://www.adobe.com/devnet/photoshop/sdk.html>

        Angle = b'#Ang'

        Density = b'#Rsl'

        Distance = b'#Rlt'

        Millimeters = b'#Mlm'

        Percent = b'#Prc'

        Pixels = b'#Pxl'

        Points = b'#Pnt'

        _None = b'#Nne'

INDICES AND TABLES

    •   Index <>

    •   Module Index <>

    •   Search Page <>

Author
Kota Yamaguchi

Copyright
2019, Kota Yamaguchi