PsdImage
Overview
PsdImage is a class in Aspose.PSD FOSS for Java.
Inherits from: Image.
Represents a PSD image that can be loaded, inspected, and saved without rendering.
This class declares 31 methods for PsdImage objects in Java programs.
Available methods include: close, dispose, getActiveLayer, getBitsPerChannel, getBounds, getChannelsCount, getColorMode, getCompression, getGlobalAngle, getGlobalLayerMaskInfo, getGlobalLayerResources, getHasTransparencyData, and 17 additional methods.
Public members are accessible to any Java application after installing the Aspose.PSD FOSS for Java package.
Properties: activeLayer, bitsPerChannel, bounds, channelsCount, colorMode, compression, and 11 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
width | int | Read | Gets the document width in pixels. |
height | int | Read | Gets the document height in pixels. |
bitsPerChannel | int | Read | Gets the number of bits stored per channel. |
colorMode | 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. The only accepted value is 6, and it does not tell a PSD file from a PSB file. |
layers | Layer[] | Read/Write | Gets the parsed layer collection. |
channelsCount | int | Read | Gets the PSD channels count. |
size | Size | Read | Gets the image size. |
activeLayer | Layer | Read | Gets the active layer. In this edition it is the first layer of the document, not the layer that was active when the file was saved. |
imageResources | ResourceBlock[] | Read | Gets the PSD image resources as read-only data. |
globalLayerResources | LayerResource[] | Read | Gets the global layer resources. In this edition it is always an empty array. |
globalLayerMaskInfo | GlobalLayerMaskInfo | Read | Gets the global layer mask info. |
flatten | boolean | Read | Indicates whether the PSD image is flattened. |
hasTransparencyData | boolean | Read | Gets whether the first alpha channel contains transparency data for the merged result. In this edition it is always false. |
compression | CompressionMethod | Read | Gets the compression method used by the merged image data section. |
globalAngle | int | Read/Write | Gets or sets the parsed global angle (auto-property equivalent). |
bounds | Rectangle | Read | Gets the image bounds. |
Methods
| Signature | Description |
|---|---|
getWidth() → int | Gets the document width in pixels. |
getHeight() → int | Gets the document height in pixels. |
getBitsPerChannel() → int | Gets the number of bits stored per channel. |
getColorMode() → ColorModes | Gets the PSD color mode reported by the header. |
setColorMode(value: ColorModes) | Sets the color mode value. |
getVersion() → int | Gets or sets the Aspose.PSD-compatible API version number. The only accepted value is 6, and it does not tell a PSD file from a PSB file. |
setVersion(value: int) | Sets the version value. |
getLayers() → Layer[] | Gets the parsed layer collection. |
setLayers(value: Layer[]) | Sets the layers value. |
getChannelsCount() → int | Gets the PSD channels count. |
getSize() → Size | Gets the image size. |
getActiveLayer() → Layer | Gets the active layer. In this edition it is the first layer of the document, not the layer that was active when the file was saved. |
setActiveLayer(value: Layer) | Not implemented in the FOSS edition — throws at runtime. Sets the active layer value. |
getImageResources() → ResourceBlock[] | Gets the PSD image resources as read-only data. |
setImageResources(value: ResourceBlock[]) | Not implemented in the FOSS edition — throws at runtime. Sets the image resources value. |
getGlobalLayerResources() → LayerResource[] | Gets the global layer resources. In this edition it is always an empty array. |
setGlobalLayerResources(value: LayerResource[]) | Not implemented in the FOSS edition — throws at runtime. Sets the global layer resources value. |
getGlobalLayerMaskInfo() → GlobalLayerMaskInfo | Gets the global layer mask info. |
isFlatten() → boolean | Indicates whether the PSD image is flattened. |
getHasTransparencyData() → boolean | Gets whether the first alpha channel contains transparency data for the merged result. In this edition it is always false. |
setHasTransparencyData(value: boolean) | Not implemented in the FOSS edition — throws at runtime. Sets the has transparency data value. |
getCompression() → CompressionMethod | Gets the compression method used by the merged image data section. |
getGlobalAngle() → int | Gets or sets the parsed global angle (auto-property equivalent). |
setGlobalAngle(value: int) | Sets the global angle value. |
load(filePath: String) → PsdImage | Loads a PSD image from a file path. |
load(stream: InputStream) → PsdImage | Loads a PSD image from a readable stream. |
save(filePath: String) | Saves the image to a file path. |
save(stream: OutputStream) | Saves the image to a writable stream. |
dispose() | Releases the image and optionally the underlying stream. |
getBounds() → Rectangle | Gets the image bounds. |
close() | Calls close on this PsdImage instance. |