What I want
I want to transform a raster image into a vector image with minimum number of vertices. (Specifically, into a sticker for a messaging app, which is a gzipped lottie file, but that's irrelevant, I think.)
What I do
The best vectorization app I could find is Vector Magic. The results are great, however stacking of shapes on top of each other doesn't work (or I don't understand its options). It transforms the raster image on the left to the vector image on the right:
Shapes are touching each other. If there's a zig-zag line, it's present on both sides. 124 points in total, which is great compared to anything that Adobe Illustrator's built-in image tracing can produce. However, this can be optimized (shapes shifted to show the difference):
That's 72 points with no loss in quality. However, that's a lot of manual work.
What I need
Is there any way to do this sort of shape stacking automatically? I doubt I'm the first person to have this problem, but no matter what I search for, I find nothing.