PsdImage

Overview

PsdImage is a class in Aspose.Psd FOSS for Python. Inherits from: Image.

Represents a PSD image that can be loaded, inspected, and saved without rendering.

This class declares 5 methods for PsdImage objects in Python programs. Available methods include: __init__, dispose, load, save. Public members are accessible to any Python application after installing the Aspose.Psd FOSS for Python package. Properties: active_layer, bits_per_channel, channels, channels_count, color_data_info, color_mode, and 30 more.

Properties

NameTypeAccessDescription
widthintReadGets the document width in pixels.
heightintReadGets the document height in pixels.
channelsintReadGets the document channel count from the PSD header.
bits_per_channelintReadGets the number of bits stored per channel.
color_modeColorModesRead/WriteGets the PSD color mode reported by the header.
versionintRead/WriteGets or sets the Aspose.PSD-compatible API version number.
headerPsdHeaderReadGets the parsed PSD/PSB header object.
is_large_documentboolReadGets whether the loaded document uses the PSB large-document container.
is_psbboolReadEquivalent to :attr:is_large_document.
layersList[Layer]Read/WriteGets the parsed layer collection.
channels_countintReadGets the PSD channels count.
sizeSizeReadGets the image size.
active_layerOptional[Layer]Read/WriteGets the active layer.
layer_countintReadGets the number of parsed layers in the document.
has_layersboolReadGets whether the document contains at least one parsed layer.
has_image_resourcesboolReadGets whether the document contains any parsed image resources.
resource_countintReadGets the number of parsed image resource blocks.
image_resourcesList[ResourceBlock]Read/WriteGets or sets the PSD image resources.
global_layer_resourcesList[LayerResource]Read/WriteGets or sets the global layer resources.
global_layer_mask_infoGlobalLayerMaskInfoReadGets the global layer mask info.
is_flattenboolReadGets whether the PSD image is flattened.
has_transparency_databoolRead/WriteGets or sets whether the first alpha channel contains transparency data.
resources``ReadGets a read-only summary of the parsed image resource blocks.
has_color_mode_databoolReadGets whether the document contains Color Mode Data bytes.
color_data_infoPsdColorDataInfoReadGets a read-only summary of the parsed Color Mode Data section.
indexed_paletteOptional[IndexedColorPaletteInfo]ReadGets the parsed indexed palette summary, when present.
has_merged_image_databoolReadGets whether the document contains merged image data payload bytes.
compressionCompressionMethodReadGets the compression method used by the merged image data section.
image_data_infoPsdImageDataInfoReadGets a read-only summary of the parsed merged image data structure.
image_data_kindImageDataKindReadGets the structural kind of the merged image data payload.
uses_predictionboolReadGets whether ZIP prediction is used by the merged image data payload.
has_icc_profileboolReadGets whether an embedded ICC profile resource is present.
is_icc_profile_untaggedOptional[bool]ReadGets the parsed untagged ICC profile flag, when present.
parsed_color_dataColorDataReadGets the parsed color mode data details for internal verification/tests.
parsed_resourcesList[UnknownResource]ReadGets the parsed image resources for internal verification/tests.
global_angleintReadGets the global angle.

Methods

SignatureDescription
__init__(stream, leave_open: bool)Calls init(stream, leave_open) on this PsdImage instance.
load(file_path_or_stream) → PsdImageLoads a PSD image from a file path or a readable stream.
save(file_path_or_stream)Saves the image to a file path or a writable stream.
dispose()Releases the image and optionally the underlying stream.
load(source: Union[str, io.BytesIO, io.BufferedIOBase]) → "Image"Calls load(source) on this PsdImage instance.

See Also