saving the transformation that minimizes the bounding box if required