Metadata-Version: 2.1
Name: aspose-psd
Version: 26.1.0
Summary: 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®
Home-page: https://products.aspose.com/psd/python-net
Author: Aspose
License: Free To Use But Restricted,Other/Proprietary License
Project-URL: API Reference, https://reference.aspose.com/psd/python-net/
Project-URL: Blog, https://blog.aspose.com/categories/aspose.psd-product-family/
Project-URL: Demos, https://products.aspose.app/psd/family
Project-URL: Docs, https://docs.aspose.com/psd/python-net/
Project-URL: Examples, https://github.com/aspose-psd/Aspose.PSD-for-Python-NET
Project-URL: Free Support, https://forum.aspose.com/c/psd
Project-URL: Release Notes, https://docs.aspose.com/psd/python-net/release-notes/
Project-URL: Temporary License, https://purchase.aspose.com/temporary-license
Keywords: Aspose.PSD,ICC,Profile,CMYK,RGBA,LAB,Grayscale,Color,Modes,Layers,Images,Drawing,Export,Effects,Filters,Mask,Masking,Graphics,Watermark,Rendering,Text,Editing,Paths,Groups,Adjustment,Smart,Objects,Blending,Manipulation,API,Adobe,Photoshop,Illustrator,PSD,PSB,AI,GIF,JPEG,JPG,JPEG2000,BMP,PDF,PNG,TIF,TIFF
Platform: win_amd64
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Other Audience
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Environment :: MacOS X
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.5,<3.14
Description-Content-Type: text/markdown

## PSD, PSB, AI Manipulation API

[Product Page](https://products.aspose.com/psd/python-net/) | [Documentation](https://docs.aspose.com/psd/python-net/) | [Demos](https://products.aspose.app/psd/family) | [Blog](https://blog.aspose.com/categories/aspose.psd-product-family/) | [API Reference](https://reference.aspose.com/psd/python-net/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/psd) | [Temporary License](https://purchase.aspose.com/temporary-license) | [EULA](https://company.aspose.com/legal/eula)

---
Try our [free online Apps](https://products.aspose.app/psd/family) 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](https://releases.aspose.com/psd/java/)** and **[.NET](https://www.nuget.org/packages/Aspose.PSD/)** languages, we recommend you to get [Aspose.PSD for Java](https://releases.aspose.com/psd/java/) and [Aspose.PSD for .NET](https://www.nuget.org/packages/Aspose.PSD/), 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](https://docs.fileformat.com/image/psd/)| Yes | Yes | Yes |
|[PSB](https://docs.fileformat.com/image/psb/)| Yes | Yes | Yes |
|[AI](https://docs.fileformat.com/image/ai/)| Yes | Working on it | Yes |
|[BMP](https://docs.fileformat.com/image/bmp/)| - |Yes| Yes |
|[GIF](https://docs.fileformat.com/image/gif/)| - |Yes|Yes|
|[JPEG](https://docs.fileformat.com/image/jpeg/)| - |Yes|Yes|
|[JPEG2000](https://docs.fileformat.com/image/jp2/)| - |Yes|Yes|
|[PNG](https://docs.fileformat.com/image/png/)| - |Yes|Yes|
|[TIFF](https://docs.fileformat.com/image/tiff/)| - |Yes|Yes|
|[PDF](https://docs.fileformat.com/pdf/)| - | 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](https://github.com/aspose-psd/Aspose.PSD-for-Python-Net) or [Aspose.PSD for Python Documentation](https://docs.aspose.com/psd/python-net/) for other common use cases.

### Open PSD File in Python and update text
``` python

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
``` python

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
``` python

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
``` python

from aspose.psd import License

license = License()
licensePath = "PathToLicenseFile"
license.set_license(licensePath)

```

---
[Product Page](https://products.aspose.com/psd/python-net/) | [Documentation](https://docs.aspose.com/psd/python-net/) | [Demos](https://products.aspose.app/psd/family) | [Blog](https://blog.aspose.com/categories/aspose.psd-product-family/) | [API Reference](https://reference.aspose.com/psd/python-net/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/psd) | [Temporary License](https://purchase.aspose.com/temporary-license) | [EULA](https://company.aspose.com/legal/eula)


