Code Monkey home page Code Monkey logo

Comments (5)

tooolbox avatar tooolbox commented on September 28, 2024 1

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.

tooolbox avatar tooolbox commented on September 28, 2024

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.

pklauzinski avatar pklauzinski commented on September 28, 2024

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.

tooolbox avatar tooolbox commented on September 28, 2024

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.

pklauzinski avatar pklauzinski commented on September 28, 2024

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 the threshold 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.