View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Image Resize

2.0 | 3 ratings Rate this file 13 Downloads (last 30 days) File Size: 1.39 KB File ID: #30787 Version: 1.0
image thumbnail

Image Resize



Another function to resize an image.

| Watch this File

File Information

IMAGERESIZE able to resize an image. You can downsize and also upsize an image using scaling factor.

This is a simple implementation of matlab IMRESIZE code.

Nothing new about this code.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
15 Jul 2016 DGM

Yes, using a loop without preallocation means this is terribly slow for what should be the most simple interpolation method (nearest-neighbor).

While simplicity has its place, people looking for a image-resizing tool outside of the Image Processing Toolbox shouldn't think that this reflects the approach used by IMRESIZE.

A faster and more flexible IMRESIZE alternative would be to use INTERP2().

%% set axis scaling


img_out=zeros([ceil(sz(1:2).*[yscale xscale]) 3]);
for c=1:numchans

This will work on images with any number of channels, and can use different interpolation methods. It also doesn't require any IPT functions.

That's not to imply that my suggested code replicates IMRESZE behavior either.

Comment only
24 Jan 2016 Samet Taspinar

for loop is not a good idea in matlab, please try vectorizing it.

10 Oct 2014 Wetch

Wetch (view profile)

25 Sep 2012 Dung Luong

13 Mar 2012 Grzegorz Knor

Please pre-allocate the img_out variable to speed up your code.

Comment only

Contact us