Question

I'm trying to use the rudimentary Math Input Panel API with C# to load an image. However, it seems that the panel can only load ISF images (referencing this question). Does anybody know of a programmatic way to convert a PNG or any other image file to an ISF file? I'm guessing the ISF file would need to be black and white, but what else is there to do?

Was it helpful?

Solution

ISF is a vector format. Math Input Panel API also require strict stroke order for better symbol recognition. PNG is a raster image format, that don't contain any stroke-data(no vectors, no stroke-order). It's very easy to convert ISF to PNG, but reverse conversion is hard, and there no built-ins to do this.

To convert PNG to ICF must somehow convert pixels to vectors(write own little vectorizer using center-line tracing algorithm for example), and correctly order strokes in vector result(from upper-left to upper-right used used in most languages, except RTL like arabic).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top