Comments (5)
I just tried it with the threshold hardcoded to 128 and it makes no difference.
Alright, well it was worth a shot.
Given that you have a workaround I'm going to close this, but if you are able to contribute an improvement in this area feel free to reopen and/or send a PR. Cheers!
from node-potrace.
Any ideas on why this is happening? I'm thinking it has something to do with the antialiased edge of the "S" butting up against the edge of the image
Pretty sure you hit the nail on the head, there.
I am able correct for this by first adding a pixel of whitespace around the edges of the image
Glad there's a workaround!
I am curious if the non-Node version does the same thing: http://kilobtye.github.io/potrace/
Regardless, this is not something I have time to dive into with my current schedule. A PR that fixes this without negatively impacting the majority of use cases would be appreciated, if you're able.
Alternatively, if you expect to continue to encounter this and are okay with the overhead, perhaps you can use JIMP or an equivalent to expand the image by one pixel before tracing and then trim it back off when done, as part of whatever automated workflow you have.
from node-potrace.
I am curious if the non-Node version does the same thing: http://kilobtye.github.io/potrace/
Nope, the non-Node version does not add the errant line.
Regardless, this is not something I have time to dive into with my current schedule. A PR that fixes this without negatively impacting the majority of use cases would be appreciated, if you're able.
Alternatively, if you expect to continue to encounter this and are okay with the overhead, perhaps you can use JIMP or an equivalent to expand the image by one pixel before tracing and then trim it back off when done, as part of whatever automated workflow you have.
I actually went ahead with a fix to add the pixel of whitespace and then I trim it back later in the workflow because this is a production application, but I was just curious about any input because I thought it was an unusual case. I trim all whitespace from every image before tracing it, and this is the only image I have seen this happen on, though we are tracing thousands, so there could be more.
Thanks for the quick reply!
from node-potrace.
Nope, the non-Node version does not add the errant line.
Interesting, alright.
I feel like the differences were introduced somewhere in here:
Unfortunately I'm not intimately familiar with the work that @iwasawafag did. He might have a better idea of what setting could fix that line but generally seems hard to contact.
Final thought is that you could try simply playing with the settings. For example, what happens if you specify 128
as the threshold
setting, to match the hardcoded value of the web version?
from node-potrace.
I feel like the differences were introduced somewhere in here:
Thank you for the context.
Final thought is that you could try simply playing with the settings. For example, what happens if you specify
128
as thethreshold
setting, to match the hardcoded value of the web version?
I just tried it with the threshold
hardcoded to 128
and it makes no difference.
from node-potrace.
Related Issues (11)
- What's the relationship between this fork and the `Iwasawafag/node-potrace` repo? HOT 1
- Path Direction Issue
- Colors in Posterizer output HOT 5
- use with promise for batch conversion of multiple png HOT 1
- Typo in README
- Whole image as a single path, how to avoid it?
- Handle PNG alpha HOT 2
- Can this run in the browser? HOT 1
- node-potrace results are different from online demo. HOT 5
- Cannot read property 'bitmap' of undefined HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-potrace.