Skip to content

v1.11.0 - Enhanced Layer Creation APIs and Type Safety

Latest

Choose a tag to compare

@kyamagu kyamagu released this 09 Nov 14:10
29b9d0f

What's New in v1.11.0

This release introduces significant improvements to the public API, enhanced type safety throughout the codebase, and better developer ergonomics for layer creation workflows.

🎨 New Features

Public Layer Creation APIs

New public methods for creating layers and groups directly from PSDImage:

from psd_tools import PSDImage
from PIL import Image

# Create a new PSD document
psdimage = PSDImage.new(mode='RGB', size=(640, 480), depth=8)

# Create pixel layers with intuitive API
layer = psdimage.create_pixel_layer(pil_image, name="Layer 1", top=0, left=0, opacity=255)

# Create groups and organize layers
group = psdimage.create_group(name="Group 1")
group.append(layer)

psdimage.save('new_image.psd')

New Layer Attributes

  • fill_opacity: Control layer fill opacity separate from overall opacity (#507)
  • reference_point: Access and modify layer transformation reference points (#508)

🔧 Improvements

  • Type Safety: Comprehensive type annotations added across the API (#509, #510, #512, #516)
  • Architecture: Eliminated circular dependencies in psd_tools.api using Protocols (#515)
  • Debugging: Improved pretty print representation for Subpath objects (#506)
  • Developer Experience: Added Claude Code support for AI-assisted development (#511)

🐛 Bug Fixes

  • Fixed group blend mode returning None with minimal section divider data (#514)

💥 Breaking Changes

Layer Creation Requirements

  • Layer creation now requires a valid PSDImage object (orphaned layers are no longer supported)
  • Layers cannot be shared between multiple container objects

Before (v1.10.x):

layer = PixelLayer.frompil(None, image, parent=None)

After (v1.11.x):

layer = psdimage.create_pixel_layer(image, name="Layer 1")

📚 Documentation

  • Enhanced migration guide with detailed examples of breaking changes
  • Updated usage documentation with clearer API examples
  • Reorganized API reference for better navigation

📦 Changes Since v1.10.13

  • [api] Add public APIs for layer and group creation (#517)
  • [api] Type safety improvements (#516)
  • [api] Refactor psd_tools.api import dependencies (#515)
  • [api] Fix group blend mode returning None (#514)
  • [dev] Add Claude Code support (#511)
  • [api] Add type annotation to more APIs (#509, #510, #512)
  • [api] Add fill_opacity and reference_point attributes (#507, #508)
  • [psd] Improve pretty print of Subpath (#506)

Installation

pip install psd-tools==1.11.0

Full Changelog

See CHANGES.rst for complete details.


Note: This release includes breaking changes. Please review the migration guide before upgrading.