px2svg icon indicating copy to clipboard operation
px2svg copied to clipboard

Threshold code broken (currently disabled)

Open meyerweb opened this issue 10 years ago • 2 comments

There’s something broken with the threshold code. The problem: anything above a zero threshold makes it likely that the produced SVG will be massively smeared out and unrecognizable. This may be some sort of runaway consecutive-pixels thing, but I’m not certain. That’s just a guess based on the visual results.

As a workaround, at present, there are no threshold checks made, so every color comparison requires an exact match; if not, a new rect is created. It would be nice to restore the threshold code. If anyone wants to take a whack at it, please feel free. It may be some time before I get to the point of being able to tackle it in detail.

meyerweb avatar Sep 27 '15 17:09 meyerweb

Off the top of my head (and a few years late), shouldn't checkThreshold be getting absolute values for each color channel calculation? Color1.R (0) - Color2(255) == -255.

Will check this out when I get home.

akoimeexx avatar Jul 18 '17 22:07 akoimeexx

No worries about lateness! I’d be happy to have a fix for this. Let me know what you find out—thanks!

meyerweb avatar Jul 19 '17 19:07 meyerweb