Hi guys, I want to limit the awarpsharp2 effect to black edges only in anime and cartoon sources. Is it possible?
+ Reply to Thread
Results 1 to 4 of 4
The basic idea is to build a mask of black AND edges, then overlay awarpsharp2 using that mask. Something along the lines of:
black = mt_binarize(50).Invert() edges = mt_edge().mt_expand() blackedges = Overlay(black, edges, mode="multiply") #essentially black AND edges Overlay(last, aWarpSharp2(depth=10), mask=blackedges) # only apply awarpsharp2 at black edges
thanks a lot jagabo.
Note, that'a a very rough guide. You will need to do a lot of tuning. For example, black lines are often not very black. Binarize at 50 will only catch very black lines. You may need to raise the threshold. And with edges you may need to use mode="cartoon", and the thy1 and thy2 options to increase or decrease edge sensitivity. You may need to use mt_expand() make the mask wider, mt_inpand() to make it narrower. I also like to blur the mask before using it.