Fix pixmapMask and add doctest