mjkaufer
mjkaufer

Reputation: 4206

Convert PNG to ISF

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?

Upvotes: 0

Views: 567

Answers (1)

rufanov
rufanov

Reputation: 3276

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).

Upvotes: 1

Related Questions