knip icon indicating copy to clipboard operation
knip copied to clipboard

Distance Map creates gradient image if no background present

Open imagejan opened this issue 8 years ago • 2 comments

The Distance Map node, when fed an entirely white (foreground-only) image, produces a gradient image with intensities I(y) = (w+h) + y, which can lead to misleading results.

Of course, when ignoring image borders, a foreground-only image is a pretty much undefined case, but I'd expect to get a flat image rather than an image that suggests any kind of directionality.

Here's an example workflow reproducing the issue: Distance Map Issue.zip

imagejan avatar Apr 04 '17 06:04 imagejan

Wouldn't adding the "Out of Bounds Strategy" (Zero-Value) to the Distance Map node actually solve this issue?

gudlap avatar Apr 25 '18 18:04 gudlap

Yes, allowing the user to specify the out-of-bounds strategy would definitely solve this. Also, defaulting to an extendBorder strategy would lead to a less surprising behavior for most use cases, I assume.

imagejan avatar Apr 26 '18 06:04 imagejan