Aspose.PSD for Python via .NET is a standalone API to read, write, process, convert Adobe Photoshop PSD, PSB formats without needing to install Adobe Photoshop® and AI files without Adobe Illustrator®
Project description
PSD, PSB, AI Manipulation API
Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License | EULA
Try our free online Apps demonstrating some of the most popular Aspose.PSD functionality.
Aspose.PSD for Python via .NET is an Unique Python PSD Library offering advanced PSD, PSD and AI files processing features. You could easily create, load, update, edit, convert, compress PSD and PSB images using this API. Aspose.PSD Supports most popular features for PSD and PSB files including updates of Text Layers, Smart Objects, Fill Layers, Shape Layers, Group Layers, Adjustment Layers. Aspose.PSD supports Blendings Modes, Layer Effects, Warp Transformations, Smart Filters, Animation TimeLine, Working with Vector, Raster and Clipping Masks, Low-Level PSD file resource exploring and much more. Also, library supports drawing and work with graphic primitives for Regular Layers. Aspose.PSD is able to export and convert PSD, PSB, AI formats to PNG, TIFF, PDF, JPEG, GIF, BMP. IT supports popular combinations of Bit Depths and Color Modes. Besides the all described a many common tranformation like Layer Resize, Crop, Shift, Rotating are supported too. This is an ultimate PSD, PSB and AI Format Processing Library for any use-cases. It's crossplatform: Windows, MacOS, MacOS-ARM, Linux are supported.
Aspose.PSD for Python via .NET is an ultimate, flexible, stable and powerful API to work with PSD, PSB and AI formats. Aspose.PSD is cross-platform library, it is Windows x32/x64, Linux x64, and MacOS x64/Arm64 compatible.
Aspose.PSD for Python requires you to use python programming language. For Java and .NET languages, we recommend you to get Aspose.PSD for Java and Aspose.PSD for .NET, respectively.
Product Features
The following are Aspose.PSD’s core features:
- Create PSD and PSB images from scratch
- Open and Export of PSD, PSB and AI images to PDF, JPEG, PNG, TIFF, BMP, GIF, BMP
- Aspose.PSD Team actively work on manipulation with AI files
- Update PSD and PSB images
- Adding of JPEG, PNG, TIFF, BMP, GIF, BMP files as a layers for editing
- Support of layers: Regular Layer, Text Layer, Smart Object, Group Layer, Adjustment Layer, Fill Layer, Shape Layer
- Support of Blending Options, Layer Effects, Raster, Vector andd Clipping Masks, Warp Transformations, Smart Filters
- Draw lines, circles, ellipses, texts, complex paths, and images using the classes Graphics
- Process images (including per-pixel modifications)
- Convert PSD and PSB Files between different Color Modes and Bit Depths
Supported File Formats
File format | Load | Save | Add as a Layer |
---|---|---|---|
PSD | Yes | Yes | Yes |
PSB | Yes | Yes | Yes |
AI | Yes | Working on it | Yes |
BMP | - | Yes | Yes |
GIF | - | Yes | Yes |
JPEG | - | Yes | Yes |
JPEG2000 | - | Yes | Yes |
PNG | - | Yes | Yes |
TIFF | - | Yes | Yes |
- | Yes | Working on it |
Platform Independence
Aspose.PSD for Python can be used to develop applications for a wide range of operating systems, such as Windows (x32/x64), Linux (x64), and MacOS (x64/arm64) where Python 3.5 or later is installed.
The base .NET platform is .NET Core 6.0 Do not use System.Drawing.Common but the platform-independent Aspose.Drawing.
Get Started
Ready to give Aspose.PSD for Python a try?
Simply run pip install aspose-psd
from the console to fetch the package. If you already have Aspose.PSD for Python and want to upgrade the version, please run pip install --upgrade aspose-psd
to get the latest version.
You can run the following snippets in your environment to see how Aspose.PSD works, or check out the GitHub Repository or Aspose.PSD for Python Documentation for other common use cases.
Open PSD File in Python and update text
from aspose.psd import Image
from aspose.psd.fileformats.png import PngColorType
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import TextLayer
from aspose.psd.imageloadoptions import PsdLoadOptions
from aspose.psd.imageoptions import PngOptions
from aspose.pycore import cast
# Specify File Paths
sourceFile = "AllTypesLayerPsd.psd"
outputFile = "LoadImageExample.png"
# Specify Load Options
loadOptions = PsdLoadOptions()
loadOptions.load_effects_resource = True
loadOptions.allow_warp_repaint = True
# Specify Export Options
exportOptions = PngOptions()
exportOptions.color_type = PngColorType.TRUECOLOR_WITH_ALPHA
# Open File using Aspose.PSD for Python
with Image.load(sourceFile, loadOptions) as image:
# Types of Aspose.PSD can be casted
psdImage = cast(PsdImage, image)
textLayer = cast(TextLayer, psdImage.layers[5])
textLayer.update_text("Simple Text Edit")
# Export PSD File To PNG
psdImage.save(outputFile, exportOptions)
Create a PSD File From Scratch. Create Regular Layer using Graphics API and Create Text Layer with Shadow Effect
from aspose.psd import Graphics, Pen, Color, Rectangle
from aspose.psd.brushes import LinearGradientBrush
from aspose.psd.fileformats.psd import PsdImage
outputFile = "CreateFileFromScratchExample.psd"
# Create PSD Image with specified dimensions
with PsdImage(500, 500) as img:
# Create Regular PSD Layer and update it with Graphic API
regularLayer = img.add_regular_layer()
# Use popular Graphic API for Editing
graphics = Graphics(regularLayer)
pen = Pen(Color.alice_blue)
brush = LinearGradientBrush(Rectangle(250, 250, 150, 100), Color.red, Color.aquamarine, 45)
graphics.draw_ellipse(pen, Rectangle(100, 100, 200, 200))
graphics.fill_ellipse(brush, Rectangle(250, 250, 150, 100))
# Create Text Layer
textLayer = img.add_text_layer("Sample Text", Rectangle(200, 200, 100, 100))
# Adding Shadow to Text
dropShadowEffect = textLayer.blending_options.add_drop_shadow()
dropShadowEffect.distance = 0
dropShadowEffect.size = 8
dropShadowEffect.color = Color.blue
# Save PSD File
img.save(outputFile)
Add Image File as a Layer or Open Image File as a PSD
from io import BytesIO
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import Layer
inputFile = "inputFile.png"
outputFile = "AddFileAsLayer.psd"
# Open file as Stream
with open(inputFile, "rb", buffering=0) as filestream:
stream = BytesIO(filestream.read())
stream.seek(0)
# Create PSD Layer from Stream
layer = Layer(stream)
# Create PSD Image with the specified size
psdImage = PsdImage(layer.width, layer.height)
# Add Layer to PSD Image
psdImage.layers = [layer]
# Get Pixels from File
pixels = layer.load_argb_32_pixels(layer.bounds)
pixelsRange = range(len(pixels))
# Fill the pixels data with some values
for i in pixelsRange:
if i % 5 == 0:
pixels[i] = 500000
# Fast Save of Updated Image Data
layer.save_argb_32_pixels(layer.bounds, pixels)
# Save PSD Image
psdImage.save(outputFile)
Set License Example
from aspose.psd import License
license = License()
licensePath = "PathToLicenseFile"
license.set_license(licensePath)
Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License | EULA
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file aspose_psd-24.2.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: aspose_psd-24.2.0-py3-none-win_amd64.whl
- Upload date:
- Size: 52.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5759e6979b4deef746069af82e9901fd4b82d0ff744ebf0c7dd2f1932237c1ec |
|
MD5 | 8a38d70c750e2794fd32f2aa318b210e |
|
BLAKE2b-256 | bc32289836f47b435e386c479abee37b0c8623287dc8e48cd028c63dbe8315e7 |
File details
Details for the file aspose_psd-24.2.0-py3-none-win32.whl
.
File metadata
- Download URL: aspose_psd-24.2.0-py3-none-win32.whl
- Upload date:
- Size: 45.5 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224d31a524d5b42d1fbd2ec3928eab2495bd5b4245415e3b25d076c9177e4555 |
|
MD5 | 72378bd6a707de32e50b68ac8affe487 |
|
BLAKE2b-256 | 8744eb310fb7d95b47d928b9171414f7a4ada78dc619d8ccd7ed01a3157a1007 |
File details
Details for the file aspose_psd-24.2.0-py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: aspose_psd-24.2.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 74.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f7f6d5915cc82c9054e4ccf53bf9f783a99c7cec2c3ec2f357b6d887ec0306 |
|
MD5 | 9635d46b91c723b6426b3b567ae709d4 |
|
BLAKE2b-256 | 22bdfb0813000b3ee5dae050edb2413b56c9ed5b9a6c738728c54d90a6603165 |
File details
Details for the file aspose_psd-24.2.0-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: aspose_psd-24.2.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 45.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6273e1b1f5c40ce6f3ea33551563558c8820784ae3ef336c511f4da4f21fd086 |
|
MD5 | da562bbc2dc1a4d21e24a4e87a667898 |
|
BLAKE2b-256 | c08fa293cdbe14991d0f4eb9209410e6f6a87c673c87def5b99c5935a961d1ca |
File details
Details for the file aspose_psd-24.2.0-py3-none-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: aspose_psd-24.2.0-py3-none-macosx_10_14_x86_64.whl
- Upload date:
- Size: 66.5 MB
- Tags: Python 3, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af0ddf36d4ae9247905b83c88ddd6047f212fb766eb10f9e1a07052182261a0 |
|
MD5 | b66732e4c53faa14bc02c602fe4dac12 |
|
BLAKE2b-256 | 438f1445c1977c3a9bcf3796429564be650ed4ab4310d8cbd60621507247cc05 |