Skip to content

V0.16 - Framework & Features 🔧

Latest

Choose a tag to compare

@Ariel4545 Ariel4545 released this 29 Jan 21:44
068a279

🌟 Overview

Update 0.16 is a transformative release that combines a massive feature drop with a complete architectural rewrite. We have introduced professional-grade creative tools—Blending Modes, Layer Masks, and Selection Tools—while simultaneously rebuilding the application's foundation. The codebase has transitioned from a monolithic script (main_legacy.py) into a modular, scalable framework, ensuring stability and easier maintenance.


🏗️ Architectural Overhaul (Refactoring)

The application structure has been modernized to separate concerns, improve readability, and facilitate collaboration.

📂 New File Structure

The single main.py file has been splited into multiple files:

  • main.py: The application entry point and orchestrator. It handles initialization, the main event loop, and connects the UI with the state.
  • state.py: A dedicated module for Global State Management. It centralizes all application variables (layers, history, settings), making the app state predictable and easier to debug.
  • ui.py: Contains the ApplicationUI class, which encapsulates all User Interface construction logic, separating layout code from business logic.
  • image_ops.py: A specialized library for Image Processing. It houses the core logic for effects, filters, and transformations.
  • ui_utils.py: A utility module for shared UI helpers, dialogs, theming, and the rendering composite pipeline.
  • config.py: A central repository for application constants, configuration, and styling definitions.

✨ Technical Improvements

  • Initialization Stability: The startup sequence was rewritten to ensure the UI and internal state are synchronized before the first history snapshot is created, preventing "empty" initial states.
  • Immutability: The image compositing pipeline (composite_images) has been hardened to prevent accidental modification of cached layers, ensuring rendering consistency.
  • Scalability: The modular design allows for new tools and tabs to be added without cluttering the core logic.

🚀 Major New Features

🎭 Blending Modes

Unlock professional compositing with a full suite of blend modes:

  • Multiply: Darkens the image; perfect for shadows.
  • Screen: Lightens the image; ideal for glows and lights.
  • Overlay: Increases contrast while preserving highlights/shadows.
  • Difference: Subtracts colors for alignment or artistic effects.
  • Add (Linear Dodge): Brightens significantly for intense light effects.
  • Soft Light / Hard Light: Variations of Overlay for nuanced contrast.
  • Darker / Lighter: Selects pixels based on luminance comparison.

🎯 Selection Tools

A robust selection engine has been introduced that allows you to isolate parts of your image.

  • Rectangular Marquee: Click and drag to define a rectangular selection area.
  • Effect Masking: When a selection is active, any filter or adjustment (Blur, Contrast, Hue, etc.) is applied only to the selected area, leaving the rest of the image untouched.
  • Paint Constraint: Painting is now restricted to the active selection bounds, making it easy to color inside the lines.
  • Visual Feedback: A dashed "marching ants" style overlay clearly indicates the active selection on the canvas.

🎭 Layer Masks

Non-destructive editing takes a leap forward with the introduction of Layer Masks.

  • Add/Remove Masks: Attach a grayscale mask to any layer.
  • Edit Mask Mode: Toggle "Edit Mask" to paint directly on the mask instead of the layer image.
  • Alpha Modulation: Painting black on a mask hides the layer content, while white reveals it. This allows for soft edges and complex transparency effects without erasing pixels.
  • UI Indicators: The layer list now shows a (M) indicator for layers with active masks.

🛠️ UI & Technical Improvements

  • Blend Mode Dropdown: A new "Mode" selector has been added to the Layers panel.
  • Tool Switching: A new "Selection" category in the Tools tab provides quick access to selection and move tools.
  • Contextual Cursors: The mouse cursor now changes to provide better feedback for the active tool.
  • Accelerated Blending: Utilizes PIL.ImageChops for C-optimized blending operations, ensuring real-time performance.
  • Robust Coordinate Systems: Implemented accurate coordinate transformation to map screen actions to both the preview and high-res images.
  • Advanced Composite Pipeline: The rendering engine now handles a complex chain: Layer -> Effect -> Selection Mask -> Layer Mask -> Blend Mode -> Opacity.
  • Intelligent Caching: The compositing cache is now blend-mode and mask aware, ensuring that changing a layer's mode instantly refreshes the preview.

🐛 Bug Fixes

  • Corrected Initialization Order: Fixed a critical bug where the application would create its initial history snapshot before the UI was fully initialized, leading to an incorrect starting state.
  • Resolved NameError: Fixed a crash on startup caused by a missing import in the UI module.
  • Improved Compositing Logic: The composite_images function was made more robust to prevent unintended modification of the layer cache.
  • Alpha Compositing: Fixed edge cases where blending modes could incorrectly interact with transparent areas.
  • History Tracking: Blend mode changes, mask edits, and selections are now fully integrated into the Undo/Redo system.