though its probably an unnecessary optimization, the convolve should be more expensive than the extra allocation
but as were at it, one can skip the > 0 check if the input image is already a boolean image.