[R] changing image dimensions

hadley wickham h.wickham at gmail.com
Tue Nov 7 14:18:24 CET 2006


> I'd get an external program to do it (e.g. ImageMagick) rather than
> reinventing.  But if I had to reinvent, I'd do it by creating a function
> to interpolate [0,1] x [0,1] values from within the original image, and
> evaluate that function at the appropriate spots within the bigger one.
>
> Choosing which kind of interpolation could be tricky, especially if the
> image is in colour:  that's why I'd suggest using someone else's work.

Bicubic interpolation
(http://en.wikipedia.org/wiki/Bicubic_interpolation) is pretty good,
and might not be too hard to implement.  High-end image software use
more complicated algorithms:
http://www.americaswonderlands.com/digital_photo_interpolation.htm

Hadley



More information about the R-help mailing list