Flipping vertically and horizontally does not behave as documented. I missed that because the flip function lacks any proper tests.