psd_tools.api.smart_object

Smart object module.

SmartObject

class psd_tools.api.smart_object.SmartObject(layer)[source]

Smart object that represents embedded or external file.

data

Embedded file content, or empty if kind is external or alias

filename

Original file name of the object.

filesize

File size of the object.

filetype

Preferred file extension, such as jpg.

is_psd()[source]

Return True if the file is embedded PSD/PSB.

kind

Kind of the link, ‘data’, ‘alias’, or ‘external’.

open(external_dir=None)[source]

Open the smart object as binary IO.

Parameters:external_dir – Path to the directory of the external file.
resolution

Resolution of the object.

save(filename=None)[source]

Save the smart object to a file.

Parameters:filename – File name to export. If None, use the embedded name.
unique_id

UUID of the object.

warp

Warp parameters.