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
| Name | Type | Access | Description |
|---|---|---|---|
width | int | Read | Gets the document width in pixels. |
height | int | Read | Gets the document height in pixels. |
channels | int | Read | Gets the document channel count from the PSD header. |
bits_per_channel | int | Read | Gets the number of bits stored per channel. |
color_mode | ColorModes | Read/Write | Gets the PSD color mode reported by the header. |
version | int | Read/Write | Gets or sets the Aspose.PSD-compatible API version number. |
header | PsdHeader | Read | Gets the parsed PSD/PSB header object. |
is_large_document | bool | Read | Gets whether the loaded document uses the PSB large-document container. |
is_psb | bool | Read | Equivalent to :attr:is_large_document. |
layers | List[Layer] | Read/Write | Gets the parsed layer collection. |
channels_count | int | Read | Gets the PSD channels count. |
size | Size | Read | Gets the image size. |
active_layer | Optional[Layer] | Read/Write | Gets the active layer. |
layer_count | int | Read | Gets the number of parsed layers in the document. |
has_layers | bool | Read | Gets whether the document contains at least one parsed layer. |
has_image_resources | bool | Read | Gets whether the document contains any parsed image resources. |
resource_count | int | Read | Gets the number of parsed image resource blocks. |
image_resources | List[ResourceBlock] | Read/Write | Gets or sets the PSD image resources. |
global_layer_resources | List[LayerResource] | Read/Write | Gets or sets the global layer resources. |
global_layer_mask_info | GlobalLayerMaskInfo | Read | Gets the global layer mask info. |
is_flatten | bool | Read | Gets whether the PSD image is flattened. |
has_transparency_data | bool | Read/Write | Gets or sets whether the first alpha channel contains transparency data. |
resources | `` | Read | Gets a read-only summary of the parsed image resource blocks. |
has_color_mode_data | bool | Read | Gets whether the document contains Color Mode Data bytes. |
color_data_info | PsdColorDataInfo | Read | Gets a read-only summary of the parsed Color Mode Data section. |
indexed_palette | Optional[IndexedColorPaletteInfo] | Read | Gets the parsed indexed palette summary, when present. |
has_merged_image_data | bool | Read | Gets whether the document contains merged image data payload bytes. |
compression | CompressionMethod | Read | Gets the compression method used by the merged image data section. |
image_data_info | PsdImageDataInfo | Read | Gets a read-only summary of the parsed merged image data structure. |
image_data_kind | ImageDataKind | Read | Gets the structural kind of the merged image data payload. |
uses_prediction | bool | Read | Gets whether ZIP prediction is used by the merged image data payload. |
has_icc_profile | bool | Read | Gets whether an embedded ICC profile resource is present. |
is_icc_profile_untagged | Optional[bool] | Read | Gets the parsed untagged ICC profile flag, when present. |
parsed_color_data | ColorData | Read | Gets the parsed color mode data details for internal verification/tests. |
parsed_resources | List[UnknownResource] | Read | Gets the parsed image resources for internal verification/tests. |
global_angle | int | Read | Gets the global angle. |
Methods
| Signature | Description |
|---|---|
__init__(stream, leave_open: bool) | Calls init(stream, leave_open) on this PsdImage instance. |
load(file_path_or_stream) → PsdImage | Loads 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. |