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(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)
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
|
void |
dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
|
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.
|
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.
|
int |
getVersion()
Gets or sets the version.
|
int |
getWidth()
Gets the image width.
|
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.
|
void |
setActiveLayer(Layer value)
Gets or sets the active layer.
|
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 |
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.
|
beginResize_internalized, cacheData, crop, isCached, resize, rotate, rotateFlip
crop, dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getPixel, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getTransparentColor, getVerticalResolution, 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, canSave, create, getBackgroundColor, getBounds, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getPalette, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, load, load, load, load, loadInternal_internalized, resize, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, save_internalized, save_internalized, save, save, save, save, save, setBackgroundColor, setBackgroundColor, setContainer_internalized, setPalette
getDataStreamContainer, save_internalized, save, save, save, setDataStreamContainer
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 PsdImage(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)
Initializes a 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.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 com.aspose.imaging_internal.fileformats.psd.sections.LayerAndMaskInfo getLayerAndMask_internalized()
Gets the layer and mask.
Value: The layer and mask.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 PsdOptions getCurrentOptions_internalized()
Gets the current image options.
Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.