So, I have the the Chinese character 熙, which I can easily turn into an image:
img=Rasterize[Text[Style[FromCharacterCode[{29081}], FontSize -> 300]]]
which gives:
The reason why I am interested in this Character, is I will use the boundary data of the polygon to make an SVG with 6 polygons, which will have the four legs move so it will look like a 4-legged beetle. Once I have the polygon data, I would be able to animate it myself in JS.
Finding the points on the boundaries of the character in JavaScript okay, but putting the boundaries in an order for the character is difficult or computationally intensive. So, I figured there is probably a good way of doing this in Mathematica. But I cannot figure this out.
I tried this to elucidate the boundary with the code below. But then I would need to find the disconnected components and still order them. And the thickness of the white does not seem to be exactly 1 pixel wide throughout.
img2 = Pruning @ Thinning @ LocalAdaptiveBinarize[#, 1]& @ img
which gives:
There are clearly 6 separate polygonal components, and I don't think we can use concave hull because the polygons have holes.
While this question is very specific, I feel like a solution would be generally useful. It would ideally be useful for all unicode characters.
UPDATE: I wanted to share what I was using it for. It looks better in mp4 format, but I can't share that directly here. So here is a GIF version of the work in progress, but I can complete it by myself:












Export["test.svg", Text[Style[FromCharacterCode[{29081}], FontSize -> 24]]] // SystemOpen$\endgroup$