Using an algorithm to insert or remove pixels vertically or horizontally, you can stretch and shrink images without distorting the elements in them. This video explains how it's done.
Co-inventor of this technology was hired at Adobe... I hope this appears in the next version of Photoshop!