Repository navigation
Add layer masks: a layer's alpha can come from an image - #24
Merged
Merged
Conversation
A shader or image layer can carry `mask` (an image path) and `mask_fit` (cover, contain or stretch). The mask's alpha scales the layer's alpha in the composite, so a logo or text cut-out shows the layer only where it is opaque. The mask is fitted to the frame with the same rules as an image layer, rendered into its own target (M) and read in blend.glsl. Only the alpha counts. The schema lists both fields on the recipe's layers. The example is the funkbox mark: examples/layer_mask/ funkbox-mask.png is its white letters, grown slightly, from .claude-plugin/icon.png, and funkbox-chrome.json fills them with the liquid-chrome metal shader. Tests: tests/test_layer_mask.py (round trip, validation, orientation, contain bands, opacity, example recipe). docs/loops.md and the funk-studio skill (both copies) describe the field. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017qYKdYke3ySSZS76W9Tp34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A shader or image layer can carry
mask(an image path) andmask_fit(cover,containorstretch). The mask's alpha scales the layer's alpha in the composite, so a logo or text cut-out shows the layer only where it is opaque. Only the alpha counts; the mask's colour is ignored.This is the first step toward a logo in liquid chrome. A bevel and text masks come later.
How
mask_fitbehaves exactly like an image layer'sfit.blend.glslreads the mask only whenu_has_maskis 1. Layers without a mask composite exactly as before.mask_fitis refused; a missing or out-of-root mask file is refused by the same path rules as image layers.Example
examples/layer_mask/funkbox-chrome.jsoncuts the funkbox mark out and fills it with the liquid-chrome metal shader.funkbox-mask.pngis the white letters of.claude-plugin/icon.png, grown slightly, so the dark rim is included. The rendered still reads "FUNK BOX" in chrome on black.Checks
tests/test_layer_mask.py: round trip, validation, orientation (top stays top), contain bands, opacity, colour ignored, example recipe.Not included
🤖 Generated with Claude Code
Co-Authored-By: Claude Haiku 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_017qYKdYke3ySSZS76W9Tp34
Generated by Claude Code