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

NameDescription
PsdOptions()Initializes a new instance of the PsdOptions class.
PsdOptions(options)Initializes a new instance of the PsdOptions class.

Properties

NameTypeAccessDescription
buffer_size_hintintr/wGets or sets the buffer size hint which is defined max allowed size for all internal buffers.
channel_bits_countshortr/wGets or sets the bits count per color channel.
channels_countshortr/wGets or sets the color channels count.
color_modeColorModesr/wGets or sets the psd color mode.
compression_methodCompressionMethodr/wGets or sets the psd compression method.
disposedboolrGets a value indicating whether this instance is disposed.
full_frameboolr/wGets or sets a value indicating whether [full frame].
keep_metadataboolr/wGets a value whether to keep original image metadata on export.
multi_page_optionsMultiPageOptionsr/wThe multipage options
paletteIColorPaletter/wGets or sets the color palette.
psd_versionPsdVersionr/wGets or sets the file format version. It can be PSD or PSB.
refresh_image_preview_databoolr/wGets 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_resourceboolr/wGets 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_settingsResolutionSettingr/wGets or sets the resolution settings.
sourceSourcer/wGets or sets the source to create image in.
vector_rasterization_optionsVectorRasterizationOptionsr/wGets or sets the vector rasterization options.
vectorization_optionsPsdVectorizationOptionsr/wGets or sets the PSD vectorization options.
versionintr/wGets or sets the psd file version.
xmp_dataXmpPacketWrapperr/wGet or set XMP data container

Methods

NameDescription
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:

ParameterTypeDescription
optionsPsdOptionsThe 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

TypeDescription
ImageOptionsBaseA 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)
}