For a personal project, I designed some icons as PNG files and would like to export them as SVGs.
I know the next question: I don't want a raster, I need vectors. I found this question but since it's based on InkScape, I suppose this will involve tracing.
I do not want that. What I am hoping for is more like pixel2svg proposes. Actually, pixel2svg is almost perfect and gives the sort of thing I am looking for.
From the doc:
Here is one example from my project.
Only caveat: some of my icons require an intermediary alpha value. pixel2svg appears to be quite binary: either there is a pixel, either it is transparent. Nothing in between. From my project, one of the problematic examples in PNG and in SVG.
I tried to look for a contact address to see if this could be changed but I did not find one.
Does anyone know of a solution to generate a pixelated SVGs from (relatively) small (and monochrome, if this helps) PNGs?
To sum my requirements up
- Vector, no raster
- Pixel by pixel conversion, no tracing
- Take alpha (with intermediate values, not only 0/1) into account
- Optional: Command line would be great, as it would allow for batch conversion
Edit: enhanced version of pixel2svg
Based on JohnB's answer, I contacted the original author to submit some changes (typically change RGB to RGBA when alpha is neither 0 nor 255). I have had no answer yet so I created a Github repo with the changes to make them available to anyone.
Since, hey, it's Github! Python developers should feel free to fork and make it better (pull requests would help me know Python better). The next big challenge is to group pixels the same colors as the same vectors (doing it in InkScape considerably reduced the SVG size despite InkScape adding much custom information).