max/min pixelmask added