Usage of 'close_binary'

Is there anybody with some experience of function close_binary?

I just tried around and cannot understand the parameters well enough. Here is an example which is produced by the command

gmic input.tif +close_binary 100,2,20,10,180,1,5,1 o. result.tif

input.tif (5.0 KB)
result.tif (5.0 KB)

Still there is a small piece not closed…
Any help is appreciated, but with close_binary!

They contain binary images.

I stay away from over complex stuff, which is why my commands are rather limited. Anyway, plugin filter Colorize Lineart [Smart Coloring] uses close_binary. Play with it to get a more intuitive sense.

Thank you @afre! I’m not such a Gimp user…

However, at least I found that a reduced number of pixel set improve the result considerably! Still there is a small piece not closed, not understandable for me!

gmic input.tif (0,1,0;1,1,1;0,1,0) +erode.. . rm.. xor close_binary 100,2,20,10,180,1,5,1 area. 0 neq. {i(0)}

The filling part area. 0 neq. {i(0)} is a quick hack for isolated objects only!

You should probably enclose your code in ` ` because the forum changes .. to ....

I didn’t mention this before but I could totally understand why the algorithm couldn’t close the gap: the gap is an edge case. Pardon my triple pun. :stuck_out_tongue:

This is not what you want but I would start by doing a closing

gmic input.tif (0,1,0;1,1,1;0,1,0) +erode.. . rm.. xor close_binary 100,2,20,10,180,1,5,1 dilate 5 erode 5

Thanks @afre.
Yes, there is lot of space for improvement…
Actually I’m trying repeated application of close_binary .