%% Shrink Image Using Nearest-Neighbor Interpolation
% Load an image into the workspace.

I = imread('ngc6543a.jpg');

%
% Shrink the image to 40% of the original size using nearest-neighbor interpolation. This is the fastest method, but it has the lowest quality.

J = imresize(I,0.4,'nearest');

%
% Display the original image and the resized image.

imshow(I)
title('Original Image')
imshow(J)
title('Resized Image Using Nearest Neighbor Interpolation')

% Copyright 2020 The MathWorks, Inc.