Inkscape.org
Beyond the Basics "Despeckle" tool? (removing noise blobs after tracing bitmap)
  1. #1
    bastianilso bastianilso @bastianilso

    Hi,

     

    Tracing bitmaps might leave small path 'blobs' in the final trace. is there an extension or tool to remove these, as part of a post-processing step after tracing?
    The tracing bitmap tutorial suggests using Path -> Simplify (Ctrl+L) to reduce the number of nodes, but Simplify doesnt remove path blobs themselves, it only reduces the number of nodes within them.

    I guess the effect I'm asking for could be equivalent to a Despeckle filter (as seen in e.g. GIMP) or Symmetric Nearest Neighbor - (obviously these are rasterization-based, but to give a sense of what I'm after).

     

    Despeckle
  2. #2
    Polygon Polygon @Polygon🌶

    I absolutely have no clue what you like to have as a result from this snippet. Gimp Colors->Threshold can help to get a clearer shape. Depending on the image you can then select by color via click+drag - once you get the amount you want to keep go Select->To Path and at the path tab go Export Path="yxz".svg. In Inkscape (1.3b) you can use Path->Split-Path to isolate the big from the small parts.

  3. #3
    Polygon Polygon @Polygon🌶

    Just saw the svg. With 1.3b you can use Path->Split Path to separate the wheat from the chaff:

    There once was a request in this forum how to get rid of tiny vector parts. Maybe try a forum search with fingers crossed. ;-)

  4. #4
    bastianilso bastianilso @bastianilso

    @Polygon: thanks for your prompt reply, this solved much of my problem. Apologize if the attachments were confusing.

    I was only aware of Path -> Break Apart, not the Path -> Split paths function (which splits into non-overlapping sections).

    There is some implied manual selection labor afterwards - I would manually need to differentiate which blobs are too small, select and remove them. But as long as the shapes I need to recover are not too many (e.g. just one, three, ten), this would work much better,

    Thanks for your help.

  5. #5
    bastianilso bastianilso @bastianilso

    @Polygon  maybe your 'Split Path' suggestion would be worth including in the trace bitmap tutorial. Just an idea! :)

  6. #6
    Polygon Polygon @Polygon🌶

    Split Path is a relatively new function afaik.

  7. #7
    Windell Oskay Windell Oskay @oskay

    Have you tried adjusting the "Speckles" option while tracing? So far as I understand, that option is there specifically to solve this particular issue.

  8. #8
    Polygon Polygon @Polygon🌶

    I´ve tried but it seems to do nothing currently in 1.3beta. Color Quantisation might be a better option here followed by Split Path on the result.

  9. #9
    Windell Oskay Windell Oskay @oskay

    I'm on 1.2.1, and the speckles option does appear to work. (Perhaps that should be reported as a bug, if you're able to consistently reproduce it.)

Inkscape Inkscape.org Inkscape Forum Beyond the Basics "Despeckle" tool? (removing noise blobs after tracing bitmap)