An invisibility device should guide light around an object as if nothing were there, regardless of where the light comes from. Ideal invisibility devices are impossible, owing to the wave nature of light. This study develops a general recipe for the design of media that create perfect invisibility within the accuracy of geometrical optics. The imperfections of invisibility can be made arbitrarily small to hide objects that are much larger than the wavelength. With the use of modern metamaterials, practical demonstrations of such devices may be possible. The method developed here can be also applied to escape detection by other electromagnetic waves or sound.