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)[source]

Dict of tagged block items.

See 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=b'8BIM', key=b'', data=b'')[source]

Layer tagged block with extra info.

key

4-character code. See Tag

data

Data.

Annotations

class psd_tools.psd.tagged_blocks.Annotations(items=NOTHING, major_version: int = 2, minor_version: int = 1)[source]

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=NOTHING, author: str = '', name: str = '', mod_date: str = '', marker: bytes = b'txtC', data: bytes = b'')[source]

Annotation structure.

kind
is_open

Bytes

class psd_tools.psd.tagged_blocks.Bytes(value: bytes = b'\x00\x00\x00\x00')[source]

Bytes structure.

value

ChannelBlendingRestrictionsSetting

class psd_tools.psd.tagged_blocks.ChannelBlendingRestrictionsSetting(items=NOTHING)[source]

ChannelBlendingRestrictionsSetting structure.

List of restricted channel numbers (int).

FilterMask

class psd_tools.psd.tagged_blocks.FilterMask(color=None, opacity: int = 0)[source]

FilterMask structure.

color
opacity

MetadataSettings

class psd_tools.psd.tagged_blocks.MetadataSettings(items=NOTHING)[source]

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'')[source]

MetadataSetting structure.

PixelSourceData2

class psd_tools.psd.tagged_blocks.PixelSourceData2(items=NOTHING)[source]

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=None)[source]

PlacedLayerData structure.

ProtectedSetting

class psd_tools.psd.tagged_blocks.ProtectedSetting(value=0)[source]

ProtectedSetting structure.

ReferencePoint

class psd_tools.psd.tagged_blocks.ReferencePoint(items=NOTHING)[source]

ReferencePoint structure.

SectionDividerSetting

class psd_tools.psd.tagged_blocks.SectionDividerSetting(kind=SectionDivider.OTHER, signature=None, blend_mode=None, sub_type=None)[source]

SectionDividerSetting structure.

kind
blend_mode
sub_type

SheetColorSetting

class psd_tools.psd.tagged_blocks.SheetColorSetting(value=0)[source]

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 = None)[source]

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 = None, warp_version: int = 1, warp: DescriptorBlock = None, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0)[source]

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=None, opacity: int = 0, flag: int = 128)[source]

UserMask structure.

color
opacity
flag