Scale images in several ways.
1)
nearest neighbor - kill or clone the nearest neighbor.
We shorten the rows and columns of pixels if we need to reduce them, and duplicate them if we need to enlarge the image - it doesn't get any easier ... And faster, probably, too ... In general, everything is fine until we remember about the picture quality.
2)
bilinear - here we cross our neighbors.
Reducing the image, we change two pixels for one, equal to something average, and at increase just the same pixel is inserted between parents. Not too difficult, but the quality is much better!
')
3)
bicubic - Swedish family.
It's all the same as with bilinear, only more parents. Those. the color of the “child” is affected by all the neighboring pixels, and sometimes the neighbors of the neighbors. And it certainly is more beautiful.
4)
vector / fractal based - here the algorithms are more complicated.
If in a nutshell, before scaling, the image is vectorized, and in the process of choosing colors for new pixels, vectors are involved, the edges of which make a bit more contrast. As a result, the image basically wins.
Here, admire:

But this entire arsenal has been developed for proportionally enlarging or reducing images. No, this all, of course, will work even if you compress or expand the image only horizontally or vertically, but the changed proportions of objects will spoil the whole impression.

Shai Avidan and Ariel Shamir from the Mitsubishi Electric Research Laboratory presented at the SIGGRAPH 2007 conference the technology of disproportionate image scaling without changing the proportions of objects on it. Hmm ... sounds paradoxical ... but still it is, and here's an example:


Not bad, huh?
In theory, everything is simple;)
The technology allows us to determine which elements of the image are more and which are less important for perception, and having this information, when the image is disproportionately scaled, we compress / stretch something stronger, and do not change anything at all. The main thing, of course, is how to determine what is important and what is not. Here you can rely on the developed algorithm, and you can help him by manually determining the critical places in the image.
And one more application of this technology: if, to remove a piece of the image and stretch, using the new technology, the neighboring parts to the resulting hole, it turns out that there was no piece of it. I think it's more interesting than the banal Clone Stamp and its variations;)
And now we look at everything in the video:
Well, it remains only to wait for commercial or non-commercial implementations;)
Ps. Here is the version in Apple QuickTime with
the highest resolution:
Seam Carving for Content-Aware Image Resizing