Skip to content

Add ColorBlending module for multi-image blending support#161

Open
izkgao wants to merge 75 commits into
devfrom
zhenkai/color_blending
Open

Add ColorBlending module for multi-image blending support#161
izkgao wants to merge 75 commits into
devfrom
zhenkai/color_blending

Conversation

@izkgao
Copy link
Copy Markdown
Contributor

@izkgao izkgao commented Apr 15, 2026

Description

Closes #160.

Need frontend PR #2759 to be merged first.

This PR adds color blending support and refactors the session/image APIs around a shared "image-view item" model so frame-backed images and color blendings can be handled consistently.

What is implemented

  • Add a new ColorBlending API with Layer objects for:
    • listing, adding, replacing, deleting, and reordering layers
    • preserving per-layer alpha during reordering/subsetting
    • setting layer alpha and colormaps
    • toggling raster/contour/vector visibility
  • Introduce ImageBase as the shared abstraction for image-view items and move common behaviors such as make_active() and image_view_order onto the base class
  • Update Image to align with the image-view-item model:
    • use file_id terminology consistently
    • expose richer __repr__ output
    • share activation and image-list-order behavior through ImageBase
  • Extend Session with heterogeneous image-view-item support:
    • image_list() now returns both Image and ColorBlending
    • add _find_image_view_order()
    • replace the old image lookup helper with keyword-only image_by_id(image_view_order=..., file_id=..., color_blending_id=...)
    • replace active_frame() with active_image()
    • add create_color_blending() and open_as_color_blending()
    • add cached carta_version and include it in Session.__repr__ when available
    • update set_cursor() to use a better API
  • Add new constants for ImageType and ColormapSet
  • Update documentation and quickstart examples to cover:
    • heterogeneous image lists
    • image-view order
    • color blending workflows

Checklist

  • Add code examples in documentation
  • Add tests

izkgao added 30 commits April 30, 2025 16:38
…or coordinate system and number format methods
…ces for consistency with documentation style
@izkgao izkgao added awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing and removed awaiting code changes For pull requests that require code changes labels Apr 22, 2026
izkgao added 2 commits April 22, 2026 21:17
…thod and verify error message includes minimum size requirement
…ead of making separate calls for type and store.id properties
@izkgao izkgao added this to the v6-beta2 milestone Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support color blending

3 participants