PsdOptions Class
Summary: Create Photoshop Document (PSD) images with our API, offering versatile options
with different format versions, compression methods, color modes, and
bits counts per color channel. Seamlessly handle XMP metadata containers,
ensuring comprehensive image processing with the power of PSD format features
like image layers, layer masks, and file information for customization
and creativity in your designs.
Module: aspose.imaging.imageoptions
Full Name: aspose.imaging.imageoptions.PsdOptions
Inheritance: IHasXmpData, IHasMetadata, ImageOptionsBase
Constructors
Name | Description |
---|---|
PsdOptions() | Initializes a new instance of the PsdOptions class. |
PsdOptions(options) | Initializes a new instance of the PsdOptions class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
buffer_size_hint | int | r/w | Gets or sets the buffer size hint which is defined max allowed size for all internal buffers. |
channel_bits_count | short | r/w | Gets or sets the bits count per color channel. |
channels_count | short | r/w | Gets or sets the color channels count. |
color_mode | ColorModes | r/w | Gets or sets the psd color mode. |
compression_method | CompressionMethod | r/w | Gets or sets the psd compression method. |
disposed | bool | r | Gets a value indicating whether this instance is disposed. |
full_frame | bool | r/w | Gets or sets a value indicating whether [full frame]. |
keep_metadata | bool | r/w | Gets a value whether to keep original image metadata on export. |
multi_page_options | MultiPageOptions | r/w | The multipage options |
palette | IColorPalette | r/w | Gets or sets the color palette. |
psd_version | PsdVersion | r/w | Gets or sets the file format version. It can be PSD or PSB. |
refresh_image_preview_data | bool | r/w | Gets or sets a value indicating whether [refresh image preview data] - option used to maximize compatibility with another PSD image viewers. Please note, text layers drawing to final layout is not supported for Compact Framework platform |
remove_global_text_engine_resource | bool | r/w | Gets or sets a value indicating whether - Remove the global text engine resource - Used for some text-layered psd files, in only case, when they can not be opened in Adobe Photoshop after processing (mostly for absent fonts text layers related). After using this option, user need to Make next in opened in Photoshop file: Menu “Text” -> “Process absent fonts”. After that operation all text will appear again. Please note, that this operation may cause some final layout changes. |
resolution_settings | ResolutionSetting | r/w | Gets or sets the resolution settings. |
source | Source | r/w | Gets or sets the source to create image in. |
vector_rasterization_options | VectorRasterizationOptions | r/w | Gets or sets the vector rasterization options. |
vectorization_options | PsdVectorizationOptions | r/w | Gets or sets the PSD vectorization options. |
version | int | r/w | Gets or sets the psd file version. |
xmp_data | XmpPacketWrapper | r/w | Get or set XMP data container |
Methods
Name | Description |
---|---|
clone() | Creates a memberwise clone of this instance. |
Constructor: PsdOptions()
PsdOptions()
Initializes a new instance of the PsdOptions class.
Constructor: PsdOptions(options)
PsdOptions(options)
Initializes a new instance of the PsdOptions class.
Parameters:
Parameter | Type | Description |
---|---|---|
options | PsdOptions | The options. |
Property: color_mode
Gets or sets the psd color mode.
See also:
Example # 1: This example demonstrates the use of Aspose.Imaging API to convert Images to …
Property: compression_method
Gets or sets the psd compression method.
See also:
Example # 1: This example demonstrates the use of Aspose.Imaging API to convert Images to …
Method: clone()
clone()
Creates a memberwise clone of this instance.
Returns
Type | Description |
---|---|
ImageOptionsBase | A memberwise clone of this instance. |
Examples
This example demonstrates the use of Aspose.Imaging API to convert Images to PSD format. To achieve this goal this example loads an existing image and then saves it back to PSD format.
from aspose.imaging import Image, RotateFlipType
from aspose.imaging.imageoptions import PsdOptions
from aspose.imaging.fileformats.psd import CompressionMethod, ColorModes
from os.path import join as path_join
directory = "c:\\temp\\"
#Creates an instance of image class and initialize it with an existing file through File path
with Image.load(path_join(directory, "sample.bmp")) as image:
#Create an instance of PsdOptions class
psdOptions = PsdOptions()
#Set the CompressionMethod as RLE
#Note: Other supported CompressionMethod is CompressionMethod.RAW [No Compression]
psdOptions.compression_method = CompressionMethod.RLE
#Set the ColorMode to GRAYSCALE
#Note: Other supported ColorModes are ColorModes.BITMAP and ColorModes.RGB
psdOptions.color_mode = ColorModes.GRAYSCALE
#Save the image to disk location with supplied PsdOptions settings
image.save(path_join(directory, "output.psd"), psdOptions)
}