public final class PsdImage
extends com.aspose.imaging.RasterCachedImage
A PSD image.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_VERSION
The default PSD version.
|
Constructor and Description |
---|
PsdImage(InputStream stream)
Initializes a new instance of the
PsdImage class. |
PsdImage(InputStream stream,
short colorMode,
short channelBitDepth,
short channels,
int psdVersion,
short compression)
Initializes a new instance of the
PsdImage class. |
PsdImage(int width,
int height)
Initializes a new instance of the
PsdImage class. |
PsdImage(int width,
int height,
IColorPalette colorPalette,
short colorMode,
short channelBitDepth,
short channels,
int psdVersion,
short compression)
Initializes a new instance of the
PsdImage class. |
PsdImage(RasterImage rasterImage)
Initializes a new instance of the
PsdImage class. |
PsdImage(RasterImage rasterImage,
short colorMode,
short channelBitDepth,
short channels,
int psdVersion,
short compression)
Initializes a new instance of the
PsdImage class. |
PsdImage(String path)
Initializes a new instance of the
PsdImage class. |
PsdImage(String path,
short colorMode,
short channelBitDepth,
short channels,
int psdVersion,
short compression)
Initializes a new instance of the
PsdImage class. |
Modifier and Type | Method and Description |
---|---|
void |
adjustBrightness(int brightness)
Adjust of a brightness for image.
|
void |
adjustContrast(float contrast)
Image contrasting
|
void |
adjustGamma(float gamma)
Gamma-correction of an image.
|
void |
adjustGamma(float gammaRed,
float gammaGreen,
float gammaBlue)
Gamma-correction of an image.
|
void |
binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
|
void |
binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
|
void |
binarizeOtsu()
Binarization of an image with Otsu thresholding
|
static PsdImage |
createInstance_internalized(com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader psdHeader,
com.aspose.imaging_internal.fileformats.psd.sections.ColorData colorData,
com.aspose.imaging_internal.fileformats.psd.sections.ImageResources imageResources,
com.aspose.imaging_internal.fileformats.psd.sections.LayerAndMaskInfo layerAndMaskInfo,
com.aspose.imaging_internal.fileformats.psd.sections.ImageData imageData,
IColorPalette colorPalette,
int version,
LoadOptions loadOptions)
Creates the new instance of the
PsdImage class. |
void |
dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
|
void |
filter(Rectangle rectangle,
FilterOptionsBase options)
Filters the specified rectangle.
|
Layer |
getActiveLayer()
Gets or sets the active layer.
|
int |
getBitsPerChannel()
Gets the bits per channel.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
int |
getChannelsCount()
Gets the PSD channels count.
|
StreamSource |
getCmykColorProfile()
The CMYK color profile for CMYK PSD images.
|
short |
getColorMode()
Gets or sets the color mode.
|
short |
getCompression()
Gets the compression method.
|
PsdOptions |
getCurrentOptions_internalized()
Gets the current image options.
|
GlobalLayerMaskInfo |
getGlobalLayerMaskInfo()
Gets the global layer mask info.
|
LayerResource[] |
getGlobalLayerResources()
Gets or sets the global layer resources.
|
int |
getHeight()
Gets the image height.
|
ResourceBlock[] |
getImageResources()
Gets or sets the PSD image resources.
|
com.aspose.imaging_internal.fileformats.psd.sections.LayerAndMaskInfo |
getLayerAndMask_internalized()
Gets the layer and mask.
|
Layer[] |
getLayers()
Gets or sets the PSD layers.
|
com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader |
getPsdHeader_internalized()
Gets or sets the PSD header.
|
StreamSource |
getRgbColorProfile()
The RGB color profile for CMYK PSD images.
|
static ResourceBlock[] |
getUpdatedResourceBlocks_internalized(ResourceBlock[] resources,
ResourceBlock resource,
boolean removeDuplicates)
Gets updated resources with brand new resource block.
|
int |
getVersion()
Gets or sets the version.
|
int |
getWidth()
Gets the image width.
|
XmpPacketWrapper |
getXmpData()
Gets or sets the XMP metadata.
|
void |
grayscale()
Transformation of an image to its grayscale representation
|
boolean |
hasTransparencyData()
Gets or sets a value indicating whether first alpha channel contains the transparency data for the merged result when specifying layers data.
|
boolean |
isFlatten()
Gets a value indicating whether psd image is flattened.
|
void |
setActiveLayer(Layer value)
Gets or sets the active layer.
|
void |
setCmykColorProfile(StreamSource value)
The CMYK color profile for CMYK PSD images.
|
void |
setColorMode(short value)
Gets or sets the color mode.
|
void |
setGlobalLayerResources(LayerResource[] value)
Gets or sets the global layer resources.
|
void |
setImageResources(ResourceBlock[] value)
Gets or sets the PSD image resources.
|
void |
setLayers(Layer[] value)
Gets or sets the PSD layers.
|
void |
setPsdHeader_internalized(com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader value)
Gets or sets the PSD header.
|
void |
setRgbColorProfile(StreamSource value)
The RGB color profile for CMYK PSD images.
|
void |
setTransparencyData(boolean value)
Gets or sets a value indicating whether first alpha channel contains the transparency data for the merged result when specifying layers data.
|
void |
setVersion(int value)
Gets or sets the version.
|
void |
setXmpData(XmpPacketWrapper value)
Gets or sets the XMP metadata.
|
beginResize_internalized, cacheData, crop, getFormatSpecificPalette_internalized, isCached, resize, resize, rotate, rotateFlip, setFormatSpecificPalette_internalized
crop, dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getPixel, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getTransparentColor, getVerticalResolution, hasAlpha, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, readScanLine, rotate, saveArgb32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setHorizontalResolution, setPalette, setPixel, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setResolution, setTransparentColor, setTransparentColor, setVerticalResolution, writeScanLine
canLoad, canLoad, canLoad, canLoad, canLoadInternal_internalized, canLoadInternal_internalized, canSave, create, getBackgroundColor, getBounds, getContainer, getFileFormat, getFileFormat, getFileFormatInternal_internalized, getFittingRectangle, getFittingRectangle, getPalette, getProportionalHeight, getProportionalWidth, getSize, getVentureLicense_internalized, hasBackgroundColor, load, load, load, load, loadInternal_internalized, loadInternal_internalized, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save_internalized, save, save, save, save, save, setBackgroundColor, setBackgroundColor, setContainer_internalized, setPalette, setVentureLicense_internalized
getDataStreamContainer, save_internalized, save, save, save, setDataStreamContainer
close, dispose, getDisposed
public static final int DEFAULT_VERSION
The default PSD version.
public PsdImage(String path)
Initializes a new instance of the PsdImage
class.
path
- The path to load pixel and palette data from and initialize with.public PsdImage(String path, short colorMode, short channelBitDepth, short channels, int psdVersion, short compression)
Initializes a new instance of the PsdImage
class.
path
- The path to load pixel and palette data from and initialize with.colorMode
- The color mode.channelBitDepth
- The PSD bit depth per channel.channels
- The PSD channels count.psdVersion
- The PSD version.compression
- The compression to use.public PsdImage(InputStream stream)
Initializes a new instance of the PsdImage
class.
stream
- The stream to load pixel and palette data from and initialize with.public PsdImage(InputStream stream, short colorMode, short channelBitDepth, short channels, int psdVersion, short compression)
Initializes a new instance of the PsdImage
class.
stream
- The stream to load pixel and palette data from and initialize with.colorMode
- The color mode.channelBitDepth
- The PSD bit depth per channel.channels
- The PSD channels count.psdVersion
- The PSD version.compression
- The compression to use.public PsdImage(RasterImage rasterImage)
Initializes a new instance of the PsdImage
class.
rasterImage
- The image to load pixel and palette data from and initialize with.public PsdImage(RasterImage rasterImage, short colorMode, short channelBitDepth, short channels, int psdVersion, short compression)
Initializes a new instance of the PsdImage
class.
rasterImage
- The image to load pixel and palette data from and initialize with.colorMode
- The color mode.channelBitDepth
- The PSD bit depth per channel.channels
- The PSD channels count.psdVersion
- The PSD version.compression
- The compression to use.public PsdImage(int width, int height)
Initializes a new instance of the PsdImage
class.
width
- The image width.height
- The image height.public PsdImage(int width, int height, IColorPalette colorPalette, short colorMode, short channelBitDepth, short channels, int psdVersion, short compression)
Initializes a new instance of the PsdImage
class.
width
- The image width.height
- The image height.colorPalette
- The color palette.colorMode
- The color mode.channelBitDepth
- The PSD bit depth per channel.channels
- The PSD channels count.psdVersion
- The PSD version.compression
- The compression to use.public XmpPacketWrapper getXmpData()
Gets or sets the XMP metadata.
Value: The XMP metadata.getXmpData
in class RasterImage
public void setXmpData(XmpPacketWrapper value)
Gets or sets the XMP metadata.
Value: The XMP metadata.setXmpData
in class RasterImage
public StreamSource getRgbColorProfile()
The RGB color profile for CMYK PSD images. Must be in pair with CmykColorProfile for correct color conversion.
Value: The RGB color profile.public void setRgbColorProfile(StreamSource value)
The RGB color profile for CMYK PSD images. Must be in pair with CmykColorProfile for correct color conversion.
Value: The RGB color profile.public StreamSource getCmykColorProfile()
The CMYK color profile for CMYK PSD images. Must be in pair with RgbColorProfile for correct color conversion.
Value: The CMYK color profile.public void setCmykColorProfile(StreamSource value)
The CMYK color profile for CMYK PSD images. Must be in pair with RgbColorProfile for correct color conversion.
Value: The CMYK color profile.public short getColorMode()
Gets or sets the color mode.
Value: The color mode.public void setColorMode(short value)
Gets or sets the color mode.
Value: The color mode.public short getCompression()
Gets the compression method.
Value: The compression.public int getChannelsCount()
Gets the PSD channels count.
Value: The PSD channels count.public int getBitsPerChannel()
Gets the bits per channel.
Value: The bits per channel.public ResourceBlock[] getImageResources()
Gets or sets the PSD image resources.
Value: The PSD image resources.public void setImageResources(ResourceBlock[] value)
Gets or sets the PSD image resources.
Value: The PSD image resources.public int getVersion()
Gets or sets the version.
Value: The version.public void setVersion(int value)
Gets or sets the version.
Value: The version.public int getWidth()
Gets the image width.
Value: The image width.getWidth
in interface IObjectWithBounds
getWidth
in class Image
public int getHeight()
Gets the image height.
Value: The image height.getHeight
in interface IObjectWithBounds
getHeight
in class Image
public int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.getBitsPerPixel
in class Image
public Layer[] getLayers()
Gets or sets the PSD layers.
Value: The PSD layers.Note that if there are no layers the other related information within layer and mask information section will not be preserved (layer masks, resources and etc).
public void setLayers(Layer[] value)
Gets or sets the PSD layers.
Value: The PSD layers.Note that if there are no layers the other related information within layer and mask information section will not be preserved (layer masks, resources and etc).
public LayerResource[] getGlobalLayerResources()
Gets or sets the global layer resources.
Value: The global layer resources.public void setGlobalLayerResources(LayerResource[] value)
Gets or sets the global layer resources.
Value: The global layer resources.public GlobalLayerMaskInfo getGlobalLayerMaskInfo()
Gets the global layer mask info.
public boolean hasTransparencyData()
Gets or sets a value indicating whether first alpha channel contains the transparency data for the merged result when specifying layers data.
Value:true
if first alpha channel contains the transparency data for the merged result when specifying layers data; otherwise, false
.public void setTransparencyData(boolean value)
Gets or sets a value indicating whether first alpha channel contains the transparency data for the merged result when specifying layers data.
Value:true
if first alpha channel contains the transparency data for the merged result when specifying layers data; otherwise, false
.public Layer getActiveLayer()
Gets or sets the active layer.
TiffImageException
- There is no active layer and no layers in image.PsdImageException
- The active layer cannot be set as it belongs to another image.
Value:
The active layer.public void setActiveLayer(Layer value)
Gets or sets the active layer.
TiffImageException
- There is no active layer and no layers in image.PsdImageException
- The active layer cannot be set as it belongs to another image.
Value:
The active layer.public boolean isFlatten()
Gets a value indicating whether psd image is flattened.
Value:true
if this instance is flatten; otherwise, false
.public com.aspose.imaging_internal.fileformats.psd.sections.LayerAndMaskInfo getLayerAndMask_internalized()
Gets the layer and mask.
Value: The layer and mask.public com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader getPsdHeader_internalized()
Gets or sets the PSD header.
Value: The PSD header.public void setPsdHeader_internalized(com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader value)
Gets or sets the PSD header.
Value: The PSD header.public void dither(int ditheringMethod, int bitsCount, IColorPalette customPalette)
Performs dithering on the current image.
dither
in class com.aspose.imaging.RasterCachedImage
ditheringMethod
- The dithering method.bitsCount
- The final bits count for dithering.customPalette
- The custom palette for dithering.public void binarizeOtsu()
Binarization of an image with Otsu thresholding
binarizeOtsu
in class com.aspose.imaging.RasterCachedImage
public void binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
binarizeBradley
in class com.aspose.imaging.RasterCachedImage
brightnessDifference
- The brightness difference between pixel and the average of an s x s window of pixels centered around this pixel.public void adjustBrightness(int brightness)
Adjust of a brightness for image.
adjustBrightness
in class com.aspose.imaging.RasterCachedImage
brightness
- Brightness value.public void adjustGamma(float gamma)
Gamma-correction of an image.
adjustGamma
in class com.aspose.imaging.RasterCachedImage
gamma
- Gamma for red, green and blue channels coefficientpublic void adjustContrast(float contrast)
Image contrasting
adjustContrast
in class com.aspose.imaging.RasterCachedImage
contrast
- Contrast value (in range [-100; 100])public void adjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Gamma-correction of an image.
adjustGamma
in class com.aspose.imaging.RasterCachedImage
gammaRed
- Gamma for red channel coefficientgammaGreen
- Gamma for green channel coefficientgammaBlue
- Gamma for blue channel coefficientpublic void binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
binarizeFixed
in class com.aspose.imaging.RasterCachedImage
threshold
- Threshold value. If corresponding gray value of a pixel is greater than threshold, a value of 255 will be assigned to it, 0 otherwise.public void grayscale()
Transformation of an image to its grayscale representation
grayscale
in class com.aspose.imaging.RasterCachedImage
public void filter(Rectangle rectangle, FilterOptionsBase options)
Filters the specified rectangle.
filter
in class RasterImage
rectangle
- The rectangle.options
- The options.public static PsdImage createInstance_internalized(com.aspose.imaging_internal.fileformats.psd.sections.PsdHeader psdHeader, com.aspose.imaging_internal.fileformats.psd.sections.ColorData colorData, com.aspose.imaging_internal.fileformats.psd.sections.ImageResources imageResources, com.aspose.imaging_internal.fileformats.psd.sections.LayerAndMaskInfo layerAndMaskInfo, com.aspose.imaging_internal.fileformats.psd.sections.ImageData imageData, IColorPalette colorPalette, int version, LoadOptions loadOptions)
Creates the new instance of the PsdImage
class.
psdHeader
- The PSD header.colorData
- The color data.imageResources
- The image resources.layerAndMaskInfo
- The layer and mask info.imageData
- The image data.colorPalette
- The color palette.version
- The PSD version.loadOptions
- The load options.PsdImage
class.public PsdOptions getCurrentOptions_internalized()
Gets the current image options.
public static ResourceBlock[] getUpdatedResourceBlocks_internalized(ResourceBlock[] resources, ResourceBlock resource, boolean removeDuplicates)
Gets updated resources with brand new resource block.
resources
- The resources.resource
- The resource to add to existing resources.removeDuplicates
- if set to true
removes resources with identical IDs.com.aspose.ms.System.ArgumentNullException
- resources is null.Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.