We report on the use of a shape transition process to resize patterns prerecorded inside polystyrene film. The shape transition, which is shrinkage in two dimensions and expansion in the third (the volume is conserved), was brought about by annealing polystyrene above the glass transition temperature. This caused approximately twofold lateral shrinkage and fourfold axial stretching of the film, inside which micrometer-sized patterns had been recorded by femtosecond pulses. The transformation of these patterns corresponded to the macroscopic shape transformation of the film. The shape transition was also used to transform a diffraction grating. This allowed the transformation to be confirmed by the corresponding change in diffraction efficiency. The applicability of the shape transition process to nanofabrication is discussed.