In this paper, transformation optics is presented together with a generalization of invisibility cloaking: instead of an empty region of space, an inhomogeneous structure is transformed via Pendry's map in order to give, to any object hidden in the central hole of the cloak, a completely arbitrary appearance. Other illusion devices based on superlenses considered from the point of view of transformation optics are also discussed.