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
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
Bool
Class
Class1
Class2
Class3
Descriptor
- class psd_tools.psd.descriptor.Descriptor(items=NOTHING, name: str = '', classID=b'null')[source]
Dict-like descriptor structure.
Key values can be 4-character bytes in
Key
or arbitrary length bytes. Supports direct access byKey
.Example:
from psd_tools.terminology import Key descriptor[Key.Enabled] for key in descriptor: print(descriptor[key])
- name
str
Double
Enumerated
EnumeratedReference
GlobalObject
- class psd_tools.psd.descriptor.GlobalObject(items=NOTHING, name: str = '', classID=b'null')[source]
Global object structure equivalent to
Descriptor
.