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

NameTypeAccessDescription
widthintReadGets the document width in pixels.
heightintReadGets the document height in pixels.
bitsPerChannelintReadGets the number of bits stored per channel.
colorModeColorModesRead/WriteGets the PSD color mode reported by the header.
versionintRead/WriteGets 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.
layersLayer[]Read/WriteGets the parsed layer collection.
channelsCountintReadGets the PSD channels count.
sizeSizeReadGets the image size.
activeLayerLayerReadGets 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.
imageResourcesResourceBlock[]ReadGets the PSD image resources as read-only data.
globalLayerResourcesLayerResource[]ReadGets the global layer resources. In this edition it is always an empty array.
globalLayerMaskInfoGlobalLayerMaskInfoReadGets the global layer mask info.
flattenbooleanReadIndicates whether the PSD image is flattened.
hasTransparencyDatabooleanReadGets whether the first alpha channel contains transparency data for the merged result. In this edition it is always false.
compressionCompressionMethodReadGets the compression method used by the merged image data section.
globalAngleintRead/WriteGets or sets the parsed global angle (auto-property equivalent).
boundsRectangleReadGets the image bounds.

Methods

SignatureDescription
getWidth() → intGets the document width in pixels.
getHeight() → intGets the document height in pixels.
getBitsPerChannel() → intGets the number of bits stored per channel.
getColorMode() → ColorModesGets the PSD color mode reported by the header.
setColorMode(value: ColorModes)Sets the color mode value.
getVersion() → intGets 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() → intGets the PSD channels count.
getSize() → SizeGets the image size.
getActiveLayer() → LayerGets 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() → GlobalLayerMaskInfoGets the global layer mask info.
isFlatten() → booleanIndicates whether the PSD image is flattened.
getHasTransparencyData() → booleanGets 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() → CompressionMethodGets the compression method used by the merged image data section.
getGlobalAngle() → intGets or sets the parsed global angle (auto-property equivalent).
setGlobalAngle(value: int)Sets the global angle value.
load(filePath: String) → PsdImageLoads a PSD image from a file path.
load(stream: InputStream) → PsdImageLoads 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() → RectangleGets the image bounds.
close()Calls close on this PsdImage instance.

See Also