A method is presented for shape transformation in the plane. The primary strength of the proposed method over previous approaches for shape transformation is that our method can achieve shape transformation in a domain that can contain obstacles which are possibly in motion. A smooth transformation between two given polygonal shapes is to be attained while ensuring that any part of the shape is free of collision with the obstacles in the domain during the transformation process. The problem is formulated as minimization of a cost function associated with each transformation path that controls length, smoothness, and collision-freedom of the path. The problem is solved in three steps. First, a population of tentative transformation paths is generated by combining path planning for an anchor point in the shape and a randomization process. Second, collision detection and shape deformation techniques are applied to keyframes along the paths to minimize the occurrence of collision. Lastly, a genetic algorithm is used to refine the population of transformation paths. Experimental results are presented to demonstrate the feasibility of our approach.