masks: fix some rendering issues for the path shape (mostly affecting border cases)

(cherry picked from commit bb7c87a08ddf087e9e0aba291c757894d36058e7)
tif: use correct type for planar config

Fix import of TIF generated by DT itself, enfuse, align_stack_image
for example

(cherry picked from commit c1b8fefb0d88e0444eddbeb2f024253ec99858f3)