ws-apifix: F.ops.layers.flatten applies the mask of a passThrough group (codecs/image/Blend lerp takes a mask)

This commit is contained in:
4DBug committed 2026-10-31 13:50:05 -05:00
1 parent de4f14a343
commit 25d8e4ff25
3 files changed
+51 -12

No files matched your search

+2 -4
View File
@@ -58,7 +58,8 @@ assert(flat.width == 48 and F.detect(png) == "png")
**Groups.** A group with `blend = "passThrough"` blends its children straight onto what is below (as Photoshop's
pass-through and Aseprite's plain groups). Any other blend first composites the children on their own transparent
canvas, then blends that result with the group's mode and opacity.
canvas, then blends that result with the group's mode and opacity. A group's mask applies either way: on a
pass-through group it limits, pixel by pixel, how much of the children's effect reaches the canvas.
**Format extras.**
@@ -164,7 +165,6 @@ doc.layers = { L.layer("Paper", paper), L.group("Art", { inkLayer, shadeLayer })
local mask = assert(F.ops.image.new(32, 16, "gray8"))
F.ops.image.fill(mask, 255, 255, 255) -- show the top half
doc.layers[2].blend = "normal" -- an isolated group (masks need one, see Gotchas)
doc.layers[2].mask = { image = mask, x = 0, y = 0, default = 0 } -- hide the rest
local flat = assert(F.ops.layers.flatten(doc))
@@ -244,6 +244,4 @@ See [FORMATS.md](../FORMATS.md) for the capability matrix.
not rendered, so the result can differ from Photoshop's `meta.composite`.
- Linked Aseprite cels share one Image table between frames: copy it (`F.ops.image.copy`) before editing a single
frame.
- `flatten` ignores the mask of a `passThrough` group (Photoshop applies it). Give a masked group a real blend mode
such as `"normal"` to isolate it.
- Pixels are straight (not premultiplied) alpha, like every Image.