Search code examples
algorithmraster

raster images zooming algorithms


Suppose we have 20x20 raster image. How does zooming work? For instance how to map (Xo,Yo) to (Xn, Yn), where o - original, n - new. Obviously there are 2 cases when new resolution is less or greater than original one. Feels like you would try similarity transformation - but then how do you apply it to pixel per pixel, so that resulting image has no holes (or when resulting image has lower dimensions, how would you fit there).


Solution

  • There are lots of algorithms to zoom and resize images. This is generally referred to as resampling. Wikipedia has lots of information about this along with algorithm examples:

    https://en.wikipedia.org/wiki/Resampling_(bitmap)