vtracer
vtracer copied to clipboard
Alpha channel handling in PNG images
I've been faced with the problem that the alpha channel in PNG images isn't supported properly. The transparent part of the image will be prepared with black filling:
The expected result is to keep transparency in SVG, by not having shapes at this place at all.
PNG image example: https://freepikpsd.com/media/2019/10/alpha-symbol-png-11-Free-PNG-Images-Transparent-1024x731.png
Any hints on fixing this? I'd be happy to contribute.
Well let me shed some light on this matter. I think the stacking algorithm we used internally did not support transparency. But there is a parameter called key_color
in the clustering algorithm to allow it to skip clustering a certain color. That'd would mean to render the image on a backdrop color you know does not present in the image itself, usaully #F00, #0F0 or #00F and then use that as key.
@tyt2y3 I tried to add key_color to the cmdapp myself but after upgrading to visioncontext 0.7.0 the app just spits out for any conversion:
thread 'main' panicked at 'The two lines are parallel!', C:\Users\niels.cargo\registry\src\github.com-1ecc6299db9ec823\visioncortex-0.7.0\src\path\util.rs:29:9
Would you be open to implement support for transparency? I'd ben happy to pay for your time.
+1 for this. Would be fantastic to support transparency.
Thank you for the interest. I havn't checked the project for a while, but these dev work has a long timeframe, perhaps on the scale of a few months given the situation I am in.
@tyt2y3 did you see @nielsbosma offer to pay you for your time to implement it?
Yeah I am more time poor than cash poor right now, I'll see whether we can work something out.
@tyt2y3 I've found a developer that can fix this. Are you accepting PRs or should we make our own builds?
That's cool. I can review code and answer questions as well.
Hey guys, I have a great news! https://github.com/visioncortex/vtracer/releases/tag/0.5.0
It's surprising this happened on such a niche project: we got a feature request, I joined the chat, a person contributed, I merged and released. It happened over the course of 1 year, but it happened!
Always have faith in open source, I guess?
Thank you everyone who involved, especially @nielsbosma which I assume funded the dev work.