Skip to content

Optimization: Instance Layerset extraction - #58

Merged
kalisp merged 10 commits into
ynput:developfrom
Tilix4:refactor/optim_extract_image
Feb 17, 2026
Merged

kalisp merged 10 commits into
ynput:developfrom
Tilix4:refactor/optim_extract_image

Conversation

@Tilix4

@Tilix4 Tilix4 commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Changelog Description

Optimized image extraction performance in Photoshop by implementing batch layer visibility operations. The extractor now uses a single batch call to show/hide multiple layers instead of individual calls, significantly reducing WebSocket overhead. A new reusable context manager ensures proper isolation of publishable instances by automatically hiding sibling layers at all hierarchy levels.

Additional review information

Capture d’écran 2026-01-06 à 17 01 34

Testing notes:

  1. Open Photoshop with a PSD file containing multiple layer groups (LayerSets) at different nesting levels
  2. Create publishable instances using the image family - ensure some instances are nested within groups and some are at top-level
  3. Add sibling layers/groups at the same level as your instances to verify they get hidden during extraction
  4. Run the publish process and verify:
    • Extracted images contain only the instance content (no sibling layers visible)
    • Extraction completes faster than before (especially noticeable with many layers)
    • Original layer visibility is restored after extraction completes
    • Multiple instances can be extracted in sequence without visibility conflicts
  5. Test edge cases:
    • Instance at top-level (no parent groups)
    • Instance nested 3+ levels deep
    • Instance with many sibling layers at multiple hierarchy levels
    • Empty instance or instance with missing layer ID (should gracefully skip)

NB: The image used for the review is extracted on its own (during a step I find very strange - this is another story), do not rely on it to check the output of the image, but the one actually published

@kalisp
kalisp self-requested a review February 4, 2026 13:25
@kalisp kalisp self-assigned this Feb 4, 2026

@kalisp kalisp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working fine, asked @LiborBatek for additional testing.

@kalisp
kalisp merged commit 484c5f2 into ynput:develop Feb 17, 2026
1 check passed
@kalisp

kalisp commented Feb 17, 2026

Copy link
Copy Markdown
Member

Retested with more complex psd and after merge.

@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Feb 17, 2026
@LiborBatek

Copy link
Copy Markdown
Member

@Tilix4 @kalisp it works nicely and really well... I have found only one edge case and its questionable still whether its a malfunction or not but when I have group marked for publishing and remove layer which was inside so the group becomes empty in fact it still publishes and is not skipped.

Minor thing but putting it here for the record... maybe its even to suppose to publish still as Im not sure really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants