Page 1 of 1

Stencil error

Posted: 09 Jul 2021, 15:05
by Peter Wassink
This is another one of these issues that keeps manifesting itself.

it has to do with adding opacities along the antialiased edges of a mask
After aplying The layer stencil you are left with visible 'cracks'


if i have a single stencil layer
first i use it positive on a layer, resulting in the bottom black triangle(in my example)
then i use it negative mode, resulting in the top black triangle.

now you would expect, when both layers are on, that the result you get is 100% closed edges.... but they are not
the mask has Anti-Alias so i would think an edge pixel that f.i. is 20% translucent, will give me 20% black in the positve and 80% black in the negative.

I think the underlying problem is that when you add 80% opacity to a 20% opacity layer it does not add up to 100%.
stencil edges not perfect.jpg
stencil edges not perfect.jpg (55.32 KiB) Viewed 5432 times

this is the what the 'crack' looks like at 100%;
100% crack.jpg
100% crack.jpg (1.58 KiB) Viewed 5431 times

Re: Stencil error

Posted: 09 Jul 2021, 15:21
by Xavier
So let me check if I understood properly : you would expect the layers to blend into one unique black square, is it correct ?

Or could we do try another way :
* what do you expect to get ?
* what is wrong in what you get currently ?

Re: Stencil error

Posted: 09 Jul 2021, 15:30
by Peter Wassink
when i cut an image ( the black square) in half,
using a single (Anti-Aliased) Mask (the green triangle)
i expect that the two resulting halves perfectly line up.
And do not leave a hole between them (that thin white line you see in the bottom inage)
so... i expect the two masked out parts to combine back into a perfect black square

The mask itself does cut it perfectly, so a single 20% opacity pixel one side matches with the 80% opacity pixel in the other.
The problem is that TVPaint does not display the combined two pixels as 100%

maybe this is mathematically correct but it is not what you would expect or always want.
because at some level, logic suggests that combining a 80% and a 20% opacity pixel results in 100% covered pixel...
but as i works now: 50%+50%=75% 75%+50%=88% etc...

i don't know a solution

it probably requires a different approach in getting the resulting opacity of overlaying pixels...

This might be doable with a blendmode... i tried all blendmodes and they do effect the way the gap looks.
So i imagine it would be possible to create a blendmode that adds up the separate opacities to a 100%


i demonstrated the influence of blendmodes on the edge:
f.i. "sub" makes the hole go away... but unfortunately it makes the lower part more dark

Re: Stencil error

Posted: 11 Jul 2021, 22:11
by schwarzgrau
The problem as I understand it isn't a TVPaint problem, more something like a transparency problem in anti aliased edges. The reason you get this halo is cause 50% transparency and 50% transparency don't make 100% if you overlay them.

This video is for After Effects, but the first two minutes explain the problem


In After Effects there is a blending mode called "Alpha Add" which fixes this issue. Maybe this could be added to TVPaint in a future release?

Re: Stencil error

Posted: 12 Jul 2021, 14:13
by Peter Wassink
Yes, thanks!
please add "Alpha Add" blend mode to fix this issue.