[R] changing image dimensions

Duncan Murdoch
Tue, 07 Nov 2006 12:09:54 -0000

On 11/7/2006 6:57 AM, Milton Cezar Ribeiro wrote:
> Hi there,
>
>   I have some 1024x1024 binary images (as matrix), and I need change the
dimensions to 1280x1280.
>
>   Any idea?

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.

Duncan Murdoch