Vectorize within Rastermask module

Hi folks … I just have a question regarding the raster mask module and its behavior .
When I load a subject mask , created with PS and saved as pfm or png , into the module … then press the vectorize button I do get randomly various amounts of paths created . They do show up in the mask manager , as expected … but the number of those created paths is enormous . Varying from 15 right up to 90 , per image !!!
I found out how to get the correct path immediately … and then deleting the others that are not really actual paths !!! At least none of the others do show any sign of being a path .
Anyone an idea … why that is ?

Running on macOS Tahoe M1 and the latest DT nightly build

Andreas

Well, they are two different techniques. If you want to approach a raster with a vector you often need lot of nodes unless the raster image has a lot of squares, triangles and circles.

What you could do to see it darktable is the issues (which I highly doubt). Is load your mask in Inkscape and vectorize in it that program and compare that with darktable.

I find 15-90 actually very low.

1 Like

THX for the answer …
you might have got my question wrong !!!
It´s not about nodes , it is about why are so many paths created within DT mask manager instead of one from a single mask created outside and imported into Raster Mask module ?

Andreas

Something to do with the mask, please post a PNG/PFM mask.

1 Like

MmmmH … what do you think you can see if do post a png/pfm mask file ?
Asking just for the sake of interest

but here you go , but can only upload a png , guess the pff file is too large

If the mask is continuous. Looks like it is, but there is fuzzy borders, maybe that’s part of the issue?

LOL … that´s how a precise mask should look like !!!
You might be right … as the fuzzier or the more detailed the mask is , the more useless paths are created by the " vectorize " move inside of DT .
To make clear … the one or sometimes two that are good , are detailed as the original . All the rest are paths with nothing or a few speckles here and there in the mask .
I hope this could be solved to avoid this stupid deleting of unusable paths in the mask manager .
Luckily I know meanwhile where to find the one or two usable ones in the stack of the mask manager .

Then don’t vectorize and use the mask as-is.

1 Like

Yes I can do that … but I want to have the options , that do come along when I can use path as parametric mask with it´s endless options :wink: :grinning:

Hope you can understand that …

… I know it is much , I might ask for .
Just hoped for an answer … why that is and if this issue might be solved in the future .

I have not experimented at any length with it but I had the same result when I just pulled up an example I created when playing around with the SAM2 plug-in… It might be a nice refinement to have a sort of sensitivity setting so that you don’t get all those small paths or you can set a max number of generated masks…

There is no issue so nothing to fix. A vector mask cannot represent precisely a raster mask as there is some smoothing of the path vectors.

5 Likes

Ok … did not know that !

For my sake of interest … what is the concept or the idea behind it ,to have the option to create a path from a raster mask and ending up with truck loads of paths ???
I guess this will happen as well , if the raster mask is created by DT itself ?
Have not tried it yet … to be honest .
What kind of sense does it make in that context … to have sooooo many paths in the mask manager , when 90 % of them are utterly useless . Well at least for me .
I just want to understand the concept behind it … as this vectorize function is pretty new as far as I know .

Maybe you can shed some light into my darkness … LOL

Andreas

It worked pretty well on many tests I have done. So what you have is a bug because for some reasons potrace lib find some very small area outside the mask in your image.

For the record, I have implemented this vectorization to have a way to create path masks out of an AI generated mask. And it works well there. So again there is something strange in your mask creating those small speckles.

This will be fixed in next version.

1 Like

You also probably want to invert your mask as the actual object should be black and the ignored area white.

Oh … cool so there is hope , does sound different as per your other reply .
Anyhow thx for the additional info.
I also do play around with the available AI generated masks … like SAM3 , they are OK and usable in parts . But even when using SAM3 I do get more than a single path or vector mask .
And those SAM3 masks are very rudimental , compared to a subject mask created with PS .
But if there is light on the horizon … I will wait patiently hoping there will be a working solution !

Good luck with your work Pascal

Oh i have tried different options …

Because from your original description it was not clear where the problem was. I thought it was because of the smooth borders but it is in fact anywhere on your mask outside of any form.

Yep … sometimes hard to describe a thing that does appear in DT … even more so with sometimes limited English language :joy:

1 Like

I’ve just push the fix, now in your masks you’ll get one and two created path in the mask manager.

3 Likes