First version of 2D transformations
Checks for returned value by domain functor.
cleanups and  test for gray image